rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.76k stars 12.76k forks source link

The target information for `mips64-openwrt-linux-musl` seems wrong #131165

Open madsmtm opened 1 month ago

madsmtm commented 1 month ago

Target triples are generally arch-vendor-os-env (with lots of exceptions), but the mips64-openwrt-linux-musl target (added in https://github.com/rust-lang/rust/pull/92300) seems to be confused about the vendor?

The target cfgs are currently (trimmed from rustc --print cfg --target mips64-openwrt-linux-musl):

target_arch="mips64"
target_vendor="unknown"
target_os="linux"
target_env="musl"

I think there's a few ways to fix this:

CC target maintainer @Itus-Shield

taiki-e commented 1 month ago

In my understanding, *-openwrt-linux-musl* is basically the same as *-unknown-linux-musl* (see also https://github.com/rust-lang/rust/pull/106265). But as for mips64, it had to be added as a separate triple because the features enabled were different (mips64-unknown-linux-muslabi64 is hard-float + static-linking by default, but mips64-openwrt-linux-musl is soft-float + dynamic-linking by default). So I think it is wrong to use target_os="openwrt" at least.

As for -muslabi64 vs -musl, I guess abi64 was omitted because openwrt does not support other ABIs. (MIPS64 has another ABI called N32)