From 8fdb8b01ad009cb3e9621b033f2f16e6f5203a68 Mon Sep 17 00:00:00 2001 From: Luke Elliott Date: Sun, 12 Feb 2023 15:06:55 +0000 Subject: [PATCH] compilers: -fprofile-correction is only a valid switch with gcc itself. clang++ main.cpp -fprofile-correction clang-15: warning: optimization flag '-fprofile-correction' is not supported [-Wignored-optimization-argument] --- mesonbuild/compilers/mixins/gnu.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mesonbuild/compilers/mixins/gnu.py b/mesonbuild/compilers/mixins/gnu.py index 2f7de254f..022e7fda0 100644 --- a/mesonbuild/compilers/mixins/gnu.py +++ b/mesonbuild/compilers/mixins/gnu.py @@ -445,7 +445,7 @@ class GnuLikeCompiler(Compiler, metaclass=abc.ABCMeta): return ['-fprofile-generate'] def get_profile_use_args(self) -> T.List[str]: - return ['-fprofile-use', '-fprofile-correction'] + return ['-fprofile-use'] def get_gui_app_args(self, value: bool) -> T.List[str]: return ['-mwindows' if value else '-mconsole'] @@ -644,3 +644,6 @@ class GnuCompiler(GnuLikeCompiler): if linker == 'mold' and mesonlib.version_compare(version, '>=12.0.1'): return ['-fuse-ld=mold'] return super().use_linker_args(linker, version) + + def get_profile_use_args(self) -> T.List[str]: + return super().get_profile_use_args() + ['-fprofile-correction']