scripts: waifulib: compiler_optimizations: fixes for LTO
This commit is contained in:
parent
d0127e5e14
commit
c54e1625d1
1 changed files with 6 additions and 2 deletions
|
@ -99,13 +99,13 @@ CFLAGS = {
|
||||||
|
|
||||||
LTO_CFLAGS = {
|
LTO_CFLAGS = {
|
||||||
'msvc': ['/GL'],
|
'msvc': ['/GL'],
|
||||||
'gcc': ['-flto'],
|
'gcc': ['-flto=auto'],
|
||||||
'clang': ['-flto']
|
'clang': ['-flto']
|
||||||
}
|
}
|
||||||
|
|
||||||
LTO_LINKFLAGS = {
|
LTO_LINKFLAGS = {
|
||||||
'msvc': ['/LTCG'],
|
'msvc': ['/LTCG'],
|
||||||
'gcc': ['-flto'],
|
'gcc': ['-flto=auto'],
|
||||||
'clang': ['-flto']
|
'clang': ['-flto']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,4 +177,8 @@ def get_optimization_flags(conf):
|
||||||
# remove fvisibility to allow everything to be exported by default
|
# remove fvisibility to allow everything to be exported by default
|
||||||
cflags.remove('-fvisibility=hidden')
|
cflags.remove('-fvisibility=hidden')
|
||||||
|
|
||||||
|
# on all compilers (except MSVC?) we need to copy CFLAGS to LINKFLAGS
|
||||||
|
if conf.options.LTO and conf.env.COMPILER_CC != 'msvc':
|
||||||
|
linkflags += cflags
|
||||||
|
|
||||||
return cflags, linkflags
|
return cflags, linkflags
|
||||||
|
|
Loading…
Add table
Reference in a new issue