rust-osdev / cargo-xbuild

Automatically cross-compiles the sysroot crates core, compiler_builtins, and alloc.
Apache License 2.0
258 stars 25 forks source link

cargo xbuild fails to build for `riscv64gc-unknown-linux-musl` #107

Open walksanatora opened 1 year ago

walksanatora commented 1 year ago
error[E0464]: multiple candidates for `rmeta` dependency `core` found
 --> /home/walksanator/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core/lib.rs:4:9
  |
4 | pub use core::*;
  |         ^^^^
  |
  = note: candidate #1: /tmp/cargo-xbuildui1JMz/target/riscv64gc-unknown-linux-musl/release/deps/libcore-5e0758bd9f6fbbc9.rmeta
  = note: candidate #2: /tmp/cargo-xbuildui1JMz/target/riscv64gc-unknown-linux-musl/release/deps/libcore-48461cb5a681c214.rmeta

For more information about this error, try `rustc --explain E0464`.
error: could not compile `rustc-std-workspace-core` due to previous error
warning: build failed, waiting for other jobs to finish...
error: `CARGO_TARGET_DIR="/tmp/cargo-xbuildui1JMz/target" RUSTFLAGS="-Cembed-bitcode=yes" __CARGO_DEFAULT_LIB_METADATA="XARGO" "/home/walksanator/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo" "rustc" "-p" "alloc" "--release" "--manifest-path" "/tmp/cargo-xbuildui1JMz/Cargo.toml" "--target" "riscv64gc-unknown-linux-musl" "--" "-Z" "force-unstable-if-unmarked"` failed with exit code: Some(101)
walksanatora commented 1 year ago
then after commenting out the linker lines in the project i was trying
  = note: /usr/bin/ld: cannot find crt1.o: No such file or directory
          /usr/bin/ld: cannot find crti.o: No such file or directory
          /usr/bin/ld: cannot find crtbegin.o: No such file or directory
          /usr/bin/ld: /home/walksanator/git/rust/oc2/project/target/riscv64gc-unknown-linux-musl/debug/deps/nothing-6c7ab86a021fff73.20qhkt0gnc0472m2.rcgu.o: Relocations in generic ELF (EM: 243)
          /usr/bin/ld: /home/walksanator/git/rust/oc2/project/target/riscv64gc-unknown-linux-musl/debug/deps/nothing-6c7ab86a021fff73.20qhkt0gnc0472m2.rcgu.o: Relocations in generic ELF (EM: 243)
          /usr/bin/ld: /home/walksanator/git/rust/oc2/project/target/riscv64gc-unknown-linux-musl/debug/deps/nothing-6c7ab86a021fff73.20qhkt0gnc0472m2.rcgu.o: Relocations in generic ELF (EM: 243)
          /usr/bin/ld: /home/walksanator/git/rust/oc2/project/target/riscv64gc-unknown-linux-musl/debug/deps/nothing-6c7ab86a021fff73.20qhkt0gnc0472m2.rcgu.o: Relocations in generic ELF (EM: 243)
          /usr/bin/ld: /home/walksanator/git/rust/oc2/project/target/riscv64gc-unknown-linux-musl/debug/deps/nothing-6c7ab86a021fff73.20qhkt0gnc0472m2.rcgu.o: Relocations in generic ELF (EM: 243)
          /usr/bin/ld: /home/walksanator/git/rust/oc2/project/target/riscv64gc-unknown-linux-musl/debug/deps/nothing-6c7ab86a021fff73.20qhkt0gnc0472m2.rcgu.o: Relocations in generic ELF (EM: 243)
          /usr/bin/ld: /home/walksanator/git/rust/oc2/project/target/riscv64gc-unknown-linux-musl/debug/deps/nothing-6c7ab86a021fff73.20qhkt0gnc0472m2.rcgu.o: Relocations in generic ELF (EM: 243)
          /usr/bin/ld: /home/walksanator/git/rust/oc2/project/target/riscv64gc-unknown-linux-musl/debug/deps/nothing-6c7ab86a021fff73.20qhkt0gnc0472m2.rcgu.o: Relocations in generic ELF (EM: 243)
          /usr/bin/ld: /home/walksanator/git/rust/oc2/project/target/riscv64gc-unknown-linux-musl/debug/deps/nothing-6c7ab86a021fff73.20qhkt0gnc0472m2.rcgu.o: error adding symbols: file in wrong format
          collect2: error: ld returned 1 exit status