Skip to content

Cross compilation to 32-bit may be broken on recent nightlies #45500

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
alexcrichton opened this issue Oct 24, 2017 · 10 comments
Closed

Cross compilation to 32-bit may be broken on recent nightlies #45500

alexcrichton opened this issue Oct 24, 2017 · 10 comments
Assignees
Labels
P-high High priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@alexcrichton
Copy link
Member

alexcrichton commented Oct 24, 2017

As of a few nights ago I've noticed that a good bit of the Travis CI runs I've got that cross compile to 32-bit are now broken due to odd linker errors, for example https://travis-ci.org/alexcrichton/cc-rs/builds/290881204.

I bisected nightlies to this range, and @michaelwoerister I wonder if this is related to the change to sip128? Do you know of anything there that would cause linker errors?

Unfortunately I haven't been able to reproduce on Linux, I've just seen this on OSX and Windows

@alexcrichton alexcrichton added the regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. label Oct 24, 2017
@carols10cents
Copy link
Member

carols10cents commented Oct 24, 2017

manifests as these CI failures in cargo: rust-lang/cargo#4658

@alexcrichton alexcrichton added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Oct 24, 2017
bors added a commit to rust-lang/cargo that referenced this issue Oct 25, 2017
try pinning to a nightly of two weeks ago

This passed CI [over here](#4658) and should get the 32-bit windows cross compiling tests passing until someone figures out why rustc is broken for that purpose

r? @alexcrichton

cc rust-lang/rust#45500
@alexcrichton
Copy link
Member Author

Cc @michaelwoerister

@michaelwoerister
Copy link
Member

Yes, when switching to SipHash I also switched away from using leb128 for all integers. That might introduce a difference for isize and usize. I'll take a look.

@shaleh
Copy link

shaleh commented Oct 26, 2017

A simple Docker based test case fails with link issues. I made no edits to the generated code. This is just hello world.

rustup install nightly
rustup default nightly
cargo init test32bit --bin
cd test32bit
cargo build

I used https://github.com/ioft/dockerhub/i386-ubuntu/Dockerfile to test this. Note it makes an i686, not i386 but it is still 32 bit linux.

The failed output looks like this:

= note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m32" "-L" "/root/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/i686-unknown-linux-gnu/lib" "/root/test32bit/target/debug/deps/test32bit-4197078e3788cd4f.test32bit0.rust-cgu.o" "/root/test32bit/target/debug/deps/test32bit-4197078e3788cd4f.test32bit1.rust-cgu.o" "-o" "/root/test32bit/target/debug/deps/test32bit-4197078e3788cd4f" "/root/test32bit/target/debug/deps/test32bit-4197078e3788cd4f.crate.allocator.rust-cgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs" "-L" "/root/test32bit/target/debug/deps" "-L" "/root/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/i686-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/root/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/i686-unknown-linux-gnu/lib/libstd-f64e65221ded4189.rlib" "/root/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/i686-unknown-linux-gnu/lib/liballoc_jemalloc-15603b85f9b07db5.rlib" "/root/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/i686-unknown-linux-gnu/lib/liballoc_system-7f202905b2f90235.rlib" "/root/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/i686-unknown-linux-gnu/lib/libpanic_unwind-fd7102ed26e1ee75.rlib" "/root/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/i686-unknown-linux-gnu/lib/librand-b2608977e05bf703.rlib" "/root/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/i686-unknown-linux-gnu/lib/libunwind-3d18fc673b5da13d.rlib" "/root/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/i686-unknown-linux-gnu/lib/liblibc-390d7866de44001e.rlib" "/root/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/i686-unknown-linux-gnu/lib/liballoc-28619888b40bbbe2.rlib" "/root/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/i686-unknown-linux-gnu/lib/libstd_unicode-6e3e1588214a0702.rlib" "/root/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/i686-unknown-linux-gnu/lib/libcore-a30e14812908fc60.rlib" "/root/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/i686-unknown-linux-gnu/lib/libcompiler_builtins-20161fbf48c6c15f.rlib" "-Wl,-Bdynamic" "-l" "dl" "-l" "rt" "-l" "pthread" "-l" "pthread" "-l" "gcc_s" "-l" "c" "-l" "m" "-l" "rt" "-l" "pthread" "-l" "util" "-l" "util"
= note: /root/test32bit/target/debug/deps/test32bit-4197078e3788cd4f.test32bit0.rust-cgu.o: In function test32bit::main': /root/test32bit/src/main.rs:2: undefined reference tostd::io::stdio::_print::h6c953456faaea52a'
/root/test32bit/target/debug/deps/test32bit-4197078e3788cd4f.test32bit0.rust-cgu.o: In function main': /root/test32bit/src/main.rs:(.text.main+0x37): undefined reference tostd::rt::lang_start::hb4e4c925bf3928b1'
collect2: error: ld returned 1 exit status

@shaleh
Copy link

shaleh commented Oct 26, 2017

In a bigger project I see LOTS of linker errors. It cannot find core::panic, fmt macros, and on and on.

@michaelwoerister
Copy link
Member

The latest nightly should contain a potential fix to this problem. @shaleh, would you mind re-testing your case?

bors added a commit to rust-lang/cargo that referenced this issue Oct 30, 2017
Revert "Auto merge of #4659 - integer32llc:pin-nightly, r=alexcrichton"

This reverts commit 55442e8, reversing
changes made to 92a3a4e.

Testing to see if there is a fix on the latest nightly as rumored here: rust-lang/rust#45500 (comment)
@shaleh
Copy link

shaleh commented Oct 30, 2017

@michaelwoerister I will not not until Tuesday or Wednesday.

@nikomatsakis
Copy link
Contributor

triage: P-high

@rust-highfive rust-highfive added the P-high High priority label Nov 2, 2017
@shaleh
Copy link

shaleh commented Nov 2, 2017

Success!

cargo new test32 --bin
     Created binary (application) `test32` project
root@cc25a7d3570a:~# cd test32/
root@cc25a7d3570a:~/test32# ls
Cargo.toml  src
root@cc25a7d3570a:~/test32# cargo build
    Compiling test32 v0.1.0 (file:///root/test32)
    Finished dev [unoptimized + debuginfo] target(s) in 0.38 secs
root@cc25a7d3570a:~/test32# cargo run
     Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
     Running `target/debug/test32`
Hello, world!

System:

uname -a
Linux cc25a7d3570a 4.4.0-97-generic #120-Ubuntu SMP Tue Sep 19 17:28:18 UTC 2017 i686 i686 i686 GNU/Linux

Compiler:

rustc --version
rustc 1.23.0-nightly (2be4cc0 2017-11-01)

rustup show
Default host: x86_64-unknown-linux-gnu

installed toolchains

nightly-i686-unknown-linux-gnu (default)

active toolchain

nightly-i686-unknown-linux-gnu (default)
rustc 1.23.0-nightly (2be4cc0 2017-11-01)

@michaelwoerister
Copy link
Member

Thanks a lot for confirming, @shaleh!

I'm going to close this issue. Please re-open if there's still a case that isn't fixed.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
P-high High priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants