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

Cross compile Tier3(mipsel-unknown-linux-uclibc) error #86168

Closed
kolapapa opened this issue Jun 9, 2021 · 4 comments
Closed

Cross compile Tier3(mipsel-unknown-linux-uclibc) error #86168

kolapapa opened this issue Jun 9, 2021 · 4 comments
Labels
C-bug Category: This is a bug. O-MIPS Target: MIPS processors T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@kolapapa
Copy link

kolapapa commented Jun 9, 2021

Problem

root@a5a47cd37148:/opt/build/rust_workspace# cargo new build-mipsel
root@a5a47cd37148:/opt/build/rust_workspace/build-mipsel# cargo +nightly build -Z build-std=panic_abort,std --target mipsel-unknown-linux-uclibc
   Compiling build-mipsel v0.1.0 (/opt/build/rust_workspace/build-mipsel)
error: linking with `mipsel-openwrt-linux-gcc` failed: exit status: 1
  |
  = note: "mipsel-openwrt-linux-gcc" "/opt/build/rust_workspace/build-mipsel/target/mipsel-unknown-linux-uclibc/debug/deps/build_mipsel-ddb0947dcbffdec1.19g7y6w3orpt0hu5.rcgu.o" "/opt/build/rust_workspace/build-mipsel/target/mipsel-unknown-linux-uclibc/debug/deps/build_mipsel-ddb0947dcbffdec1.1cp586ajhyl8uodq.rcgu.o" "/opt/build/rust_workspace/build-mipsel/target/mipsel-unknown-linux-uclibc/debug/deps/build_mipsel-ddb0947dcbffdec1.23xqlfvdd5rsomgw.rcgu.o" "/opt/build/rust_workspace/build-mipsel/target/mipsel-unknown-linux-uclibc/debug/deps/build_mipsel-ddb0947dcbffdec1.2s657nit64morn1t.rcgu.o" "/opt/build/rust_workspace/build-mipsel/target/mipsel-unknown-linux-uclibc/debug/deps/build_mipsel-ddb0947dcbffdec1.2tvx1er0s6iyf0bu.rcgu.o" "/opt/build/rust_workspace/build-mipsel/target/mipsel-unknown-linux-uclibc/debug/deps/build_mipsel-ddb0947dcbffdec1.3nyctkwwaq685yri.rcgu.o" "/opt/build/rust_workspace/build-mipsel/target/mipsel-unknown-linux-uclibc/debug/deps/build_mipsel-ddb0947dcbffdec1.ac648pp7ndaww8q.rcgu.o" "/opt/build/rust_workspace/build-mipsel/target/mipsel-unknown-linux-uclibc/debug/deps/build_mipsel-ddb0947dcbffdec1.4pv8qhaisc1fbnl8.rcgu.o" "-Wl,--as-needed" "-L" "/opt/build/rust_workspace/build-mipsel/target/mipsel-unknown-linux-uclibc/debug/deps" "-L" "/opt/build/rust_workspace/build-mipsel/target/debug/deps" "-L" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/mipsel-unknown-linux-uclibc/lib" "-Wl,--start-group" "-Wl,-Bstatic" "/opt/build/rust_workspace/build-mipsel/target/mipsel-unknown-linux-uclibc/debug/deps/libstd-5653e078c0c253e1.rlib" "/opt/build/rust_workspace/build-mipsel/target/mipsel-unknown-linux-uclibc/debug/deps/libpanic_abort-b3a99dfbdfb25bbd.rlib" "/opt/build/rust_workspace/build-mipsel/target/mipsel-unknown-linux-uclibc/debug/deps/libminiz_oxide-c9cd46d804d66366.rlib" "/opt/build/rust_workspace/build-mipsel/target/mipsel-unknown-linux-uclibc/debug/deps/libadler-f7cb726d67fd1297.rlib" "/opt/build/rust_workspace/build-mipsel/target/mipsel-unknown-linux-uclibc/debug/deps/libobject-59ce73b22486757b.rlib" "/opt/build/rust_workspace/build-mipsel/target/mipsel-unknown-linux-uclibc/debug/deps/libaddr2line-1a8090afbaf6dd0e.rlib" "/opt/build/rust_workspace/build-mipsel/target/mipsel-unknown-linux-uclibc/debug/deps/libgimli-e1bfc000a65c0812.rlib" "/opt/build/rust_workspace/build-mipsel/target/mipsel-unknown-linux-uclibc/debug/deps/libstd_detect-ab1f876ea22cfdb1.rlib" "/opt/build/rust_workspace/build-mipsel/target/mipsel-unknown-linux-uclibc/debug/deps/librustc_demangle-fb2da51ed472638e.rlib" "/opt/build/rust_workspace/build-mipsel/target/mipsel-unknown-linux-uclibc/debug/deps/libhashbrown-bc503453bbb6d226.rlib" "/opt/build/rust_workspace/build-mipsel/target/mipsel-unknown-linux-uclibc/debug/deps/librustc_std_workspace_alloc-8f4e2617422690c3.rlib" "/opt/build/rust_workspace/build-mipsel/target/mipsel-unknown-linux-uclibc/debug/deps/libunwind-59cbca4628f674af.rlib" "/opt/build/rust_workspace/build-mipsel/target/mipsel-unknown-linux-uclibc/debug/deps/libcfg_if-7005bf97ac43f4b6.rlib" "/opt/build/rust_workspace/build-mipsel/target/mipsel-unknown-linux-uclibc/debug/deps/liblibc-9c6098049032fd7a.rlib" "/opt/build/rust_workspace/build-mipsel/target/mipsel-unknown-linux-uclibc/debug/deps/liballoc-9771685cbdf900dd.rlib" "/opt/build/rust_workspace/build-mipsel/target/mipsel-unknown-linux-uclibc/debug/deps/librustc_std_workspace_core-ce60031478f43e18.rlib" "/opt/build/rust_workspace/build-mipsel/target/mipsel-unknown-linux-uclibc/debug/deps/libcore-946c2d9e35b44690.rlib" "-Wl,--end-group" "/opt/build/rust_workspace/build-mipsel/target/mipsel-unknown-linux-uclibc/debug/deps/libcompiler_builtins-88d970980361089e.rlib" "-Wl,-Bdynamic" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-lutil" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-L" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/mipsel-unknown-linux-uclibc/lib" "-o" "/opt/build/rust_workspace/build-mipsel/target/mipsel-unknown-linux-uclibc/debug/deps/build_mipsel-ddb0947dcbffdec1" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-nodefaultlibs"
  = note: /opt/build/rust_workspace/build-mipsel/target/mipsel-unknown-linux-uclibc/debug/deps/libstd-5653e078c0c253e1.rlib(std-5653e078c0c253e1.std.c9kypol2-cgu.15.rcgu.o):/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/../../backtrace/src/backtrace/libunwind.rs:43: undefined reference to `_Unwind_GetIP'
          /opt/build/rust_workspace/build-mipsel/target/mipsel-unknown-linux-uclibc/debug/deps/libstd-5653e078c0c253e1.rlib(std-5653e078c0c253e1.std.c9kypol2-cgu.15.rcgu.o):/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/../../backtrace/src/backtrace/libunwind.rs:43: undefined reference to `_Unwind_GetIP'
          /opt/build/rust_workspace/build-mipsel/target/mipsel-unknown-linux-uclibc/debug/deps/libstd-5653e078c0c253e1.rlib(std-5653e078c0c253e1.std.c9kypol2-cgu.3.rcgu.o):/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90: undefined reference to `_Unwind_Backtrace'
          /opt/build/rust_workspace/build-mipsel/target/mipsel-unknown-linux-uclibc/debug/deps/libstd-5653e078c0c253e1.rlib(std-5653e078c0c253e1.std.c9kypol2-cgu.3.rcgu.o):/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90: undefined reference to `_Unwind_Backtrace'
          collect2: error: ld returned 1 exit status


error: aborting due to previous error

error: could not compile `build-mipsel`

To learn more, run the command again with --verbose.

Environment

root@a5a47cd37148:/opt/build/rust_workspace/build-mipsel# rustc -Vv
rustc 1.54.0-nightly (ed597e7e1 2021-06-08)
binary: rustc
commit-hash: ed597e7e19d0fe716d9f81b1e840a5abbfd7c28d
commit-date: 2021-06-08
host: x86_64-unknown-linux-gnu
release: 1.54.0-nightly
LLVM version: 12.0.1
# ~/.cargo/config
[target.mipsel-unknown-linux-uclibc]
ar = "mipsel-openwrt-linux-ar"
linker = "mipsel-openwrt-linux-gcc"
# ~/.bashrc
export STAGING_DIR="$SDK_DIR/staging_dir"
export PATH="$STAGING_DIR/toolchain-mipsel_24kec_gcc-4.8-linaro_uClibc-0.9.33.2/bin/:$PATH"
export AR_mipsel_unknown_linux_musl=mipsel-openwrt-linux-uclibc-ar
export CC_mipsel_unknown_linux_musl=mipsel-openwrt-linux-uclibc-gcc
export CXX_mipsel_unknown_linux_musl=mipsel-openwrt-linux-uclibc-g++

Output of cargo version: cargo 1.54.0-nightly (0cecbd673 2021-06-01)

Rustup's toolchain can be compiled normally with xargo in 2020-04, but it will not work after rustup is updated. Do I need to add any parameter configurations?

@ehuss ehuss transferred this issue from rust-lang/cargo Jun 9, 2021
@ehuss
Copy link
Contributor

ehuss commented Jun 9, 2021

Transferred to rust-lang/rust, as this does not appear to be a cargo issue.

Also, you may want to specify more information about your project (is this hello-world, or something more complicated?).

@kolapapa
Copy link
Author

kolapapa commented Jun 9, 2021

Transferred to rust-lang/rust, as this does not appear to be a cargo issue.

Also, you may want to specify more information about your project (is this hello-world, or something more complicated?).

Yes, it is a hello world project.

@inquisitivecrystal
Copy link
Contributor

inquisitivecrystal commented Jun 9, 2021

@rustbot label +C-bug +O-MIPS +T-compiler

@rustbot rustbot added C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. O-MIPS Target: MIPS processors labels Jun 9, 2021
@meyer9
Copy link

meyer9 commented Jun 20, 2021

I've been seeing the same thing trying to compile for mipsel-unknown-linux-uclibc. I found these issues that also may be related:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. O-MIPS Target: MIPS processors T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants