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

This commit is contained in:
Federico Pellegrin 2020-03-19 09:01:34 +01:00 committed by Thomas Nagy
parent 4f8099fbdc
commit 0c616901b4
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)