From e4da09b8f9ea1bd66d24e16dc68469148eee9716 Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Sun, 28 Oct 2018 15:59:03 +0000 Subject: get_base_compile_args: Add -fprofile-correction to -fprofile-use This allows using the imperfect profiles generated by multithreaded programs. Without the argument, GCC fails to load them. Clang just ignores the argument AFAICT. Fixes https://github.com/mesonbuild/meson/issues/2159 --- mesonbuild/compilers/compilers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 458a416..68fbbfa 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -429,7 +429,7 @@ def get_base_compile_args(options, compiler): if pgo_val == 'generate': args.append('-fprofile-generate') elif pgo_val == 'use': - args.append('-fprofile-use') + args.extend(['-fprofile-use', '-fprofile-correction']) except KeyError: pass try: @@ -475,7 +475,7 @@ def get_base_link_args(options, linker, is_shared_module): if pgo_val == 'generate': args.append('-fprofile-generate') elif pgo_val == 'use': - args.append('-fprofile-use') + args.extend(['-fprofile-use', '-fprofile-correction']) except KeyError: pass try: -- cgit v1.1