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

Link error when cross-compiling to ARM #2

Closed
mbrubeck opened this issue Oct 9, 2015 · 2 comments
Closed

Link error when cross-compiling to ARM #2

mbrubeck opened this issue Oct 9, 2015 · 2 comments

Comments

@mbrubeck
Copy link

mbrubeck commented Oct 9, 2015

cargo build -v --target arm-linux-androideabi fails with:

error: linking with `cc` failed: exit code: 1
note: "cc" "-Wl,--as-needed" "-Wl,--allow-multiple-definition" "-L" "/home/mbrubeck/.servo/rust/168a23ebe1729386138fa71643382fdd64fac205/rustc-1.5.0-dev-x86_64-unknown-linux-gnu/rustc/lib/rustlib/arm-linux-androideabi/lib" "/home/mbrubeck/src/servo/target/arm-linux-androideabi/debug/gif.0.o" "-o" "/home/mbrubeck/src/servo/target/arm-linux-androideabi/debug/libgif.so" "/home/mbrubeck/src/servo/target/arm-linux-androideabi/debug/gif.metadata.o" "-nodefaultlibs" "-L" "/home/mbrubeck/src/servo/target/arm-linux-androideabi/debug" "-L" "/home/mbrubeck/src/servo/target/arm-linux-androideabi/debug/deps" "-L" "/home/mbrubeck/.servo/rust/168a23ebe1729386138fa71643382fdd64fac205/rustc-1.5.0-dev-x86_64-unknown-linux-gnu/rustc/lib/rustlib/arm-linux-androideabi/lib" "-L" "/home/mbrubeck/src/image-gif/.rust/lib/arm-linux-androideabi" "-L" "/home/mbrubeck/src/image-gif/lib/arm-linux-androideabi" "-Wl,-Bstatic" "-Wl,-Bdynamic" "-Wl,--whole-archive" "/tmp/rustc.sTmR4LtDco6E/libcolor_quant-6695fde28ee2e395.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.sTmR4LtDco6E/liblzw-f4c4a3ecf5835e0f.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.sTmR4LtDco6E/libstd-bb943c5a.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.sTmR4LtDco6E/libcollections-bb943c5a.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.sTmR4LtDco6E/librustc_unicode-bb943c5a.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.sTmR4LtDco6E/librand-bb943c5a.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.sTmR4LtDco6E/liballoc-bb943c5a.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.sTmR4LtDco6E/liballoc_system-bb943c5a.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.sTmR4LtDco6E/liblibc-bb943c5a.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.sTmR4LtDco6E/libcore-bb943c5a.rlib" "-Wl,--no-whole-archive" "-l" "dl" "-l" "log" "-l" "gcc" "-l" "gcc" "-l" "c" "-l" "m" "-shared" "-l" "compiler-rt"
note: /usr/bin/ld: /home/mbrubeck/src/servo/target/arm-linux-androideabi/debug/gif.0.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: /home/mbrubeck/src/servo/target/arm-linux-androideabi/debug/gif.0.o: Relocations in generic ELF (EM: 40)
...
/home/mbrubeck/src/servo/target/arm-linux-androideabi/debug/gif.0.o: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
@mbrubeck
Copy link
Author

mbrubeck commented Oct 9, 2015

Changing crate-type in Cargo.toml from ["dylib", "rlib"] to just ["rlib"] makes this error go away. This is probably a bug in rustc...

@mbrubeck
Copy link
Author

mbrubeck commented Oct 9, 2015

Yes, this happens even when building an empty source file with --crate-type dylib --target arm-linux-androideabi. Filed as rust-lang/rust#28924.

@mbrubeck mbrubeck closed this as completed Oct 9, 2015
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

1 participant