-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Allow building for hard-float targets in RISC-V #65024
Comments
+1 for general-purpose binary Linux distributions has been agreed use lp64d as the Hardware baseline and ABI choice. https://wiki.debian.org/RISC-V#Hardware_baseline_and_ABI_choice |
…excrichton Allow specifying LLVM's MCTargetOptions::ABIName in target specification files This addresses rust-lang#65024, as it allows RISC-V target specification files to set `"llvm-abiname": "lp64d"`. Other languages (read: C) usually expose this codegen parameter under a compiler argument like `-mabi=<XYZ>`.
…excrichton Allow specifying LLVM's MCTargetOptions::ABIName in target specification files This addresses rust-lang#65024, as it allows RISC-V target specification files to set `"llvm-abiname": "lp64d"`. Other languages (read: C) usually expose this codegen parameter under a compiler argument like `-mabi=<XYZ>`.
…excrichton Allow specifying LLVM's MCTargetOptions::ABIName in target specification files This addresses rust-lang#65024, as it allows RISC-V target specification files to set `"llvm-abiname": "lp64d"`. Other languages (read: C) usually expose this codegen parameter under a compiler argument like `-mabi=<XYZ>`.
Now that #65953 is in, we can add new target specifications to close this issue. We might want to add a
The alternative is to append That way, we can specify:
Or even:
|
It is very unlikely that rustc is doing the correct ABI lowering of calls etc for the C psABI, especially when hard-floats are considered. Just switching on It has been on my list for a while to check the ABI lowering in rustc so that it matches the psABI, which will potentially require backwards-incompatible changes. I hope to get to this soon (there's other RISC-V LLVM work on my plate first). |
Rustc should now be doing the correct ABI lowering of calls in the C psABI, including hard-float support (since #68452). A target spec for rv64gc + lp64d (targetting linux) has been added in the form of |
I suppose this can be closed now? |
|
Currently Rust does not support compiling/linking with LLVM's
-target-abi=lp64d
option, which enables the hard-float ABI in riscv64.This feature is necessary for Rust interop with C code on hard-float targets.
The text was updated successfully, but these errors were encountered: