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

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

Open
madsmtm opened this issue Oct 2, 2024 · 1 comment
Open

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

madsmtm opened this issue Oct 2, 2024 · 1 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.

Comments

@madsmtm
Copy link
Contributor

madsmtm commented Oct 2, 2024

Target triples are generally arch-vendor-os-env (with lots of exceptions), but the mips64-openwrt-linux-musl target (added in #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:

  • Declare OpenWRT as the vendor (which is also the position in the triple that it's currently located), and set target_vendor="openwrt".
  • Rename the target to mips64-unknown-openwrt-musl or similar, and set target_os="openwrt".
    • A rename could be beneficial anyhow, since it actual uses target_abi = "abi64", and so the target name should contain muslabi64.

CC target maintainer @Itus-Shield

@madsmtm madsmtm added the C-bug Category: This is a bug. label Oct 2, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 2, 2024
@lolbinarycat lolbinarycat added the O-MIPS Target: MIPS processors label Oct 2, 2024
@taiki-e
Copy link
Member

taiki-e commented Oct 3, 2024

In my understanding, *-openwrt-linux-musl* is basically the same as *-unknown-linux-musl* (see also #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)

@Noratrieb Noratrieb added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Nov 9, 2024
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