From cb8c905c47aea018d8bef7b68ab885ce99d984da Mon Sep 17 00:00:00 2001 From: Tsukasa OI Date: Mon, 25 Aug 2025 08:48:39 +0000 Subject: rustc_codegen_ssa: More comprehensive RISC-V ELF flags This commit implements more conformant, more comprehensive RISC-V ELF flags handling when generating certain object files directly from rustc. * Use "zca" instead of "c" The "Zca" extension (a subset of "C") is the minimal configuration for compressed instructions to set `EF_RISCV_RVC` flag. * Set TSO flag from "ztso" The "Ztso" extension denotes that the program depends on the RVTSO (Total Store Ordering) memory consistency model, which is stronger than the standard RVWMO (Weak Memory Ordering) consistency model and on ELF targets, we need to set `EF_RISCV_TSO` flag. --- compiler/rustc_span/src/symbol.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'compiler/rustc_span/src') diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index 5d140cc6117..585968044bf 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -2419,9 +2419,11 @@ symbols! { yield_expr, ymm_reg, yreg, + zca, zfh, zfhmin, zmm_reg, + ztso, // tidy-alphabetical-end } } -- cgit 1.4.1-3-g733a5