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

Support building glibc for riscv32/riscv64 #20909

Merged
merged 8 commits into from
Aug 7, 2024
Merged

Conversation

alexrp
Copy link
Member

@alexrp alexrp commented Aug 2, 2024

  • This builds on what @RossComputerGuy started in glibc: add changes to make riscv64-linux-gnu works #18803. I went in a slightly different direction for NO_INITFINI, though. I also am not including the .cfi_label workaround because we're expecting to upgrade to LLVM 19 in this release cycle, which contains [MC] Support .cfi_label llvm/llvm-project#97922.
  • I renamed the riscv32-linux-gnuilp32 target triple to riscv32-linux-gnu. This is consistent with riscv64-linux-gnu. The old triple was weird for multiple reasons; see the commit message.
  • I replaced all ilp32/lp64 references with ilp32d/lp64d as the hard float ABIs are expected to be the most common on Linux systems by far. The other ABIs can come later (ideally after RFC/Proposal: Turning Zig target triples into quadruples #20690, or something like it).
  • I fixed some small papercuts, like making Zig pick a better default glibc version when the target architecture requires a newer version than our standard library minimum, and making Zig actually print the minimum version it can provide when giving an error due to inability to provide libc.

Closes #3340.
Closes #19107.

alexrp and others added 8 commits August 2, 2024 09:54
The vast majority of Linux systems will be running these ABIs.
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.
The former are soft float; the latter are hard float. We primarily care about
hard float here.

Signed-off-by: Alex Rønne Petersen <[email protected]>
The former are soft float; the latter are hard float. We primarily care about
hard float here.
@andrewrk andrewrk merged commit cd5f673 into ziglang:master Aug 7, 2024
10 checks passed
@alexrp alexrp deleted the glibc-riscv branch August 7, 2024 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants