Skip to content

rustbuild: linker error during 32 bit compilation #37906

Closed
@est31

Description

@est31
Member

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

Activity

TimNN

TimNN commented on Nov 21, 2016

@TimNN
Contributor

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.

added
T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
on Nov 21, 2016
alexcrichton

alexcrichton commented on Nov 21, 2016

@alexcrichton
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

est31 commented on Nov 21, 2016

@est31
MemberAuthor

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

TimNN

TimNN commented on Nov 21, 2016

@TimNN
Contributor

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

est31

est31 commented on Nov 21, 2016

@est31
MemberAuthor

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

est31

est31 commented on Nov 21, 2016

@est31
MemberAuthor

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

hanna-kruppe

hanna-kruppe commented on Dec 4, 2016

@hanna-kruppe
Contributor

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

est31

est31 commented on Dec 4, 2016

@est31
MemberAuthor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @alexcrichton@TimNN@hanna-kruppe@est31

        Issue actions

          rustbuild: linker error during 32 bit compilation · Issue #37906 · rust-lang/rust