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

Linking regression in 1.6 #31150

Closed
brson opened this Issue Jan 23, 2016 · 9 comments

Comments

Projects
None yet
6 participants
@brson
Copy link
Contributor

brson commented Jan 23, 2016

As reported here.

"My code built fine on 1.5, after upgrading the below occurs. I have no idea what these libraries are."

$ cargo -V
cargo 0.8.0-nightly (8edc460 2016-01-21)
$ rustc -V
rustc 1.8.0-nightly (18b851bc5 2016-01-22)
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 15.10
Release:    15.10
Codename:   wily


$ cargo test
   Compiling advapi32-sys v0.1.2
error: linking with `cc` failed: exit code: 1
note: "cc" "-Wl,--as-needed" "-m32" "-L" "/usr/local/lib/rustlib/i686-unknown-linux-gnu/lib" "/home/abdications/code/project/target/debug/build/advapi32-sys-e49d051e16dd0c95/build_script_build.0.o" "-o" "/home/abdications/code/project/target/debug/build/advapi32-sys-e49d051e16dd0c95/build_script_build" "-Wl,--gc-sections" "-pie" "-nodefaultlibs" "-L" "/home/abdications/code/project/target/debug/deps" "-L" "/home/abdications/code/project/target/debug/deps" "-L" "/usr/local/lib/rustlib/i686-unknown-linux-gnu/lib" "-Wl,-Bstatic" "-Wl,-Bdynamic" "/home/abdications/code/projects/target/debug/deps/libbuild-1c80f5385bc51210.rlib" "/usr/local/lib/rustlib/i686-unknown-linux-gnu/lib/libstd-fd663c41.rlib" "/usr/local/lib/rustlib/i686-unknown-linux-gnu/lib/libcollections-fd663c41.rlib" "/usr/local/lib/rustlib/i686-unknown-linux-gnu/lib/librustc_unicode-fd663c41.rlib" "/usr/local/lib/rustlib/i686-unknown-linux-gnu/lib/librand-fd663c41.rlib" "/usr/local/lib/rustlib/i686-unknown-linux-gnu/lib/liballoc-fd663c41.rlib" "/usr/local/lib/rustlib/i686-unknown-linux-gnu/lib/liballoc_jemalloc-fd663c41.rlib" "/usr/local/lib/rustlib/i686-unknown-linux-gnu/lib/liblibc-fd663c41.rlib" "/usr/local/lib/rustlib/i686-unknown-linux-gnu/lib/libcore-fd663c41.rlib" "-l" "dl" "-l" "pthread" "-l" "gcc_s" "-l" "pthread" "-l" "c" "-l" "m" "-l" "rt" "-l" "compiler-rt"
note: /usr/bin/ld: cannot find Scrt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
/usr/bin/ld: cannot find -ldl
/usr/bin/ld: cannot find -lpthread
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/5/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find -lpthread
/usr/bin/ld: cannot find -lc
/usr/bin/ld: cannot find -lm
/usr/bin/ld: cannot find -lrt
/usr/bin/ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status

error: aborting due to previous error
Could not compile `advapi32-sys`.

I tried running export LIBRARY_PATH=/usr/lib/x86_64-linux-gnu, which changes the error:

$ cargo test
   Compiling advapi32-sys v0.1.2
error: linking with `cc` failed: exit code: 1
note: "cc" "-Wl,--as-needed" "-m32" "-L" "/usr/local/lib/rustlib/i686-unknown-linux-gnu/lib" "/home/abdications/code/project/target/debug/build/advapi32-sys-e49d051e16dd0c95/build_script_build.0.o" "-o" "/home/abdications/code/project/target/debug/build/advapi32-sys-e49d051e16dd0c95/build_script_build" "-Wl,--gc-sections" "-pie" "-nodefaultlibs" "-L" "/home/abdications/code/project/target/debug/deps" "-L" "/home/abdications/code/project/target/debug/deps" "-L" "/usr/local/lib/rustlib/i686-unknown-linux-gnu/lib" "-Wl,-Bstatic" "-Wl,-Bdynamic" "/home/abdications/code/project/target/debug/deps/libbuild-1c80f5385bc51210.rlib" "/usr/local/lib/rustlib/i686-unknown-linux-gnu/lib/libstd-fd663c41.rlib" "/usr/local/lib/rustlib/i686-unknown-linux-gnu/lib/libcollections-fd663c41.rlib" "/usr/local/lib/rustlib/i686-unknown-linux-gnu/lib/librustc_unicode-fd663c41.rlib" "/usr/local/lib/rustlib/i686-unknown-linux-gnu/lib/librand-fd663c41.rlib" "/usr/local/lib/rustlib/i686-unknown-linux-gnu/lib/liballoc-fd663c41.rlib" "/usr/local/lib/rustlib/i686-unknown-linux-gnu/lib/liballoc_jemalloc-fd663c41.rlib" "/usr/local/lib/rustlib/i686-unknown-linux-gnu/lib/liblibc-fd663c41.rlib" "/usr/local/lib/rustlib/i686-unknown-linux-gnu/lib/libcore-fd663c41.rlib" "-l" "dl" "-l" "pthread" "-l" "gcc_s" "-l" "pthread" "-l" "c" "-l" "m" "-l" "rt" "-l" "compiler-rt"
note: /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libdl.so when searching for -ldl
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libdl.a when searching for -ldl
/usr/bin/ld: cannot find -ldl
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libpthread.so when searching for -lpthread
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libpthread.a when searching for -lpthread
/usr/bin/ld: cannot find -lpthread
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/5/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libpthread.so when searching for -lpthread
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libpthread.a when searching for -lpthread
/usr/bin/ld: cannot find -lpthread
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libc.so when searching for -lc
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libc.a when searching for -lc
/usr/bin/ld: cannot find -lc
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libm.so when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libm.a when searching for -lm
/usr/bin/ld: cannot find -lm
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/librt.so when searching for -lrt
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/librt.a when searching for -lrt
/usr/bin/ld: cannot find -lrt
collect2: error: ld returned 1 exit status

error: aborting due to previous error
Could not compile `advapi32-sys`.
@aturon

This comment has been minimized.

Copy link
Member

aturon commented Jan 23, 2016

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Jan 24, 2016

This looks like a standard "on a 64-bit platform and forgot 32-bit libraries" kind of error, so I would be wary of calling this a regression from 1.5 to 1.6 without further information.

@skade

This comment has been minimized.

Copy link
Contributor

skade commented Feb 4, 2016

I see this issue when using rustc > 1.6.0 (master) with the rust toolchain for rumpkernel/rumprun-packages. Definitely no 32 bit binaries in path.

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Feb 11, 2016

triage: P-low

@brson

This comment has been minimized.

Copy link
Contributor Author

brson commented Jun 23, 2016

@skade Is this still a bug? Looks like OPs issue was resolved.

@brson brson added the I-nominated label Jun 23, 2016

@skade

This comment has been minimized.

Copy link
Contributor

skade commented Jun 24, 2016

@brson I currently have issues building my rumprun toolchain. I also know of no other users that have this bug. Close it and I will reopen if this persists.

@tmbb

This comment has been minimized.

Copy link

tmbb commented Jan 3, 2017

When trying to compile this file (or any other rust program):

fn main() {
    println!("Hello World!");
}

I get:

$ rustc hello.rs
rustc hello.rs --verbose
error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m32" "-L" "/home/tmbb/.rustup/toolchains/stable-i686-unknown-linux-gnu/lib/rustlib/i686-unknown-linux-gnu/lib" "hello.0.o" "-o" "hello" "-Wl,--gc-sections" "-pie" "-nodefaultlibs" "-L" "/home/tmbb/.rustup/toolchains/stable-i686-unknown-linux-gnu/lib/rustlib/i686-unknown-linux-gnu/lib" "-Wl,-Bstatic" "-Wl,-Bdynamic" "/home/tmbb/.rustup/toolchains/stable-i686-unknown-linux-gnu/lib/rustlib/i686-unknown-linux-gnu/lib/libstd-f5a209a9.rlib" "/home/tmbb/.rustup/toolchains/stable-i686-unknown-linux-gnu/lib/rustlib/i686-unknown-linux-gnu/lib/libpanic_unwind-f5a209a9.rlib" "/home/tmbb/.rustup/toolchains/stable-i686-unknown-linux-gnu/lib/rustlib/i686-unknown-linux-gnu/lib/libunwind-f5a209a9.rlib" "/home/tmbb/.rustup/toolchains/stable-i686-unknown-linux-gnu/lib/rustlib/i686-unknown-linux-gnu/lib/librand-f5a209a9.rlib" "/home/tmbb/.rustup/toolchains/stable-i686-unknown-linux-gnu/lib/rustlib/i686-unknown-linux-gnu/lib/libcollections-f5a209a9.rlib" "/home/tmbb/.rustup/toolchains/stable-i686-unknown-linux-gnu/lib/rustlib/i686-unknown-linux-gnu/lib/librustc_unicode-f5a209a9.rlib" "/home/tmbb/.rustup/toolchains/stable-i686-unknown-linux-gnu/lib/rustlib/i686-unknown-linux-gnu/lib/liballoc-f5a209a9.rlib" "/home/tmbb/.rustup/toolchains/stable-i686-unknown-linux-gnu/lib/rustlib/i686-unknown-linux-gnu/lib/liballoc_jemalloc-f5a209a9.rlib" "/home/tmbb/.rustup/toolchains/stable-i686-unknown-linux-gnu/lib/rustlib/i686-unknown-linux-gnu/lib/liblibc-f5a209a9.rlib" "/home/tmbb/.rustup/toolchains/stable-i686-unknown-linux-gnu/lib/rustlib/i686-unknown-linux-gnu/lib/libcore-f5a209a9.rlib" "/home/tmbb/.rustup/toolchains/stable-i686-unknown-linux-gnu/lib/rustlib/i686-unknown-linux-gnu/lib/libcompiler_builtins-f5a209a9.rlib" "-l" "dl" "-l" "pthread" "-l" "gcc_s" "-l" "pthread" "-l" "c" "-l" "m" "-l" "rt" "-l" "util"
  = note: /usr/bin/ld: cannot find Scrt1.o: No such file or directory
collect2: error: ld returned 1 exit status


error: aborting due to previous error

I'm running 32bit ubuntu:

$ uname -a
Linux tmbb-laptop 3.13.0-98-generic #145-Ubuntu SMP Sat Oct 8 20:13:07 UTC 2016 i686 i686 i686 GNU/Linux

and using rust 1.14:

$ rustc --version
rustc 1.14.0 (e8a012324 2016-12-16)
@tmbb

This comment has been minimized.

Copy link

tmbb commented Jan 12, 2017

For the record, I get the same linking errors with rustc 1.0.0 and some versions I tried between these two.

@tmbb

This comment has been minimized.

Copy link

tmbb commented Jan 12, 2017

It was a problem with my local setup. Consider it fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.