Skip to content

Commit 45e6db4

Browse files
authored
Merge pull request #4576 from bedroge/gcc_riscv_strict_precise
don't use special flags for `strict`, `precise`, `loose`, `veryloose` toolchain options on RISC-V
2 parents fbf5d39 + 37858f1 commit 45e6db4

File tree

1 file changed

+9
-0
lines changed
  • easybuild/toolchains/compiler

1 file changed

+9
-0
lines changed

easybuild/toolchains/compiler/gcc.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,15 @@ class Gcc(Compiler):
7878
COMPILER_UNIQUE_OPTION_MAP['strict'] = no_recip_alternative
7979
COMPILER_UNIQUE_OPTION_MAP['precise'] = no_recip_alternative
8080

81+
# gcc on RISC-V does not support -mno-recip, -mieee-fp, -mfno-math-errno...
82+
# https://gcc.gnu.org/onlinedocs/gcc/RISC-V-Options.html
83+
# there are no good alternatives, so stick to the default flags
84+
if systemtools.get_cpu_family() == systemtools.RISCV:
85+
COMPILER_UNIQUE_OPTION_MAP['strict'] = []
86+
COMPILER_UNIQUE_OPTION_MAP['precise'] = []
87+
COMPILER_UNIQUE_OPTION_MAP['loose'] = ['fno-math-errno']
88+
COMPILER_UNIQUE_OPTION_MAP['verloose'] = ['fno-math-errno']
89+
8190
# used when 'optarch' toolchain option is enabled (and --optarch is not specified)
8291
COMPILER_OPTIMAL_ARCHITECTURE_OPTION = {
8392
(systemtools.AARCH32, systemtools.ARM): 'mcpu=native', # implies -march=native and -mtune=native

0 commit comments

Comments
 (0)