-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Linking liblibc using musl target fails ("unrecognized relocation") with the new nightlies #39979
Comments
I can reproduce this with the docker image (by the way @golddranks, there's no need to build Diff for This works fine on stable, thus tagging as a regression. |
I cannot reproduce this with a current ubuntu release. After some looking around, I believe that the problem could be that the During the time this was introduced, the nightlies were switched from buildbot to travis so I guess this may have caused this problem (cc @alexcrichton). |
@TimNN, thanks for the pointer, the Dockerfile uses now the distro-provided musl. (But errors nevertheless, so it isn't just the self-built musl that has this problem.) |
@golddranks: I actually meant to say, that you don't need to get any kind of musl yourself: musl is linked statically into the rust stdlib (unless I am misremembering something). |
Ah, really? I've been building musl stuff with native dependencies, which I have had to build by hand, so I've always needed the musl build environment anyway, so I didn't know this :D |
This looks like #34978 and agreed this is likely a regression in switching nightlies to Travis/AppVeyor. The fix last time was to pass Another possible bug, although I forget if it has this exact signature, is that when we compile binaries with a very new binutils it ends up being incompatible with older binutils (for whatever reason). There's typically flags we can pass, though, to disable the "new binutils behavior incompatible with older binutils". Also FWIW this is how we build nightlies Oh.... maybe it's because we don't pass the flag when building musl itself. |
The mitigations for rust-lang#34978 involve passing `-Wa,-mrelax-relocations=no` to all C code we compile, and we just forgot to pass it when compiling musl itself. Closes rust-lang#39979
Ok, I've got a fix at #40019 |
travis: Compile a more compatible libc.a for musl The mitigations for rust-lang#34978 involve passing `-Wa,-mrelax-relocations=no` to all C code we compile, and we just forgot to pass it when compiling musl itself. Closes rust-lang#39979
travis: Compile a more compatible libc.a for musl The mitigations for rust-lang#34978 involve passing `-Wa,-mrelax-relocations=no` to all C code we compile, and we just forgot to pass it when compiling musl itself. Closes rust-lang#39979
The fix landed on the commit 1572bf1, but the same error occurs even on the latest nightly ( So the problem isn't solved yet. |
Ah, but this times the error is:
So it seems that jemalloc needs the same treatment? |
These flags were supposed to be relevant for musl, not for gnu cc rust-lang#39979
@golddranks oh I think that's #40130 (an accidental typo) |
…matsakis travis: Fix typos in linux-tested-targets These flags were supposed to be relevant for musl, not for gnu cc rust-lang#39979
Whatever it was, this is fixed for me now in the |
Thanks @alexcrichton! :-) |
Here's a dockerized test case: https://github.com/golddranks/libc_regression_test/ (run with
docker build .
)Here's the error:
The linking error seems to happen only with the musl target. I originally posted this as rust-lang/libc#529, but because the breaking is dependent on the nightly, it seems that this is an
rustc
issue rather than an issue of thelibc
crate.After testing with various nightlies, it seems that the nightly
nightly-2017-02-16 installed - rustc 1.17.0-nightly (62eb6056d 2017-02-15)
is the first one that breaks. The nightly before that,nightly-2017-02-13 installed - rustc 1.17.0-nightly (956e2bcba 2017-02-12)
is the last one that works.So that seems to imply that the commit that introduced this regression is in the range
956e2bcba..62eb6056d
. Any thoughts about which one it might be?The text was updated successfully, but these errors were encountered: