[gcc r17-1359] RISC-V: Specify cmodel in OPTION_DEFAULT_SPECS
Kito Cheng
kito@gcc.gnu.org
Fri Jun 5 06:44:22 GMT 2026
https://gcc.gnu.org/g:218780d6c7b93cec4d7088079820491b6b8f2771
commit r17-1359-g218780d6c7b93cec4d7088079820491b6b8f2771
Author: Kito Cheng <kito.cheng@sifive.com>
Date: Thu Jun 4 22:49:37 2026 +0800
RISC-V: Specify cmodel in OPTION_DEFAULT_SPECS
We have supported --with-cmodel for a while and set the default via
TARGET_DEFAULT_CMODEL. That works well in general, but not for
multilib, because GCC cannot detect the cmodel for the current multilib
correctly that way. So we still need to specify the default cmodel in
OPTION_DEFAULT_SPECS.
gcc/ChangeLog:
* config/riscv/riscv.h (OPTION_DEFAULT_SPECS): Specify default
cmodel.
Diff:
---
gcc/config/riscv/riscv.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/gcc/config/riscv/riscv.h b/gcc/config/riscv/riscv.h
index b98a4a4df608..cb821ae8b3a6 100644
--- a/gcc/config/riscv/riscv.h
+++ b/gcc/config/riscv/riscv.h
@@ -66,6 +66,7 @@ extern const char *riscv_arch_help (int argc, const char **argv);
--with-tune is ignored if -mtune or -mcpu is specified.
--with-isa-spec is ignored if -misa-spec is specified.
--with-tls is ignored if -mtls-dialect is specified.
+ --with-cmodel is ignored if -mcmodel is specified.
Uses default values if -mcpu doesn't have a valid option. */
#define OPTION_DEFAULT_SPECS \
@@ -79,6 +80,7 @@ extern const char *riscv_arch_help (int argc, const char **argv);
{"abi", "%{!mabi=*:-mabi=%(VALUE)}" }, \
{"isa_spec", "%{!misa-spec=*:-misa-spec=%(VALUE)}" }, \
{"tls", "%{!mtls-dialect=*:-mtls-dialect=%(VALUE)}"}, \
+ {"cmodel", "%{!mcmodel=*:-mcmodel=%(VALUE)}" }, \
#ifdef IN_LIBGCC2
#undef TARGET_64BIT
More information about the Gcc-cvs
mailing list