Skip to content
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

rustbuild: linker error during 32 bit compilation #37906

Closed
est31 opened this issue Nov 21, 2016 · 8 comments
Closed

rustbuild: linker error during 32 bit compilation #37906

est31 opened this issue Nov 21, 2016 · 8 comments
Labels
T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@est31
Copy link
Member

est31 commented Nov 21, 2016

I'm on a 64 bit OS and want to test 32 bit rust so that I can confirm the intrinsics for #37900 work. But unfortunately, rustbuild doesn't even get so far and fails with an error early on. Obviously, I've tested without the PR too, but same result. The results below are all from a test run after a git checkout to current master (commit 4bc9290), git clean -xfd to get rid of all artifacts and taking config.toml from config.toml.example and changing two things: setting build = "i686-unknown-linux-gnu" and codegen-units = 1. I've also tested with letting codegen-units as default, but same result (the logs are still from the test run with codegen-units == 1 but I guess there is no difference).

The relevant part of the full build log:

/usr/bin/ld: ~/src/rust/build/i686-unknown-linux-gnu/stage0-sysroot/lib/rustlib/i686-unknown-linux-gnu/lib/libstd-b0aea2b84e953509.so: __umoddi3: invalid version 21 (max 0)
~/src/rust/build/i686-unknown-linux-gnu/stage0-sysroot/lib/rustlib/i686-unknown-linux-gnu/lib/libstd-b0aea2b84e953509.so: error adding symbols: Ungültiger Wert

readelf on the file in question gives:

$ readelf -s ~/src/rust/build/i686-unknown-linux-gnu/stage0-sysroot/lib/rustlib/i686-unknown-linux-gnu/lib/libstd-b0aea2b84e953509.so | rg __umoddi3
1638:  1634: 000ad4ac    41 FUNC    GLOBAL DEFAULT   12 __umoddi3@GLIBC_2.3.3 (21)
5674:  3055: 000ad4ac    41 FUNC    GLOBAL DEFAULT   12 __umoddi3
@est31 est31 mentioned this issue Nov 21, 2016
2 tasks
@TimNN
Copy link
Contributor

TimNN commented Nov 21, 2016

Intuitively I would guess that you're missing the i686 version of glibc (although I think that intrinsic should come from compiler-rt (at least for later stages)?).

Looking at the i686 linux docker file, it installs g++-multilib, if you have not yet done so, you could try installing that.

@alexcrichton alexcrichton added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Nov 21, 2016
@alexcrichton
Copy link
Member

I believe this is a known bug and where rustbuild is just broken right now. rust-lang/compiler-builtins#119 is the fix for this which is being included in #37817

@est31
Copy link
Member Author

est31 commented Nov 21, 2016

@TimNN I had gcc-multilib installed, will try with g++-multilib.

@TimNN
Copy link
Contributor

TimNN commented Nov 21, 2016

@est31: It's probably save to ignore my comment, given @alexcrichton's response.

@est31
Copy link
Member Author

est31 commented Nov 21, 2016

@TimNN nope, same error with both gcc-multilib and g++-multilib installed. Will try with @alexcrichton 's PR...

@est31
Copy link
Member Author

est31 commented Nov 21, 2016

I confirm that with #37817 applied the bug is fixed. Thanks @alexcrichton !

@hanna-kruppe
Copy link
Contributor

I cherry-picked the fix in #38046, so this issue can be closed even though #37817 is not merged yet.

@est31
Copy link
Member Author

est31 commented Dec 4, 2016

Thanks! I haven't confirmed whether the issue is fixed, but I assume so.

@est31 est31 closed this as completed Dec 4, 2016
bors added a commit that referenced this issue Dec 8, 2016
i128 and u128 support

Adds support for 128-bit integers. Rebased version of #35954 , with additional improvements.

Thanks @nagisa for mentoring this PR!

Some of the problems that were resolved:

* [x] Confirm that intrinsics work on 32 bit platforms and fix them if needed

* Wait for #37906 to get fixed, so that work on intrinsics can be completed *(worked around by merging the PR on my local setup)*

* [x] Investigate and fix linkcheck failure

[plugin-breaking-change]

cc #35118
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

4 participants