From 47cc233f220bcfb7b7183692861651423d965117 Mon Sep 17 00:00:00 2001 From: Sertonix Date: Sun, 11 Jan 2026 20:50:13 +0100 Subject: [PATCH] aro: define arch macros for riscv Fixes some test failure: test +- test-standalone +- standalone_test_cases +- standalone_test_cases.glibc_compat +- CheckObject +- compile exe native-linux-gnu.2.38 Debug native-linux-gnu.2.38 64 errors test/standalone/glibc_compat/glibc_runtime_check.zig:11:18: error: C import failed const c_malloc = @cImport( ^~~~~~~~ referenced by: checkReallocarray: test/standalone/glibc_compat/glibc_runtime_check.zig:46:27 main: test/standalone/glibc_compat/glibc_runtime_check.zig:112:26 4 reference(s) hidden; use '-freference-trace=6' to see all references error: translation failure build/stage3/lib/zig/libc/include/riscv-linux-gnu/bits/wordsize.h:22:3: error: unsupported ABI --- lib/compiler/aro/aro/Compilation.zig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/compiler/aro/aro/Compilation.zig b/lib/compiler/aro/aro/Compilation.zig index 6f3a1a44da..c5f400f1d9 100644 --- a/lib/compiler/aro/aro/Compilation.zig +++ b/lib/compiler/aro/aro/Compilation.zig @@ -838,6 +838,9 @@ fn generateSystemDefines(comp: *Compilation, w: *Io.Writer) !void { try define(w, "__VX__"); } }, + .riscv32, .riscv32be, .riscv64, .riscv64be => { + try w.print("#define __riscv_xlen {d}\n", .{ptr_width}); + }, else => {}, }