-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Linker error compiling with clang on linux #3878
Comments
Not all compilers on linux add it implicitly. It won't do any harm on those which do. Closes google#3878
Actually slight correction here: |
The problem is very likely
|
When compiling tests with bazel with clang on linux, I get a linker error
undefined reference to nextafter
.Does the bug persist in the most recent commit?
Yes.
What operating system and version are you using?
Linux. The specifics don't matter because we're using a custom sysroot, described below.
What compiler and version are you using?
clag
version 13.0.0 with--sysroot
pointing to a sysroot built usingcrosstool-ng
based on centos7.What build system are you using?
bazel version 5.1.1.
Additional context
This is basically the same bug as #3601, but the fix for that one made the incorrect assumption that this was only a problem on BSD. The correct solution is to change
googletest/BUILD.bazel
Lines 123 to 125 in 0e40217
to be simply
It won't do any harm when using compilers like gcc which add
-lm
implicitly, but it will prevent breakage for compilers which do not do this.The text was updated successfully, but these errors were encountered: