From 26f86747a7b1eb6b4ddeac4f83213c3bf2d8b15a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Fri, 2 Aug 2024 08:13:00 +0200 Subject: [PATCH] glibc: Change riscv32-linux-gnuilp32 target triple to riscv32-linux-gnu. This target triple was weird on multiple levels: * The `ilp32` ABI is the soft float ABI. This is not the main ABI we want to support on RISC-V; rather, we want `ilp32d`. * `gnuilp32` is a bespoke tag that was introduced in Zig. The rest of the world just uses `gnu` for RISC-V target triples. * `gnu_ilp32` is already the name of an ILP32 ABI used on AArch64. `gnuilp32` is too easy to confuse with this. * We don't use this convention for `riscv64-linux-gnu`. * Supporting all RISC-V ABIs with this convention will result in combinatorial explosion; see #20690. --- .../bits/endianness.h | 0 .../bits/environments.h | 0 .../{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/bits/fcntl.h | 0 .../{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/bits/fenv.h | 0 .../{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/bits/floatn.h | 0 .../{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/bits/link.h | 0 .../bits/long-double.h | 0 .../{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/bits/procfs.h | 0 .../bits/pthreadtypes-arch.h | 0 .../{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/bits/rseq.h | 0 .../{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/bits/setjmp.h | 0 .../bits/sigcontext.h | 0 .../bits/struct_rwlock.h | 0 .../bits/struct_stat.h | 0 .../{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/bits/time64.h | 0 .../bits/timesize.h | 0 .../bits/typesizes.h | 0 .../bits/wordsize.h | 0 .../{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/fpu_control.h | 0 .../gnu/lib-names-ilp32.h | 0 .../gnu/lib-names.h | 0 .../gnu/stubs-ilp32.h | 0 .../{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/gnu/stubs.h | 0 .../{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/ieee754.h | 0 .../{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/sys/asm.h | 0 .../sys/cachectl.h | 0 .../sys/ucontext.h | 0 .../{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/sys/user.h | 0 lib/std/zig/target.zig | 2 +- src/target.zig | 1 - tools/process_headers.zig | 2 +- 31 files changed, 2 insertions(+), 3 deletions(-) rename lib/libc/include/{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/bits/endianness.h (100%) rename lib/libc/include/{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/bits/environments.h (100%) rename lib/libc/include/{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/bits/fcntl.h (100%) rename lib/libc/include/{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/bits/fenv.h (100%) rename lib/libc/include/{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/bits/floatn.h (100%) rename lib/libc/include/{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/bits/link.h (100%) rename lib/libc/include/{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/bits/long-double.h (100%) rename lib/libc/include/{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/bits/procfs.h (100%) rename lib/libc/include/{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/bits/pthreadtypes-arch.h (100%) rename lib/libc/include/{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/bits/rseq.h (100%) rename lib/libc/include/{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/bits/setjmp.h (100%) rename lib/libc/include/{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/bits/sigcontext.h (100%) rename lib/libc/include/{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/bits/struct_rwlock.h (100%) rename lib/libc/include/{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/bits/struct_stat.h (100%) rename lib/libc/include/{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/bits/time64.h (100%) rename lib/libc/include/{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/bits/timesize.h (100%) rename lib/libc/include/{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/bits/typesizes.h (100%) rename lib/libc/include/{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/bits/wordsize.h (100%) rename lib/libc/include/{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/fpu_control.h (100%) rename lib/libc/include/{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/gnu/lib-names-ilp32.h (100%) rename lib/libc/include/{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/gnu/lib-names.h (100%) rename lib/libc/include/{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/gnu/stubs-ilp32.h (100%) rename lib/libc/include/{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/gnu/stubs.h (100%) rename lib/libc/include/{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/ieee754.h (100%) rename lib/libc/include/{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/sys/asm.h (100%) rename lib/libc/include/{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/sys/cachectl.h (100%) rename lib/libc/include/{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/sys/ucontext.h (100%) rename lib/libc/include/{riscv32-linux-gnuilp32 => riscv32-linux-gnu}/sys/user.h (100%) diff --git a/lib/libc/include/riscv32-linux-gnuilp32/bits/endianness.h b/lib/libc/include/riscv32-linux-gnu/bits/endianness.h similarity index 100% rename from lib/libc/include/riscv32-linux-gnuilp32/bits/endianness.h rename to lib/libc/include/riscv32-linux-gnu/bits/endianness.h diff --git a/lib/libc/include/riscv32-linux-gnuilp32/bits/environments.h b/lib/libc/include/riscv32-linux-gnu/bits/environments.h similarity index 100% rename from lib/libc/include/riscv32-linux-gnuilp32/bits/environments.h rename to lib/libc/include/riscv32-linux-gnu/bits/environments.h diff --git a/lib/libc/include/riscv32-linux-gnuilp32/bits/fcntl.h b/lib/libc/include/riscv32-linux-gnu/bits/fcntl.h similarity index 100% rename from lib/libc/include/riscv32-linux-gnuilp32/bits/fcntl.h rename to lib/libc/include/riscv32-linux-gnu/bits/fcntl.h diff --git a/lib/libc/include/riscv32-linux-gnuilp32/bits/fenv.h b/lib/libc/include/riscv32-linux-gnu/bits/fenv.h similarity index 100% rename from lib/libc/include/riscv32-linux-gnuilp32/bits/fenv.h rename to lib/libc/include/riscv32-linux-gnu/bits/fenv.h diff --git a/lib/libc/include/riscv32-linux-gnuilp32/bits/floatn.h b/lib/libc/include/riscv32-linux-gnu/bits/floatn.h similarity index 100% rename from lib/libc/include/riscv32-linux-gnuilp32/bits/floatn.h rename to lib/libc/include/riscv32-linux-gnu/bits/floatn.h diff --git a/lib/libc/include/riscv32-linux-gnuilp32/bits/link.h b/lib/libc/include/riscv32-linux-gnu/bits/link.h similarity index 100% rename from lib/libc/include/riscv32-linux-gnuilp32/bits/link.h rename to lib/libc/include/riscv32-linux-gnu/bits/link.h diff --git a/lib/libc/include/riscv32-linux-gnuilp32/bits/long-double.h b/lib/libc/include/riscv32-linux-gnu/bits/long-double.h similarity index 100% rename from lib/libc/include/riscv32-linux-gnuilp32/bits/long-double.h rename to lib/libc/include/riscv32-linux-gnu/bits/long-double.h diff --git a/lib/libc/include/riscv32-linux-gnuilp32/bits/procfs.h b/lib/libc/include/riscv32-linux-gnu/bits/procfs.h similarity index 100% rename from lib/libc/include/riscv32-linux-gnuilp32/bits/procfs.h rename to lib/libc/include/riscv32-linux-gnu/bits/procfs.h diff --git a/lib/libc/include/riscv32-linux-gnuilp32/bits/pthreadtypes-arch.h b/lib/libc/include/riscv32-linux-gnu/bits/pthreadtypes-arch.h similarity index 100% rename from lib/libc/include/riscv32-linux-gnuilp32/bits/pthreadtypes-arch.h rename to lib/libc/include/riscv32-linux-gnu/bits/pthreadtypes-arch.h diff --git a/lib/libc/include/riscv32-linux-gnuilp32/bits/rseq.h b/lib/libc/include/riscv32-linux-gnu/bits/rseq.h similarity index 100% rename from lib/libc/include/riscv32-linux-gnuilp32/bits/rseq.h rename to lib/libc/include/riscv32-linux-gnu/bits/rseq.h diff --git a/lib/libc/include/riscv32-linux-gnuilp32/bits/setjmp.h b/lib/libc/include/riscv32-linux-gnu/bits/setjmp.h similarity index 100% rename from lib/libc/include/riscv32-linux-gnuilp32/bits/setjmp.h rename to lib/libc/include/riscv32-linux-gnu/bits/setjmp.h diff --git a/lib/libc/include/riscv32-linux-gnuilp32/bits/sigcontext.h b/lib/libc/include/riscv32-linux-gnu/bits/sigcontext.h similarity index 100% rename from lib/libc/include/riscv32-linux-gnuilp32/bits/sigcontext.h rename to lib/libc/include/riscv32-linux-gnu/bits/sigcontext.h diff --git a/lib/libc/include/riscv32-linux-gnuilp32/bits/struct_rwlock.h b/lib/libc/include/riscv32-linux-gnu/bits/struct_rwlock.h similarity index 100% rename from lib/libc/include/riscv32-linux-gnuilp32/bits/struct_rwlock.h rename to lib/libc/include/riscv32-linux-gnu/bits/struct_rwlock.h diff --git a/lib/libc/include/riscv32-linux-gnuilp32/bits/struct_stat.h b/lib/libc/include/riscv32-linux-gnu/bits/struct_stat.h similarity index 100% rename from lib/libc/include/riscv32-linux-gnuilp32/bits/struct_stat.h rename to lib/libc/include/riscv32-linux-gnu/bits/struct_stat.h diff --git a/lib/libc/include/riscv32-linux-gnuilp32/bits/time64.h b/lib/libc/include/riscv32-linux-gnu/bits/time64.h similarity index 100% rename from lib/libc/include/riscv32-linux-gnuilp32/bits/time64.h rename to lib/libc/include/riscv32-linux-gnu/bits/time64.h diff --git a/lib/libc/include/riscv32-linux-gnuilp32/bits/timesize.h b/lib/libc/include/riscv32-linux-gnu/bits/timesize.h similarity index 100% rename from lib/libc/include/riscv32-linux-gnuilp32/bits/timesize.h rename to lib/libc/include/riscv32-linux-gnu/bits/timesize.h diff --git a/lib/libc/include/riscv32-linux-gnuilp32/bits/typesizes.h b/lib/libc/include/riscv32-linux-gnu/bits/typesizes.h similarity index 100% rename from lib/libc/include/riscv32-linux-gnuilp32/bits/typesizes.h rename to lib/libc/include/riscv32-linux-gnu/bits/typesizes.h diff --git a/lib/libc/include/riscv32-linux-gnuilp32/bits/wordsize.h b/lib/libc/include/riscv32-linux-gnu/bits/wordsize.h similarity index 100% rename from lib/libc/include/riscv32-linux-gnuilp32/bits/wordsize.h rename to lib/libc/include/riscv32-linux-gnu/bits/wordsize.h diff --git a/lib/libc/include/riscv32-linux-gnuilp32/fpu_control.h b/lib/libc/include/riscv32-linux-gnu/fpu_control.h similarity index 100% rename from lib/libc/include/riscv32-linux-gnuilp32/fpu_control.h rename to lib/libc/include/riscv32-linux-gnu/fpu_control.h diff --git a/lib/libc/include/riscv32-linux-gnuilp32/gnu/lib-names-ilp32.h b/lib/libc/include/riscv32-linux-gnu/gnu/lib-names-ilp32.h similarity index 100% rename from lib/libc/include/riscv32-linux-gnuilp32/gnu/lib-names-ilp32.h rename to lib/libc/include/riscv32-linux-gnu/gnu/lib-names-ilp32.h diff --git a/lib/libc/include/riscv32-linux-gnuilp32/gnu/lib-names.h b/lib/libc/include/riscv32-linux-gnu/gnu/lib-names.h similarity index 100% rename from lib/libc/include/riscv32-linux-gnuilp32/gnu/lib-names.h rename to lib/libc/include/riscv32-linux-gnu/gnu/lib-names.h diff --git a/lib/libc/include/riscv32-linux-gnuilp32/gnu/stubs-ilp32.h b/lib/libc/include/riscv32-linux-gnu/gnu/stubs-ilp32.h similarity index 100% rename from lib/libc/include/riscv32-linux-gnuilp32/gnu/stubs-ilp32.h rename to lib/libc/include/riscv32-linux-gnu/gnu/stubs-ilp32.h diff --git a/lib/libc/include/riscv32-linux-gnuilp32/gnu/stubs.h b/lib/libc/include/riscv32-linux-gnu/gnu/stubs.h similarity index 100% rename from lib/libc/include/riscv32-linux-gnuilp32/gnu/stubs.h rename to lib/libc/include/riscv32-linux-gnu/gnu/stubs.h diff --git a/lib/libc/include/riscv32-linux-gnuilp32/ieee754.h b/lib/libc/include/riscv32-linux-gnu/ieee754.h similarity index 100% rename from lib/libc/include/riscv32-linux-gnuilp32/ieee754.h rename to lib/libc/include/riscv32-linux-gnu/ieee754.h diff --git a/lib/libc/include/riscv32-linux-gnuilp32/sys/asm.h b/lib/libc/include/riscv32-linux-gnu/sys/asm.h similarity index 100% rename from lib/libc/include/riscv32-linux-gnuilp32/sys/asm.h rename to lib/libc/include/riscv32-linux-gnu/sys/asm.h diff --git a/lib/libc/include/riscv32-linux-gnuilp32/sys/cachectl.h b/lib/libc/include/riscv32-linux-gnu/sys/cachectl.h similarity index 100% rename from lib/libc/include/riscv32-linux-gnuilp32/sys/cachectl.h rename to lib/libc/include/riscv32-linux-gnu/sys/cachectl.h diff --git a/lib/libc/include/riscv32-linux-gnuilp32/sys/ucontext.h b/lib/libc/include/riscv32-linux-gnu/sys/ucontext.h similarity index 100% rename from lib/libc/include/riscv32-linux-gnuilp32/sys/ucontext.h rename to lib/libc/include/riscv32-linux-gnu/sys/ucontext.h diff --git a/lib/libc/include/riscv32-linux-gnuilp32/sys/user.h b/lib/libc/include/riscv32-linux-gnu/sys/user.h similarity index 100% rename from lib/libc/include/riscv32-linux-gnuilp32/sys/user.h rename to lib/libc/include/riscv32-linux-gnu/sys/user.h diff --git a/lib/std/zig/target.zig b/lib/std/zig/target.zig index 7edacdbe85d4..6cc3b4022761 100644 --- a/lib/std/zig/target.zig +++ b/lib/std/zig/target.zig @@ -57,7 +57,7 @@ pub const available_libcs = [_]ArchOsAbi{ .{ .arch = .powerpc, .os = .linux, .abi = .gnueabi }, .{ .arch = .powerpc, .os = .linux, .abi = .gnueabihf }, .{ .arch = .powerpc, .os = .linux, .abi = .musl }, - .{ .arch = .riscv32, .os = .linux, .abi = .gnuilp32, .glibc_min = .{ .major = 2, .minor = 33, .patch = 0 } }, + .{ .arch = .riscv32, .os = .linux, .abi = .gnu, .glibc_min = .{ .major = 2, .minor = 33, .patch = 0 } }, .{ .arch = .riscv32, .os = .linux, .abi = .musl }, .{ .arch = .riscv64, .os = .linux, .abi = .gnu, .glibc_min = .{ .major = 2, .minor = 27, .patch = 0 } }, .{ .arch = .riscv64, .os = .linux, .abi = .musl }, diff --git a/src/target.zig b/src/target.zig index 768e4d957eb9..6cd5967d0e75 100644 --- a/src/target.zig +++ b/src/target.zig @@ -369,7 +369,6 @@ pub fn addrSpaceCastIsValid( pub fn llvmMachineAbi(target: std.Target) ?[:0]const u8 { const have_float = switch (target.abi) { - .gnuilp32 => return "ilp32", .gnueabihf, .musleabihf, .eabihf => true, else => false, }; diff --git a/tools/process_headers.zig b/tools/process_headers.zig index 66ce77d7c499..6c0bb4c7d6c7 100644 --- a/tools/process_headers.zig +++ b/tools/process_headers.zig @@ -167,7 +167,7 @@ const glibc_targets = [_]LibCTarget{ LibCTarget{ .name = "riscv32-linux-gnu-rv32imac-ilp32", .arch = MultiArch{ .specific = Arch.riscv32 }, - .abi = MultiAbi{ .specific = Abi.gnuilp32 }, + .abi = MultiAbi{ .specific = Abi.gnu }, }, LibCTarget{ .name = "riscv64-linux-gnu-rv64imac-lp64",