Compilers: pass -Werror to the linker with b_lto
With LTO, the linker will re-execute the compiler and various warnings may be emitted. We must therefore pass -Werror to the linker as well when -Werror is enabled to capture these. This is only required / useful with LTO. Closes: https://github.com/mesonbuild/meson/issues/7360 Signed-off-by: Sam James <sam@gentoo.org> Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
This commit is contained in:
parent
92f638e1f9
commit
85cfc1fafc
|
@ -324,6 +324,9 @@ def get_base_link_args(options: 'KeyedOptionDictType', linker: 'Compiler',
|
|||
args: T.List[str] = []
|
||||
try:
|
||||
if options[OptionKey('b_lto')].value:
|
||||
if options[OptionKey('werror')].value:
|
||||
args.extend(linker.get_werror_args())
|
||||
|
||||
thinlto_cache_dir = None
|
||||
if get_option_value(options, OptionKey('b_thinlto_cache'), False):
|
||||
thinlto_cache_dir = get_option_value(options, OptionKey('b_thinlto_cache_dir'), '')
|
||||
|
|
Loading…
Reference in New Issue