scripts: waifulib: compiler_optimizations: set pentium-m minimum cpu requirement for Intel 32-bits, like HLSDK

This commit is contained in:
Alibek Omarov 2023-05-24 04:19:08 +03:00
parent ef4bc2acf2
commit dee5cae5f3
1 changed files with 7 additions and 0 deletions

View File

@ -178,6 +178,13 @@ def get_optimization_flags(conf):
# remove fvisibility to allow everything to be exported by default
cflags.remove('-fvisibility=hidden')
if conf.env.COMPILER_CC != 'msvc' and conf.env.COMPILER_CC != 'owcc':
# HLSDK by default compiles with these options under Linux
# no reason for us to not do the same
if conf.env.DEST_CPU == 'x86':
cflags.append('-march=pentium-m')
cflags.append('-mtune=core2')
# on all compilers (except MSVC?) we need to copy CFLAGS to LINKFLAGS
if conf.options.LTO and conf.env.COMPILER_CC != 'msvc':
linkflags += cflags