Skip to content

Linking regression in 1.6 #31150

@brson

Description

@brson

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`.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-linkageArea: linking into static, shared libraries and binariesP-lowLow priorityregression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions