Group similar target_arches with target_family #1034
Copy link
Copy link
Open
Labels
T-compilerAdd this label so rfcbot knows to poll the compiler teamAdd this label so rfcbot knows to poll the compiler teammajor-changeA proposal to make a major change to rustcA proposal to make a major change to rustc
Description
Activity
- addedT-compilerAdd this label so rfcbot knows to poll the compiler teamAdd this label so rfcbot knows to poll the compiler teammajor-changeA proposal to make a major change to rustcA proposal to make a major change to rustc
on Sep 5, 2026 - addedto-announceAnnounce this issue on triage meetingAnnounce this issue on triage meeting
on Sep 5, 2026 Important
This issue is not meant to be used for technical discussion. There is a Zulip stream for that.
Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.cc @rust-lang/compilerConcerns or objections can formally be registered here by adding a comment.
@rustbot concern reason-for-concern <description of the concern>Concerns can be lifted with:
@rustbot resolve reason-for-concernSee documentation at https://forge.rust-lang.org
- removedto-announceAnnounce this issue on triage meetingAnnounce this issue on triage meeting
on Sep 24, 2026
Metadata
Metadata
Assignees
Labels
T-compilerAdd this label so rfcbot knows to poll the compiler teamAdd this label so rfcbot knows to poll the compiler teammajor-changeA proposal to make a major change to rustcA proposal to make a major change to rustc
Background
We currently have the following list of values for
target_arch:aarch64amdgpuarmarm64ecavrbpfcskyhexagonloongarch32loongarch64m68kmipsmips32r6mips64mips64r6msp430nvptx64powerpcpowerpc64riscv32riscv64s390xsparcsparc64wasm32wasm64x86x86_64xtensaOften you want to configure the 32- and 64-bit versions of an arch the same, such as x86-32 and x86-64. The way to do this currently is with
cfg(any(target_arch = "x86", target_arch = "x86_64"))but this gets repetitive, especially with targets like MIPS that have more than two possible values fortarget_arch.(Inspired by #t-compiler > mipsr6 targets `target_arch` confusion)
Proposal
Add a number of new
target_familyvalues intended to group targets with similar 32- and 64-bit arch variants, as well as within similar 32- and 64-bit arches (only applicable on MIPS). This is what we already do on Wasm. Similar defines set by Clang are provided for reference, from https://c.godbolt.org/z/a66Yx7Pqb.New cfg:
target_family="arm":arm(clang:__arm__)aarch64(clang:__aarch64__)arm64ec(clang:__arm64ec__,__amd64__)target_family="aarch64":aarch64(clang:__aarch64__)arm64ec(clang:__arm64ec__,__amd64__)target_family="loongarch":loongarch32(clang:__loongarch__, no loongarch32)loongarch64(clang:__loongarch__,__loongarch64)target_family="mips":mips(clang:__mips__,__mips = 32)mips32r6(clang:__mips__,__mips = 32)mips64(clang:__mips__,__mips64__)mips64r6(clang:__mips__,__mips64__)target_family="mips32":mips(clang: see above)mips32r6(clang: see above)target_family="mips64":mips64(clang: see above)mips64r6(clang: see above)target_family="powerpc":powerpc(clang:__powerpc__, no powerpc32)powerpc64(clang:__powerpc__,__powerpc64__)target_family="riscv":riscv32(clang:__riscv, no riscv32)riscv64(clang:__riscv, no riscv64)target_family="sparc":sparc(clang:__sparc__, no sparc32)sparc64(clang:__sparc__,__sparc64__)target_family="x86":x86(clang:__i386__)x86_64(clang:__x86_64__,__amd64__)Already grouped with
target_family="wasm":wasm32wasm64Arches that get no new
target_family:amdgpuavrbpfcskyhexagonm68kmsp430nvptx64s390xxtensaThere is a case for grouping
aarch64,arm64ec, andarmundertarget_family="arm", but the 32- and 64-bit variants tend to be treated more independently than other 32- and 64-bit groups.Mentors or Reviewers
If you have a reviewer or mentor in mind for this work, mention them here. You can put your own name here if you are planning to mentor the work.
I can mentor if needed.
Process
The main points of the Major Change Process are as follows:
@rustbot secondor kickoff a team FCP with@rfcbot fcp $RESOLUTION.You can read more about Major Change Proposals on forge.