Skip to content

Commit

Permalink
glibc: Change riscv32-linux-gnuilp32 target triple to riscv32-linux-gnu.
Browse files Browse the repository at this point in the history
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 ziglang#20690.
  • Loading branch information
alexrp authored and Igor Stojkovic committed Aug 11, 2024
1 parent 0bc0874 commit d583d91
Show file tree
Hide file tree
Showing 31 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/std/zig/target.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
1 change: 0 additions & 1 deletion src/target.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
2 changes: 1 addition & 1 deletion tools/process_headers.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit d583d91

Please sign in to comment.