-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bazel build somecpp_library fails if it depends on another library #67
Comments
This is very surprising. Couldn't reproduce with this BUILD file on Linux, though: cc_library( cc_library( cc_binary( Assigning to Damien since he knows a tad more about Mac than I do. |
Cannot reproduce:
Succeed on my mac I will commit it to share it but the output is clean. I might have forgotten a flag though EDIT NOTE: I added the two build to the test case to have a failing test case for future reference. |
\o/ I have a failing test |
Add an a.h which b.cc includes and calls a function from.
|
The problem is that darwin clang expect to have all the dependency provided at compile time. It is not going to be fast to fix. |
I edited the test case in my previous message to have an actually failing one for future reference. |
I've encountered this issue as well. |
I've been hitting this too. I've worked around the issue by adding:
into my CROSSTOOL file. Not sure the larger implications of this style lookup though. But, it's enough for me to actually compile, so I'm happy for now. |
Running with --nobatch then --batch ensures the second run kills the first one (because of changed startup flags) and the second one too (because of --batch). The `kill` assertions in lines bazelbuild#66 and bazelbuild#67 now succeed. Change-Id: Ibee4997783a820858fc2d2bdda02082a91385d0e
make the following:
cc_library(name="A", ...)
cc_library(name="B", srcs=["b.cpp"], deps=[":A"], ...)
cc_binary(name="main", ..., deps=[":B"])
bazel build :main works just fine (it correctly puts libA.so and libB.so on the link line)
bazel build :A - same
but bazel build :B will fail with:
From Linking lib/libB.so:
Undefined symbols for architecture x86_64:
"...."
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ERROR: lib/BUILD:3:1: Linking of rule '//lib:lib' failed: gcc failed: error executing command /usr/bin/gcc -shared -o bazel-out/local_darwin-fastbuild/bin/lib/libB.so bazel-out/local_darwin-fastbuild/bin/lib/_objs/lib/lib/b.pic.o -lstdc++ -B/usr/bin -Wl,-S: com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
It appears that liba.so is missing from the command
The text was updated successfully, but these errors were encountered: