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

unrecognized relocation cargo build failures with latest nightlies #4

Closed
clux opened this issue Aug 7, 2016 · 2 comments
Closed

unrecognized relocation cargo build failures with latest nightlies #4

clux opened this issue Aug 7, 2016 · 2 comments

Comments

@clux
Copy link
Owner

clux commented Aug 7, 2016

from the travis logs:

docker run -v /home/travis/build/clux/muslrust/test/plaincrate:/volume -w /volume -t clux/muslrust cargo build --verbose
    Updating registry `https://github.com/rust-lang/crates.io-index`
 Downloading rand v0.3.14
 Downloading libc v0.2.14
   Compiling libc v0.2.14
     Running `rustc /root/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/libc-0.2.14/src/lib.rs --crate-name libc --crate-type lib -g --cfg feature=\"default\" --cfg feature=\"use_std\" -C metadata=1f3392fe1afd1313 -C extra-filename=-1f3392fe1afd1313 --out-dir /volume/target/x86_64-unknown-linux-musl/debug/deps --emit=dep-info,link --target x86_64-unknown-linux-musl -L dependency=/volume/target/x86_64-unknown-linux-musl/debug/deps --cap-lints allow`
   Compiling rand v0.3.14
     Running `rustc /root/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/rand-0.3.14/src/lib.rs --crate-name rand --crate-type lib -g -C metadata=49a08859d086fffe -C extra-filename=-49a08859d086fffe --out-dir /volume/target/x86_64-unknown-linux-musl/debug/deps --emit=dep-info,link --target x86_64-unknown-linux-musl -L dependency=/volume/target/x86_64-unknown-linux-musl/debug/deps --extern libc=/volume/target/x86_64-unknown-linux-musl/debug/deps/liblibc-1f3392fe1afd1313.rlib --cap-lints allow`
   Compiling plaincrate v0.1.0 (file:///volume)
     Running `rustc src/main.rs --crate-name plaincrate --crate-type bin -g -C metadata=0ac13fd092ed66e9 --out-dir /volume/target/x86_64-unknown-linux-musl/debug --emit=dep-info,link --target x86_64-unknown-linux-musl -L dependency=/volume/target/x86_64-unknown-linux-musl/debug/deps --extern rand=/volume/target/x86_64-unknown-linux-musl/debug/deps/librand-49a08859d086fffe.rlib`
error: linking with `cc` failed: exit code: 1 
note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-nostdlib" "-static" "-Wl,--eh-frame-hdr" "-Wl,-(" "-m64" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/crt1.o" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/crti.o" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib" "/volume/target/x86_64-unknown-linux-musl/debug/plaincrate.0.o" "-o" "/volume/target/x86_64-unknown-linux-musl/debug/plaincrate" "-Wl,--gc-sections" "-nodefaultlibs" "-L" "/volume/target/x86_64-unknown-linux-musl/debug/deps" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib" "-Wl,-Bstatic" "-Wl,-Bdynamic" "/volume/target/x86_64-unknown-linux-musl/debug/deps/librand-49a08859d086fffe.rlib" "/volume/target/x86_64-unknown-linux-musl/debug/deps/liblibc-1f3392fe1afd1313.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/libstd-c8005792.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/libpanic_unwind-c8005792.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/libunwind-c8005792.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/librand-c8005792.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/libcollections-c8005792.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/librustc_unicode-c8005792.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/liballoc-c8005792.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/liballoc_jemalloc-c8005792.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/liblibc-c8005792.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/libcore-c8005792.rlib" "-l" "compiler-rt" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/crtn.o" "-Wl,-)" 
note: /usr/bin/ld: /usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/liballoc_jemalloc-c8005792.rlib(jemalloc.pic.o): unrecognized relocation (0x2a) in section `.text.malloc_conf_init'
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status

and

docker run -v /home/travis/build/clux/muslrust/test/plaincrate:/volume -w /volume -t clux/muslrust cargo build --verbose
    Updating registry `https://github.com/rust-lang/crates.io-index`
 Downloading rand v0.3.14
 Downloading libc v0.2.15
   Compiling libc v0.2.15
     Running `rustc /root/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/libc-0.2.15/src/lib.rs --crate-name libc --crate-type lib -g --cfg feature=\"use_std\" --cfg feature=\"default\" -C metadata=1bd8847afb79f283 -C extra-filename=-1bd8847afb79f283 --out-dir /volume/target/x86_64-unknown-linux-musl/debug/deps --emit=dep-info,link --target x86_64-unknown-linux-musl -L dependency=/volume/target/x86_64-unknown-linux-musl/debug/deps --cap-lints allow`
   Compiling rand v0.3.14
     Running `rustc /root/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/rand-0.3.14/src/lib.rs --crate-name rand --crate-type lib -g -C metadata=49a08859d086fffe -C extra-filename=-49a08859d086fffe --out-dir /volume/target/x86_64-unknown-linux-musl/debug/deps --emit=dep-info,link --target x86_64-unknown-linux-musl -L dependency=/volume/target/x86_64-unknown-linux-musl/debug/deps --extern libc=/volume/target/x86_64-unknown-linux-musl/debug/deps/liblibc-1bd8847afb79f283.rlib --cap-lints allow`
   Compiling plaincrate v0.1.0 (file:///volume)
     Running `rustc src/main.rs --crate-name plaincrate --crate-type bin -g -C metadata=0ac13fd092ed66e9 --out-dir /volume/target/x86_64-unknown-linux-musl/debug --emit=dep-info,link --target x86_64-unknown-linux-musl -L dependency=/volume/target/x86_64-unknown-linux-musl/debug/deps --extern rand=/volume/target/x86_64-unknown-linux-musl/debug/deps/librand-49a08859d086fffe.rlib`
error: linking with `cc` failed: exit code: 1 
note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-nostdlib" "-static" "-Wl,--eh-frame-hdr" "-Wl,-(" "-m64" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/crt1.o" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/crti.o" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib" "/volume/target/x86_64-unknown-linux-musl/debug/plaincrate.0.o" "-o" "/volume/target/x86_64-unknown-linux-musl/debug/plaincrate" "-Wl,--gc-sections" "-nodefaultlibs" "-L" "/volume/target/x86_64-unknown-linux-musl/debug/deps" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib" "-Wl,-Bstatic" "-Wl,-Bdynamic" "/volume/target/x86_64-unknown-linux-musl/debug/deps/librand-49a08859d086fffe.rlib" "/volume/target/x86_64-unknown-linux-musl/debug/deps/liblibc-1bd8847afb79f283.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/libstd-c8005792.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/libpanic_unwind-c8005792.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/libunwind-c8005792.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/librand-c8005792.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/libcollections-c8005792.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/librustc_unicode-c8005792.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/liballoc-c8005792.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/liballoc_jemalloc-c8005792.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/liblibc-c8005792.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/libcore-c8005792.rlib" "-l" "compiler-rt" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/crtn.o" "-Wl,-)" 
note: /usr/bin/ld: /usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/libunwind-c8005792.rlib(libunwind.cpp.o): unrecognized relocation (0x2a) in section `.text._ZL10assert_rtnPKcS0_iS0_'
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status

not sure what's going on here - nothing's changed on this end.

@bencord0
Copy link
Collaborator

bencord0 commented Aug 7, 2016

Looks like someone in debian saw this issue already. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=808576

This also makes me wonder about the apis to use custom allocators. https://doc.rust-lang.org/book/custom-allocators.html Do the linkers do the right thing if the allocator used in one module is different to the allocators used in another? rust-lang/rust#31460 Maybe the cargo.lock needs an audit to make sure that none of our deps are forcing the allocator one way or another.

@clux
Copy link
Owner Author

clux commented Aug 7, 2016

Hm, if it's a Debian thing, maybe moving to sid is more sensible. We are building nightlies after all most of the time. I'll have a go.

This also makes me wonder about the apis to use custom allocators. https://doc.rust-lang.org/book/custom-allocators.html Do the linkers do the right thing if the allocator used in one module is different to the allocators used in another? rust-lang/rust#31460 Maybe the cargo.lock needs an audit to make sure that none of our deps are forcing the allocator one way or another.

That's a good question. But for the second part, all lockfiles are kept out of source and dependencies set to "*" in Cargo.toml so should be using latest behaviour.

@clux clux closed this as completed in 7ab4339 Aug 7, 2016
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

2 participants