-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
bintools-wrapper change causes builds to fail on darwin - ld: Assertion failed #105573
Comments
On staging-next, it failed in this build first: https://hydra.nixos.org/build/130716618 (2020-11-18 16:22:16), and in the builds that followed: https://hydra.nixos.org/build/130716618/evals |
Since @uri-canva has identified 473b341 being the culprit for the same linker failure for bazel here, could anyone try to verify whether reverting the change to bintools-wrapper or manually adding the |
Verified reverting the change fixes libmodplug. |
Assertion failure is raised from here: |
The assumption with the bintools-wrapper change seems to be that clang will add a For libmodplug, it fixes the build when we remove the linker flags: e2f0da2
see successful build I have no idea why this happens; is 10.5 just too old for the cctools / sdk combo? |
Fails with ``` 0 0x103e67a51 __assert_rtn + 129 1 0x104040444 ld::passes::stubs::x86_64::classic::LazyPointerAtom::LazyPointerAtom(ld::passes::stubs::Pass&, ld::Atom const&, bool, bool) + 420 2 0x10403dc6a ld::passes::stubs::Pass::makeStub(ld::Atom const&, bool) + 2762 3 0x10403ec5f ld::passes::stubs::Pass::process(ld::Internal&) + 2511 4 0x10403f2c0 ld::passes::stubs::doPass(Options const&, ld::Internal&) + 128 5 0x103e68ff4 main + 1860 6 0x7fff68dc3cc9 start + 1 A linker snapshot was created at: /tmp/ijar-2020-11-01-111228.ld-snapshot ld: Assertion failed: (targetAtom != NULL), function Fixup, file ../../../../ld64/src/ld/ld.hpp, line 776. clang-6.0: error: linker command failed with exit code 1 (use -v to see invocation) ``` See NixOS#105573 for details.
Recently I was able to fix building bazel on Darwin. And since trying to build bazel-watcher on top of this fix no longer fails with the linker error we have seen before, I am inclined to close this issue. I'll open a new one for bazel-watcher which now fails with "fatal error: 'deque' file not found" (or alternatively any other standard C++ header). |
Um, actually that was probably too fast. Since bazel-watcher also uses the bazel tools/osx/xcode_configure.bzl it will eventually end up with the same linker error -- only now cannot even get so far. |
I think this is still an issue? At least, if I add
I can resolve this by adding both clang and gcc to my shell.nix. Not one or the other, but both. Which feels very odd. And unfortunately for me, having both gcc and clang present breaks other things (building ruby native extensions). |
Closing, since I could successfully build bazel-watcher on Darwin after working around the C++ header problem. |
TLDR;
The builds error out with:
Currently effected packages are:
libmodplug(fixed with libmodplug: Fix build on darwin #106430)bazel(2021-02-02: fixed by using clang 7 to build, and removing the-mmacosx-version-min
flag -- see bazel: 3.3.1 -> 3.7.2 #105439 (comment))@uri-canva bisected this commit 473b341 to be responsible for the error, and verified that reverting that change makes them build again.
Seems like libmodplug broke in eval 1628634, when the changes for big sur where merged: #98541 (changes)
Could this be a reason for those linker errors?
Originally posted by @avdv in #105439 (comment)
For posterity:
Seems to happen with clang 6 and clang 7.
The text was updated successfully, but these errors were encountered: