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

Rust building is broken for BSD system #27124

Closed
semarie opened this issue Jul 19, 2015 · 5 comments
Closed

Rust building is broken for BSD system #27124

semarie opened this issue Jul 19, 2015 · 5 comments

Comments

@semarie
Copy link
Contributor

semarie commented Jul 19, 2015

Starting with the latest update of LLVM, several BSD system don't be able to build rust anymore.

At least:

The error message is the same of these three platform (here bitrig message):

error: linking with `cc` failed: exit code: 1
note: "cc" "-m64" "-L" "/home/builder/rust-buildbot/slave/auto-bitrig-64-opt/build/obj/x86_64-unknown-bitrig/stage1/lib/rustlib/x86_64-unknown-bitrig/lib" "x86_64-unknown-bitrig/stage1/lib/rustlib/x86_64-unknown-bitrig/lib/std-7e44814b.0.o" "-o" "x86_64-unknown-bitrig/stage1/lib/rustlib/x86_64-unknown-bitrig/lib/libstd-7e44814b.so" "x86_64-unknown-bitrig/stage1/lib/rustlib/x86_64-unknown-bitrig/lib/std-7e44814b.metadata.o" "-Wl,-O1" "-nodefaultlibs" "-Wl,--whole-archive" "/tmp/rustc.M1grNw2xGkYD/libcollections-7e44814b.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.M1grNw2xGkYD/librand-7e44814b.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.M1grNw2xGkYD/liballoc-7e44814b.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.M1grNw2xGkYD/librustc_unicode-7e44814b.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.M1grNw2xGkYD/liblibc-7e44814b.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.M1grNw2xGkYD/libcore-7e44814b.rlib" "-Wl,--no-whole-archive" "-L" "x86_64-unknown-bitrig/rt" "-L" "/home/builder/rust-buildbot/slave/auto-bitrig-64-opt/build/obj/x86_64-unknown-bitrig/llvm/Release/lib" "-L" "/home/builder/rust-buildbot/slave/auto-bitrig-64-opt/build/obj/x86_64-unknown-bitrig/stage1/lib/rustlib/x86_64-unknown-bitrig/lib" "-L" "/home/builder/rust-buildbot/slave/auto-bitrig-64-opt/build/obj/.rust/lib/x86_64-unknown-bitrig" "-L" "/home/builder/rust-buildbot/slave/auto-bitrig-64-opt/build/obj/lib/x86_64-unknown-bitrig" "-Wl,-Bstatic" "-Wl,--whole-archive" "-l" "rust_builtin" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "backtrace" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "rustrt_native" "-Wl,--no-whole-archive" "-Wl,-Bdynamic" "-l" "pthread" "-l" "c++abi" "-l" "c" "-l" "m" "-shared" "-l" "compiler-rt"
note: /tmp/rustc.M1grNw2xGkYD/libcollections-7e44814b.rlib: member /tmp/rustc.M1grNw2xGkYD/libcollections-7e44814b.rlib(__.SYMDEF) in archive is not an object
cc: error: linker command failed with exit code 1 (use -v to see invocation)

cc: @dhuseby @wg @vhbit @mneumann

@semarie semarie changed the title Rust building is breaked for BSD system Rust building is broken for BSD system Jul 19, 2015
@semarie
Copy link
Contributor Author

semarie commented Jul 19, 2015

It seems that building with archive_format: "".to_string() is enough for workaround and building (in src/librustc_back/target/openbsd_base.rs)

@semarie
Copy link
Contributor Author

semarie commented Jul 19, 2015

cc @alexcrichton

@nagisa
Copy link
Member

nagisa commented Jul 19, 2015

Might be relevant #26926

@dhuseby
Copy link

dhuseby commented Jul 19, 2015

@semarie thanks for the work around. Let me check it out on bitrig and freebsd.

@semarie
Copy link
Contributor Author

semarie commented Jul 20, 2015

The problem is definitively with LLVM writeArchive (as pointed by @nagisa).

I am able to build and pass all checks under openbsd with archive_format: "".to_string() (so using ar for archives, like before).

I am going to test building using "gnu" archive under openbsd (for now, build ok, tests are pending)

@bors bors closed this as completed in 761e11e Jul 21, 2015
bors added a commit that referenced this issue Aug 15, 2015
NetBSD didn't get its fix for #27124 and still suffers from that issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants