diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2021-02-16 12:01:36 -0800 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2021-02-17 18:06:52 +0200 |
commit | 6c1467db272c4700ae79f74c3541f6ccc4814138 (patch) | |
tree | 4602952f770ad183039983aae59ac99791f175a1 /mesonbuild/compilers/compilers.py | |
parent | 867963f1315023673abbe3cc823eb6d332ed8f86 (diff) | |
download | meson-6c1467db272c4700ae79f74c3541f6ccc4814138.zip meson-6c1467db272c4700ae79f74c3541f6ccc4814138.tar.gz meson-6c1467db272c4700ae79f74c3541f6ccc4814138.tar.bz2 |
compilers: Only insert -flto-jobs in clang's link arguments
Clang has a hand `-Wunused-command-line-argument` switch, which when
turned to an error, gets very grump about `-flto-jobs=0` being set in
the compiler arguments (although `-flto=` belongs there). We'll refactor
a bit to put that only in the link arguments.
GCC doesn't have this probably because, a) it doesn't have an equivalent
warning, and b) it uses `-flto=<$numthreads.
Fixes: #8347
Diffstat (limited to 'mesonbuild/compilers/compilers.py')
-rw-r--r-- | mesonbuild/compilers/compilers.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 8171758..a4823e2 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -375,7 +375,9 @@ def get_base_link_args(options: 'KeyedOptionDictType', linker: 'Compiler', args = [] # type: T.List[str] try: if options[OptionKey('b_lto')].value: - args.extend(linker.get_lto_link_args()) + args.extend(linker.get_lto_link_args( + threads=get_option_value(options, OptionKey('b_lto_threads'), 0), + mode=get_option_value(options, OptionKey('b_lto_mode'), 'default'))) except KeyError: pass try: @@ -950,7 +952,7 @@ class Compiler(metaclass=abc.ABCMeta): def get_lto_compile_args(self, *, threads: int = 0, mode: str = 'default') -> T.List[str]: return [] - def get_lto_link_args(self) -> T.List[str]: + def get_lto_link_args(self, *, threads: int = 0, mode: str = 'default') -> T.List[str]: return self.linker.get_lto_args() def sanitizer_compile_args(self, value: str) -> T.List[str]: |