Can't compile on latest master, "ld: library not found for -lc++"

1,665 views
Skip to first unread message

hb...@webrtc.org

unread,
Nov 11, 2016, 4:29:05 AM11/11/16
to discuss-webrtc
Hi,

I did a gclient sync on the latest master yesterday on my macbook, and since then I can't compile, getting the following error for whatever target it is trying to link:

[2/2185] LINK ./genstring

FAILED: genstring 

export DEVELOPER_DIR=/Users/hbos/workspace/webrtc_ios/src/build/mac_files/Xcode.app;  TOOL_VERSION=1478813669 ../../build/toolchain/mac/linker_driver.py /Users/hbos/goma/gomacc ../../third_party/llvm-build/Release+Asserts/bin/clang++  -stdlib=libc++ -arch x86_64 -isysroot /Users/hbos/workspace/webrtc_ios/src/chromium/src/build/mac_files/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -mmacosx-version-min=10.9 -Wl,-ObjC -Wl,-rpath,@loader_path/. -Wl,-rpath,@loader_path/../../.. -Wl,-pie -o "./genstring" -Wl,-filelist,"./genstring.rsp"  

ld: library not found for -lc++

clang: error: linker command failed with exit code 1 (use -v to see invocation)

Traceback (most recent call last):

  File "../../build/toolchain/mac/linker_driver.py", line 229, in <module>

    Main(sys.argv)

  File "../../build/toolchain/mac/linker_driver.py", line 79, in Main

    subprocess.check_call(compiler_driver_args)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 540, in check_call

    raise CalledProcessError(retcode, cmd)

subprocess.CalledProcessError: Command '['/Users/hbos/goma/gomacc', '../../third_party/llvm-build/Release+Asserts/bin/clang++', '-stdlib=libc++', '-arch', 'x86_64', '-isysroot', '/Users/hbos/workspace/webrtc_ios/src/chromium/src/build/mac_files/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk', '-mmacosx-version-min=10.9', '-Wl,-ObjC', '-Wl,-rpath,@loader_path/.', '-Wl,-rpath,@loader_path/../../..', '-Wl,-pie', '-o', './genstring', '-Wl,-filelist,./genstring.rsp']' returned non-zero exit status 1


I've tried updating Xcode (in app store, maybe that's not what this uses?), clearing the out directory and fetching a fresh copy of webrtc, compiling with or without goma, same problem every time.
I don't have this problem on the latest branch on a chromium checkout.

If I checkout a branch that's a few days old and do gclient sync I can compile again. For now I can gclient sync on an old branch and continue working on the latest, but that's not going to work for very long.

Does anyone else have this problem? Know how to fix? I'm not sure what to do.

Henrik

kthel...@webrtc.org

unread,
Nov 11, 2016, 5:06:58 AM11/11/16
to discuss-webrtc
What version of macOS and XCode are you using? 

hb...@webrtc.org

unread,
Nov 11, 2016, 5:17:14 AM11/11/16
to discuss-webrtc
macOS Sierra 10.12.1 and Xcode 8.1
Note that I updated these things when compiling started failing (same problem before and after), so it's not specific to these versions per-se but it might still be specific to recent versions.

kthel...@webrtc.org

unread,
Nov 11, 2016, 5:45:49 AM11/11/16
to discuss-webrtc
Ah, this is due to the hermetic toolchain thing that recently landed in chromium. Add "use_system_xcode = true" to your gn args.


On Friday, November 11, 2016 at 10:29:05 AM UTC+1, hb...@webrtc.org wrote:

Henrik Kjellander

unread,
Nov 11, 2016, 8:24:47 AM11/11/16
to discuss-webrtc
I've filed https://bugs.chromium.org/p/webrtc/issues/detail?id=6700 to track this. Notice that it only affects Googlers.

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/2e0aec87-ce5e-4b42-95ea-a4c6cad83dff%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

hb...@webrtc.org

unread,
Nov 11, 2016, 11:21:48 AM11/11/16
to discuss-webrtc
Thanks! Glad that the problem is being worked on and "use_system_xcode = true" works in the meantime :)
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.

Henrik Kjellander

unread,
Nov 14, 2016, 5:38:13 AM11/14/16
to discuss-webrtc
I think this was fixed in https://codereview.webrtc.org/2496113002 (now use_system_xcode=true becomes the default for standalone WebRTC builds).

To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/d502cdee-0055-4567-ae3e-162eb7d30944%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages