cross: Unable to `-Zbuild-std` for `mips-unknown-linux-musl`

Checklist

Describe your issue

The following MR adds statically included libc for several architectures. However, mips-unknown-linux-musl fails. https://github.com/wcampbell0x2a/mempeek/actions/runs/7520357008/job/20469941084?pr=2

Since mips-unknown-linux-musl is target tier 3 now, I need to build-std.

Version: cross v0.2.5

Command: cross build --bin mempeek --locked --release --target mips-unknown-linux-musl -Zbuild-std

error: linking with `mips-linux-muslsf-gcc` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/rust/lib/rustlib/x86_64-unknown-linux-gnu/bin:/rust/lib/rustlib/x86_64-unknown-linux-gnu/bin/self-contained:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/rust/bin" VSLANG="1033" "mips-linux-muslsf-gcc" "crt1.o" "crti.o" "crtbegin.o" "/tmp/rustcORb1Yb/symbols.o" "/target/mips-unknown-linux-musl/release/deps/mempeek-557b2e1c2d7bb520.mempeek.cb0fcbdab1503788-cgu.00.rcgu.o" "/target/mips-unknown-linux-musl/release/deps/mempeek-557b2e1c2d7bb520.mempeek.cb0fcbdab1503788-cgu.01.rcgu.o" "/target/mips-unknown-linux-musl/release/deps/mempeek-557b2e1c2d7bb520.mempeek.cb0fcbdab1503788-cgu.02.rcgu.o" "/target/mips-unknown-linux-musl/release/deps/mempeek-557b2e1c2d7bb520.mempeek.cb0fcbdab1503788-cgu.03.rcgu.o" "/target/mips-unknown-linux-musl/release/deps/mempeek-557b2e1c2d7bb520.mempeek.cb0fcbdab1503788-cgu.04.rcgu.o" "/target/mips-unknown-linux-musl/release/deps/mempeek-557b2e1c2d7bb520.mempeek.cb0fcbdab1503788-cgu.05.rcgu.o" "/target/mips-unknown-linux-musl/release/deps/mempeek-557b2e1c2d7bb520.mempeek.cb0fcbdab1503788-cgu.06.rcgu.o" "/target/mips-unknown-linux-musl/release/deps/mempeek-557b2e1c2d7bb520.mempeek.cb0fcbdab1503788-cgu.07.rcgu.o" "/target/mips-unknown-linux-musl/release/deps/mempeek-557b2e1c2d7bb520.mempeek.cb0fcbdab1503788-cgu.08.rcgu.o" "/target/mips-unknown-linux-musl/release/deps/mempeek-557b2e1c2d7bb520.mempeek.cb0fcbdab1503788-cgu.09.rcgu.o" "/target/mips-unknown-linux-musl/release/deps/mempeek-557b2e1c2d7bb520.mempeek.cb0fcbdab1503788-cgu.10.rcgu.o" "/target/mips-unknown-linux-musl/release/deps/mempeek-557b2e1c2d7bb520.mempeek.cb0fcbdab1503788-cgu.11.rcgu.o" "/target/mips-unknown-linux-musl/release/deps/mempeek-557b2e1c2d7bb520.22p001b4eltzaxks.rcgu.o" "-Wl,--as-needed" "-L" "/target/mips-unknown-linux-musl/release/deps" "-L" "/target/release/deps" "-L" "/rust/lib/rustlib/mips-unknown-linux-musl/lib" "-Wl,-Bstatic" "/target/mips-unknown-linux-musl/release/deps/libquoted_strings-d0f7468ea21ee5e8.rlib" "/target/mips-unknown-linux-musl/release/deps/librustyline-8d5ec96c0c5a11b9.rlib" "/target/mips-unknown-linux-musl/release/deps/libutf8parse-116927d326bc5750.rlib" "/target/mips-unknown-linux-musl/release/deps/libnix-b11796db79f37076.rlib" "/target/mips-unknown-linux-musl/release/deps/libmemoffset-b593169c600c71e2.rlib" "/target/mips-unknown-linux-musl/release/deps/libfd_lock-e02faa0ecf1b0bc6.rlib" "/target/mips-unknown-linux-musl/release/deps/librustix-c4d423c9bdd8bf47.rlib" "/target/mips-unknown-linux-musl/release/deps/libbitflags-967a321434d6edf1.rlib" "/target/mips-unknown-linux-musl/release/deps/liberrno-387d32a6920e45a1.rlib" "/target/mips-unknown-linux-musl/release/deps/libio_lifetimes-dd07bdae668d8529.rlib" "/target/mips-unknown-linux-musl/release/deps/libunicode_width-c11476c577bbe7d3.rlib" "/target/mips-unknown-linux-musl/release/deps/libunicode_segmentation-0c0b9d7ad08d7166.rlib" "/target/mips-unknown-linux-musl/release/deps/liblog-8a6ceab12c90a0cf.rlib" "/target/mips-unknown-linux-musl/release/deps/libdirs_next-c3b4127a1234641a.rlib" "/target/mips-unknown-linux-musl/release/deps/libdirs_sys_next-a34ae8bc8b7a5176.rlib" "/target/mips-unknown-linux-musl/release/deps/liblibc-1c580d9222d5ced3.rlib" "/target/mips-unknown-linux-musl/release/deps/libcfg_if-9e496e9a88cd5040.rlib" "/target/mips-unknown-linux-musl/release/deps/libmemchr-373fc5b133a94e81.rlib" "/target/mips-unknown-linux-musl/release/deps/libradix_trie-f9f4c5420bf758e6.rlib" "/target/mips-unknown-linux-musl/release/deps/libnibble_vec-81cb618471c07e05.rlib" "/target/mips-unknown-linux-musl/release/deps/libsmallvec-f01018e62d2d9fcc.rlib" "/target/mips-unknown-linux-musl/release/deps/libendian_type-c0a46cee52b1194a.rlib" "/target/mips-unknown-linux-musl/release/deps/liblibprocmem-91c2ece298acb062.rlib" "/target/mips-unknown-linux-musl/release/deps/libstd-9e3dd2996d76e236.rlib" "/target/mips-unknown-linux-musl/release/deps/libpanic_unwind-05fd62e2e5190058.rlib" "/target/mips-unknown-linux-musl/release/deps/libobject-8391a6a9760f69cd.rlib" "/target/mips-unknown-linux-musl/release/deps/libmemchr-9e8b26be85743ca9.rlib" "/target/mips-unknown-linux-musl/release/deps/libaddr2line-9fc891e3078cdc2a.rlib" "/target/mips-unknown-linux-musl/release/deps/libgimli-7c8c86c3c6a9ff9c.rlib" "/target/mips-unknown-linux-musl/release/deps/librustc_demangle-b4741a36dad37b6e.rlib" "/target/mips-unknown-linux-musl/release/deps/libstd_detect-898216c412661c60.rlib" "/target/mips-unknown-linux-musl/release/deps/libhashbrown-3b1455342d317d65.rlib" "/target/mips-unknown-linux-musl/release/deps/librustc_std_workspace_alloc-efdeaa4e8a01e067.rlib" "/target/mips-unknown-linux-musl/release/deps/libminiz_oxide-372077df760e62cf.rlib" "/target/mips-unknown-linux-musl/release/deps/libadler-e4f425e32ffb9ae3.rlib" "/target/mips-unknown-linux-musl/release/deps/libunwind-48cdaf50d0a1124e.rlib" "-lunwind" "/target/mips-unknown-linux-musl/release/deps/libcfg_if-8fe4a3fea3e9034a.rlib" "/target/mips-unknown-linux-musl/release/deps/liblibc-658ba3268e14df43.rlib" "-lc" "/target/mips-unknown-linux-musl/release/deps/liballoc-d70651e200e8d582.rlib" "/target/mips-unknown-linux-musl/release/deps/librustc_std_workspace_core-d53f8587ae739f1d.rlib" "/target/mips-unknown-linux-musl/release/deps/libcore-eb1dd64dfba6dbf7.rlib" "/target/mips-unknown-linux-musl/release/deps/libcompiler_builtins-9edbe9ff1b935c24.rlib" "-Wl,-Bdynamic" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-nostartfiles" "-L" "/rust/lib/rustlib/mips-unknown-linux-musl/lib" "-L" "/rust/lib/rustlib/mips-unknown-linux-musl/lib/self-contained" "-o" "/target/mips-unknown-linux-musl/release/deps/mempeek-557b2e1c2d7bb520" "-Wl,--gc-sections" "-static" "-no-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-nodefaultlibs" "crtend.o" "crtn.o"
  = note: mips-linux-muslsf-gcc: error: crt1.o: No such file or directory
          mips-linux-muslsf-gcc: error: crti.o: No such file or directory
          mips-linux-muslsf-gcc: error: crtbegin.o: No such file or directory
          mips-linux-muslsf-gcc: error: crtend.o: No such file or directory
          mips-linux-muslsf-gcc: error: crtn.o: No such file or directory

What target(s) are you cross-compiling for?

mips-unknown-linux-musl

Which operating system is the host (e.g computer cross is on) running?

  • macOS
  • Windows
  • Linux / BSD
  • other OS (specify in description)

What architecture is the host?

  • x86_64 / AMD64
  • arm32
  • arm64 (including Mac M1)

What container engine is cross using?

  • docker
  • podman
  • other container engine (specify in description)

cross version

cross v0.2.5`

Example

No response

Additional information / notes

No response

About this issue

  • Original URL
  • State: open
  • Created 6 months ago
  • Comments: 18 (6 by maintainers)

Most upvoted comments

Just as an update, I am now able to build it using the nightly, which is 1.77.

Which makes sense, thats what cross uses 😉

Im not sure. Im trying to find a way to solve it with https://github.com/cross-rs/cross/issues/1422 and https://github.com/cross-rs/cross/pull/1432

For now I’ve just disabled it, but I want a real solution. A possibility would be to use a older rustc, just invoke cross like cross +1.65

Looks like the same as my CI:

$ cross --version
cross 0.2.5 (e2e643f 2024-01-10)


mempeek $ cross build --bin mempeek --locked --release --target mips-unknown-linux-musl -Zbuild-std="core,std,alloc,proc_macro"
   Compiling mempeek v0.1.5 (/home/wcampbell/projects/wcampbell/mempeek)
error: linking with `mips-linux-muslsf-gcc` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/home/wcampbell/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/home/wcampbell/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/self-contained:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/wcampbell/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin" VSLANG="1033" "mips-linux-muslsf-gcc" "crt1.o" "crti.o" "crtbegin.o" "/tmp/rustcoxFHCI/symbols.o" "/target/mips-unknown-linux-musl/release/deps/mempeek-09c19145e6a1850e.mempeek.eb8aafbaa805f415-cgu.00.rcgu.o" "/target/mips-unknown-linux-musl/release/deps/mempeek-09c19145e6a1850e.mempeek.eb8aafbaa805f415-cgu.01.rcgu.o" "/target/mips-unknown-linux-musl/release/deps/mempeek-09c19145e6a1850e.mempeek.eb8aafbaa805f415-cgu.02.rcgu.o" "/target/mips-unknown-linux-musl/release/deps/mempeek-09c19145e6a1850e.mempeek.eb8aafbaa805f415-cgu.03.rcgu.o" "/target/mips-unknown-linux-musl/release/deps/mempeek-09c19145e6a1850e.mempeek.eb8aafbaa805f415-cgu.04.rcgu.o" "/target/mips-unknown-linux-musl/release/deps/mempeek-09c19145e6a1850e.mempeek.eb8aafbaa805f415-cgu.05.rcgu.o" "/target/mips-unknown-linux-musl/release/deps/mempeek-09c19145e6a1850e.mempeek.eb8aafbaa805f415-cgu.06.rcgu.o" "/target/mips-unknown-linux-musl/release/deps/mempeek-09c19145e6a1850e.mempeek.eb8aafbaa805f415-cgu.07.rcgu.o" "/target/mips-unknown-linux-musl/release/deps/mempeek-09c19145e6a1850e.mempeek.eb8aafbaa805f415-cgu.08.rcgu.o" "/target/mips-unknown-linux-musl/release/deps/mempeek-09c19145e6a1850e.mempeek.eb8aafbaa805f415-cgu.09.rcgu.o" "/target/mips-unknown-linux-musl/release/deps/mempeek-09c19145e6a1850e.mempeek.eb8aafbaa805f415-cgu.10.rcgu.o" "/target/mips-unknown-linux-musl/release/deps/mempeek-09c19145e6a1850e.mempeek.eb8aafbaa805f415-cgu.11.rcgu.o" "/target/mips-unknown-linux-musl/release/deps/mempeek-09c19145e6a1850e.mempeek.eb8aafbaa805f415-cgu.12.rcgu.o" "/target/mips-unknown-linux-musl/release/deps/mempeek-09c19145e6a1850e.mempeek.eb8aafbaa805f415-cgu.13.rcgu.o" "/target/mips-unknown-linux-musl/release/deps/mempeek-09c19145e6a1850e.mempeek.eb8aafbaa805f415-cgu.14.rcgu.o" "/target/mips-unknown-linux-musl/release/deps/mempeek-09c19145e6a1850e.mempeek.eb8aafbaa805f415-cgu.15.rcgu.o" "/target/mips-unknown-linux-musl/release/deps/mempeek-09c19145e6a1850e.lzxto9loas2o49g.rcgu.o" "-Wl,--as-needed" "-L" "/target/mips-unknown-linux-musl/release/deps" "-L" "/target/release/deps" "-L" "/home/wcampbell/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/mips-unknown-linux-musl/lib" "-Wl,-Bstatic" "/target/mips-unknown-linux-musl/release/deps/libquoted_strings-3f86821f8a8959fe.rlib" "/target/mips-unknown-linux-musl/release/deps/librustyline-378c1c66d333741c.rlib" "/target/mips-unknown-linux-musl/release/deps/libutf8parse-83d7e491fb0cb295.rlib" "/target/mips-unknown-linux-musl/release/deps/libnix-207524889cb89a3f.rlib" "/target/mips-unknown-linux-musl/release/deps/libmemoffset-9a4c08e4886d4718.rlib" "/target/mips-unknown-linux-musl/release/deps/libfd_lock-9f9725d40468a2d0.rlib" "/target/mips-unknown-linux-musl/release/deps/librustix-60af2a09a8d0c598.rlib" "/target/mips-unknown-linux-musl/release/deps/libbitflags-129a40469095dd0a.rlib" "/target/mips-unknown-linux-musl/release/deps/liberrno-feaf35900d00509b.rlib" "/target/mips-unknown-linux-musl/release/deps/libio_lifetimes-2e320dc96f5b2d7e.rlib" "/target/mips-unknown-linux-musl/release/deps/libunicode_width-0ca943d63306d7f5.rlib" "/target/mips-unknown-linux-musl/release/deps/libunicode_segmentation-3adf39730347a365.rlib" "/target/mips-unknown-linux-musl/release/deps/liblog-579bf58d67f56ed4.rlib" "/target/mips-unknown-linux-musl/release/deps/libdirs_next-f24f1ab1163baa46.rlib" "/target/mips-unknown-linux-musl/release/deps/libdirs_sys_next-f006918deb1f6c0c.rlib" "/target/mips-unknown-linux-musl/release/deps/liblibc-2041180cef049d2d.rlib" "/target/mips-unknown-linux-musl/release/deps/libcfg_if-42b4425ad61394e1.rlib" "/target/mips-unknown-linux-musl/release/deps/libmemchr-2abc50572e454ae3.rlib" "/target/mips-unknown-linux-musl/release/deps/libradix_trie-f547380a27ae3125.rlib" "/target/mips-unknown-linux-musl/release/deps/libnibble_vec-a930a0492201b84b.rlib" "/target/mips-unknown-linux-musl/release/deps/libsmallvec-e06960e6742d9c31.rlib" "/target/mips-unknown-linux-musl/release/deps/libendian_type-ba6e88f33e99f9ab.rlib" "/target/mips-unknown-linux-musl/release/deps/liblibprocmem-94704556afa87dc4.rlib" "/target/mips-unknown-linux-musl/release/deps/libstd-09cb161c533af38b.rlib" "/target/mips-unknown-linux-musl/release/deps/libpanic_unwind-0ffefa605ea2384c.rlib" "/target/mips-unknown-linux-musl/release/deps/libobject-a263cda1a69d5af5.rlib" "/target/mips-unknown-linux-musl/release/deps/libmemchr-35d1d4fef25e3a3c.rlib" "/target/mips-unknown-linux-musl/release/deps/libaddr2line-938f3c4c53330738.rlib" "/target/mips-unknown-linux-musl/release/deps/libgimli-6b65f0b4ec65e137.rlib" "/target/mips-unknown-linux-musl/release/deps/librustc_demangle-cb4575a6875d0421.rlib" "/target/mips-unknown-linux-musl/release/deps/libstd_detect-0b5b2e46ac73f8d5.rlib" "/target/mips-unknown-linux-musl/release/deps/libhashbrown-69470548e07bae13.rlib" "/target/mips-unknown-linux-musl/release/deps/librustc_std_workspace_alloc-2acd7e950e47a5bd.rlib" "/target/mips-unknown-linux-musl/release/deps/libminiz_oxide-0cea573322e1ae8e.rlib" "/target/mips-unknown-linux-musl/release/deps/libadler-ffb87f3f8c9f514f.rlib" "/target/mips-unknown-linux-musl/release/deps/libunwind-1c6cc2142b587572.rlib" "-lunwind" "/target/mips-unknown-linux-musl/release/deps/libcfg_if-06bd90eedb920945.rlib" "/target/mips-unknown-linux-musl/release/deps/liblibc-dc31e85c2946525a.rlib" "-lc" "/target/mips-unknown-linux-musl/release/deps/liballoc-8fbbe3b681f94a44.rlib" "/target/mips-unknown-linux-musl/release/deps/librustc_std_workspace_core-c8bf80c75c411f7c.rlib" "/target/mips-unknown-linux-musl/release/deps/libcore-dd7041a17180d666.rlib" "/target/mips-unknown-linux-musl/release/deps/libcompiler_builtins-208b7daed09b840d.rlib" "-Wl,-Bdynamic" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-nostartfiles" "-L" "/home/wcampbell/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/mips-unknown-linux-musl/lib" "-L" "/home/wcampbell/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/mips-unknown-linux-musl/lib/self-contained" "-o" "/target/mips-unknown-linux-musl/release/deps/mempeek-09c19145e6a1850e" "-Wl,--gc-sections" "-static" "-no-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-nodefaultlibs" "crtend.o" "crtn.o"
  = note: mips-linux-muslsf-gcc: error: crt1.o: No such file or directory
          mips-linux-muslsf-gcc: error: crti.o: No such file or directory
          mips-linux-muslsf-gcc: error: crtbegin.o: No such file or directory
          mips-linux-muslsf-gcc: error: crtend.o: No such file or directory
          mips-linux-muslsf-gcc: error: crtn.o: No such file or directory


error: could not compile `mempeek` (bin "mempeek") due to 1 previous error
[cross] warning: rust-std is not available for mips-unknown-linux-musl
[cross] note: you may need to build components for the target via `-Z build-std=<components>` or in your cross configuration specify `target.mips-unknown-linux-musl.build-std`
              the available components are core, std, alloc, and proc_macro