aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Elliott <luke.b.elliott@gmail.com>2023-02-12 15:06:55 +0000
committerEli Schwartz <eschwartz93@gmail.com>2023-02-17 09:34:32 -0500
commit8fdb8b01ad009cb3e9621b033f2f16e6f5203a68 (patch)
tree540f6e962cc15cc65147388ad05d753a302ac859
parent946b66eddc512d775145eb86ce6866aff3d1dd68 (diff)
downloadmeson-8fdb8b01ad009cb3e9621b033f2f16e6f5203a68.zip
meson-8fdb8b01ad009cb3e9621b033f2f16e6f5203a68.tar.gz
meson-8fdb8b01ad009cb3e9621b033f2f16e6f5203a68.tar.bz2
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]
-rw-r--r--mesonbuild/compilers/mixins/gnu.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/mesonbuild/compilers/mixins/gnu.py b/mesonbuild/compilers/mixins/gnu.py
index 2f7de25..022e7fd 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']