[PATCH 3/5] riscv: compat_vdso: Introduce COMPAT_MARCH variable
Nam Cao
namcao at linutronix.de
Fri Jun 19 07:11:19 PDT 2026
The -march option is inside COMPAT_CC_FLAGS, making it difficult to extend.
Introduce COMPAT_MARCH variable to allow extension. A follow-up commit
will take advantage of this to add _zacas to -march.
Signed-off-by: Nam Cao <namcao at linutronix.de>
---
arch/riscv/kernel/compat_vdso/Makefile | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/arch/riscv/kernel/compat_vdso/Makefile b/arch/riscv/kernel/compat_vdso/Makefile
index 9520569ee079..06d28a5a0368 100644
--- a/arch/riscv/kernel/compat_vdso/Makefile
+++ b/arch/riscv/kernel/compat_vdso/Makefile
@@ -14,10 +14,13 @@ COMPAT_LD := $(LD)
# binutils 2.35 does not support the zifencei extension, but in the ISA
# spec 20191213, G stands for IMAFD_ZICSR_ZIFENCEI.
ifdef CONFIG_TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI
- COMPAT_CC_FLAGS := -march=rv32g -mabi=ilp32
+ COMPAT_MARCH := rv32g
else
- COMPAT_CC_FLAGS := -march=rv32imafd -mabi=ilp32
+ COMPAT_MARCH := rv32imafd
endif
+
+COMPAT_CC_FLAGS := -march=$(COMPAT_MARCH) -mabi=ilp32
+
COMPAT_LD_FLAGS := -melf32lriscv
# Disable attributes, as they're useless and break the build.
--
2.47.3
More information about the linux-riscv
mailing list