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 | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/config/riscv/riscv.h b/gcc/config/riscv/riscv.h
index b98a4a4df60..cb821ae8b3a 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
-- 
2.54.0

Reply via email to