Skip to content

Commit

Permalink
Merge pull request easybuilders#4576 from bedroge/gcc_riscv_strict_pr…
Browse files Browse the repository at this point in the history
…ecise

don't use special flags for `strict`, `precise`, `loose`, `veryloose` toolchain options on RISC-V
  • Loading branch information
boegel authored Jul 31, 2024
2 parents fbf5d39 + 37858f1 commit 45e6db4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions easybuild/toolchains/compiler/gcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,15 @@ class Gcc(Compiler):
COMPILER_UNIQUE_OPTION_MAP['strict'] = no_recip_alternative
COMPILER_UNIQUE_OPTION_MAP['precise'] = no_recip_alternative

# gcc on RISC-V does not support -mno-recip, -mieee-fp, -mfno-math-errno...
# https://gcc.gnu.org/onlinedocs/gcc/RISC-V-Options.html
# there are no good alternatives, so stick to the default flags
if systemtools.get_cpu_family() == systemtools.RISCV:
COMPILER_UNIQUE_OPTION_MAP['strict'] = []
COMPILER_UNIQUE_OPTION_MAP['precise'] = []
COMPILER_UNIQUE_OPTION_MAP['loose'] = ['fno-math-errno']
COMPILER_UNIQUE_OPTION_MAP['verloose'] = ['fno-math-errno']

# used when 'optarch' toolchain option is enabled (and --optarch is not specified)
COMPILER_OPTIMAL_ARCHITECTURE_OPTION = {
(systemtools.AARCH32, systemtools.ARM): 'mcpu=native', # implies -march=native and -mtune=native
Expand Down

0 comments on commit 45e6db4

Please sign in to comment.