Skip to content
This repository has been archived by the owner on Mar 28, 2022. It is now read-only.

Build fails on macOS 10.13 with Xcode 9 #97

Open
fxcoudert opened this issue Oct 4, 2017 · 3 comments
Open

Build fails on macOS 10.13 with Xcode 9 #97

fxcoudert opened this issue Oct 4, 2017 · 3 comments

Comments

@fxcoudert
Copy link

Building on macOS 10.13 with Xcode 9 fails with:

libtool -dynamic -flat_namespace -install_name libcodegen.4.1.2.dylib -lSystem -compatibility_version 4.1 \
		-macosx_version_min 10.6 -current_version 4.1.2 -o libcodegen.4.1.2.dylib -undefined suppress \
	    AudioBufferInput.o AudioStreamInput.o Base64.o Codegen.o Fingerprint.o MatrixUtility.o SubbandAnalysis.o Whitening.o -framework Accelerate
ld: file not found: 
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: internal link edit command failed
make: *** [libcodegen] Error 1

when running make -C src install

@vszakats
Copy link

vszakats commented Oct 12, 2017

I'm having a similar issue. Reduced example:

#!/bin/sh
echo 'int main(void) { return 0; }' > test.c
clang -c test.c
SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk \
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool \
-v -dynamic -o test.dylib test.o

+ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld -arch_multiple -arch x86_64 -dylib -dynamic -all_load -force_cpusubtype_ALL -no_arch_warnings /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/dylib1.o test.o -o test.dylib 
ld: file not found: 
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: internal link edit command failed

After up to a few dozen runs, it eventually executes successfully.

It randomly (and frequently) happens with any local projects as well when building dylibs. I remember a similar issue after upgrading to Sierra, which was resolved by disabling parallel builds. Parallel builds are still disabled, and the issue came back right after upgrading to High Sierra.

Ref: Apple Radar 34944562
Ref: https://trac.macports.org/ticket/54825

@vszakats
Copy link

vszakats commented Nov 11, 2017

I received a reply from Apple, where this was confirmed to be a libtool (cctools) issue which will be addressed in a future Xcode release. Apple suggested to replace libtool -dynamic with $CC -dynamiclib (which is the recommended way to create dylibs) to get around the problem.

@mitchblank
Copy link

On MacOS 11 I had to also remove -lSystem and -framework Accelerate from that libtool command line to get it to link libcodegen.4.1.2.dylib

mitchblank added a commit to mitchblank/homebrew-core that referenced this issue Feb 9, 2021
We already are patching this formula to fix issues that @fxcodert
hit on 10.13, this just does more of the same:
spotify/echoprint-codegen#97

I'm going ahead and marking this formula deprecated:
* Upstream repo has been quiet for over 5 years now
* The last tagged release 4.12 release came out almost 9 years ago (all
  changes since then have just been build/docs tweaks).
* The original project site is long-gone (but still referenced on
  github project page)

It really looks like this is long-dead so probably time to start
the long goodbye.
BrewTestBot pushed a commit to Homebrew/homebrew-core that referenced this issue Feb 9, 2021
We already are patching this formula to fix issues that @fxcodert
hit on 10.13, this just does more of the same:
spotify/echoprint-codegen#97

I'm going ahead and marking this formula deprecated:
* Upstream repo has been quiet for over 5 years now
* The last tagged release 4.12 release came out almost 9 years ago (all
  changes since then have just been build/docs tweaks).
* The original project site is long-gone (but still referenced on
  github project page)

It really looks like this is long-dead so probably time to start
the long goodbye.

Closes #70782.

Signed-off-by: Sean Molenaar <[email protected]>
Signed-off-by: BrewTestBot <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants