Merge branch 'cconfig-flagstolinker' into 'master'

c_config: -flto and -fno-lto need to be passed also when linking

See merge request ita1024/waf!2281
This commit is contained in:
Federico Pellegrin 2020-03-19 08:05:23 +00:00
commit f74beeff84
1 changed files with 1 additions and 1 deletions

View File

@ -150,7 +150,7 @@ def parse_flags(self, line, uselib_store, env=None, force_static=False, posix=No
elif x.startswith('-std='):
prefix = 'CXXFLAGS' if '++' in x else 'CFLAGS'
app(prefix, x)
elif x.startswith('+') or x in ('-pthread', '-fPIC', '-fpic', '-fPIE', '-fpie'):
elif x.startswith('+') or x in ('-pthread', '-fPIC', '-fpic', '-fPIE', '-fpie', '-flto', '-fno-lto'):
app('CFLAGS', x)
app('CXXFLAGS', x)
app('LINKFLAGS', x)