]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: Specify cmodel in OPTION_DEFAULT_SPECS
authorKito Cheng <kito.cheng@sifive.com>
Thu, 4 Jun 2026 14:49:37 +0000 (22:49 +0800)
committerKito Cheng <kito.cheng@sifive.com>
Fri, 5 Jun 2026 06:43:58 +0000 (14:43 +0800)
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.

gcc/config/riscv/riscv.h

index b98a4a4df608a044b53b62e7cd4b4f5ec06fee35..cb821ae8b3a63e9afd40ddeae915f59ccd43554d 100644 (file)
@@ -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