You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After updating to Bazel 0.15.0, C++ binaries are being linked with the flag -Wl,-no-as-needed which does not exist in the MacOS linker.
$ bazel-0.15.0 build //:hello
ERROR: /Users/jmillikin/src/test-bazel-gcc/BUILD:1:1: Linking of rule '//:hello' failed (Exit 1)
ld: unknown option: -no-as-needed
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Target //:hello failed to build
Use --verbose_failures to see the command lines of failed build steps.
$ cc --version
Apple LLVM version 10.0.0 (clang-1000.10.25.5)
Target: x86_64-apple-darwin17.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
$ ld -v
@(#)PROGRAM:ld PROJECT:ld64-408.1.1
BUILD 05:18:43 May 25 2018
configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em
LTO support using: LLVM version 10.0.0, (clang-1000.10.25.5) (static support for 21, runtime is 21)
TAPI support using: Apple TAPI version 10.0.0 (tapi-1000.0.7.3)
Same thing happened to me, brew didn't have the versions I wanted to try so I removed it and installed from source like described here. protocolbuffers/protobuf#4841
Activity
jmillikin-stripe commentedon Jun 26, 2018
It looks like the implementation of
_is_linker_option_supported()is broken for Apple's Clang:Note that the stderr reports the flag as
-no-as-needed, but the configuration logic is looking for the-Wl,prefixed version.jin commentedon Jun 26, 2018
cc @laurentlb (RM)
soonho-tri commentedon Jun 27, 2018
I've hit the same issue,
ld: unknown option: -no-as-needed. FYI,clang-902.0.39.2), I don't have this problem.clang-900.0.39.2), I can reproduce the problem.clang-800.0.42.1), I can reproduce the problem.RNabel commentedon Jun 27, 2018
Can confirm, 0.15.0 working with
clang-902.0.39.2.hlopko commentedon Jun 27, 2018
@laurentlb Can/Should we have a patch release for this? I'll work on the fix.
yuikns commentedon Jun 28, 2018
I am on
OSX-10.13.5 (with clang-902.0.39.2), but still get a broken.hectim commentedon Jun 29, 2018
Same thing happened to me, brew didn't have the versions I wanted to try so I removed it and installed from source like described here.
protocolbuffers/protobuf#4841
Downgrading to bazel 0.14.1 fixed it
hlopko commentedon Jul 5, 2018
@laurentlb FYI: this is now fixed.
oferb commentedon Jul 5, 2018
@mhlopko In which version of Bazel is it fixed?
hlopko commentedon Jul 5, 2018
@oferb only at HEAD. That's why I pinged Laurent, to consider a patch release. But since we're cutting 0.16 soon, maybe it's not needed.
@buchgr (release manager for 0.16) Can you make sure the fix makes it into 0.16?
16 remaining items
laurentlb commentedon Jul 13, 2018
See #5591
Fix autodetection of linker flags
Fix autodetection of -z linker flags
Fix autodetection of linker flags
Fix autodetection of -z linker flags
Fix autodetection of linker flags
Fix autodetection of -z linker flags
Fix autodetection of linker flags
Fix autodetection of -z linker flags
Fix autodetection of linker flags
Fix autodetection of -z linker flags
Fix autodetection of linker flags
Fix autodetection of -z linker flags
Fix autodetection of linker flags
Fix autodetection of -z linker flags