From 42382807eb601c8fce6dd0e42fa41ba659ef7fb0 Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Fri, 12 Apr 2024 07:38:16 +0200 Subject: [PATCH 1/2] gh-117752: Autoconf: silence some clang warnings for PGO builds * -Wno-profile-instr-unprofiled for source files without profile data * -Wno-profile-instr-out-of-date for _bootstrap_python.c --- configure | 4 ++-- configure.ac | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/configure b/configure index f9647566636e4c..5b03c96cc62a74 100755 --- a/configure +++ b/configure @@ -8826,7 +8826,7 @@ case "$CC_BASENAME" in *clang*) # Any changes made here should be reflected in the GCC+Darwin case below PGO_PROF_GEN_FLAG="-fprofile-instr-generate" - PGO_PROF_USE_FLAG="-fprofile-instr-use=code.profclangd" + PGO_PROF_USE_FLAG=" -fprofile-instr-use=code.profclangd -Wno-profile-instr-unprofiled -Wno-profile-instr-out-of-date " LLVM_PROF_MERGER="${LLVM_PROFDATA} merge -output=code.profclangd *.profclangr" LLVM_PROF_FILE="LLVM_PROFILE_FILE=\"code-%p.profclangr\"" if test $LLVM_PROF_FOUND = not-found @@ -8842,7 +8842,7 @@ case "$CC_BASENAME" in case $ac_sys_system in Darwin*) PGO_PROF_GEN_FLAG="-fprofile-instr-generate" - PGO_PROF_USE_FLAG="-fprofile-instr-use=code.profclangd" + PGO_PROF_USE_FLAG=" -fprofile-instr-use=code.profclangd -Wno-profile-instr-unprofiled -Wno-profile-instr-out-of-date " LLVM_PROF_MERGER="${LLVM_PROFDATA} merge -output=code.profclangd *.profclangr" LLVM_PROF_FILE="LLVM_PROFILE_FILE=\"code-%p.profclangr\"" if test "${LLVM_PROF_FOUND}" = "not-found" diff --git a/configure.ac b/configure.ac index e195e15b39ed21..76134e76040664 100644 --- a/configure.ac +++ b/configure.ac @@ -2011,7 +2011,11 @@ case "$CC_BASENAME" in *clang*) # Any changes made here should be reflected in the GCC+Darwin case below PGO_PROF_GEN_FLAG="-fprofile-instr-generate" - PGO_PROF_USE_FLAG="-fprofile-instr-use=code.profclangd" + PGO_PROF_USE_FLAG=m4_normalize(" + -fprofile-instr-use=code.profclangd + -Wno-profile-instr-unprofiled + -Wno-profile-instr-out-of-date + ") LLVM_PROF_MERGER="${LLVM_PROFDATA} merge -output=code.profclangd *.profclangr" LLVM_PROF_FILE="LLVM_PROFILE_FILE=\"code-%p.profclangr\"" if test $LLVM_PROF_FOUND = not-found @@ -2027,7 +2031,11 @@ case "$CC_BASENAME" in case $ac_sys_system in Darwin*) PGO_PROF_GEN_FLAG="-fprofile-instr-generate" - PGO_PROF_USE_FLAG="-fprofile-instr-use=code.profclangd" + PGO_PROF_USE_FLAG=m4_normalize(" + -fprofile-instr-use=code.profclangd + -Wno-profile-instr-unprofiled + -Wno-profile-instr-out-of-date + ") LLVM_PROF_MERGER="${LLVM_PROFDATA} merge -output=code.profclangd *.profclangr" LLVM_PROF_FILE="LLVM_PROFILE_FILE=\"code-%p.profclangr\"" if test "${LLVM_PROF_FOUND}" = "not-found" From 40c42f5678bed1e72130794006865212d56ae959 Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Fri, 12 Apr 2024 09:43:29 +0200 Subject: [PATCH 2/2] Don't handle out-of-date profile data in this PR --- configure | 4 ++-- configure.ac | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 29df95819a6300..130020c43e474e 100755 --- a/configure +++ b/configure @@ -8826,7 +8826,7 @@ case "$CC_BASENAME" in *clang*) # Any changes made here should be reflected in the GCC+Darwin case below PGO_PROF_GEN_FLAG="-fprofile-instr-generate" - PGO_PROF_USE_FLAG=" -fprofile-instr-use=code.profclangd -Wno-profile-instr-unprofiled -Wno-profile-instr-out-of-date " + PGO_PROF_USE_FLAG=" -fprofile-instr-use=code.profclangd -Wno-profile-instr-unprofiled " LLVM_PROF_MERGER="${LLVM_PROFDATA} merge -output=code.profclangd *.profclangr" LLVM_PROF_FILE="LLVM_PROFILE_FILE=\"\$(shell pwd)/code-%p.profclangr\"" if test $LLVM_PROF_FOUND = not-found @@ -8842,7 +8842,7 @@ case "$CC_BASENAME" in case $ac_sys_system in Darwin*) PGO_PROF_GEN_FLAG="-fprofile-instr-generate" - PGO_PROF_USE_FLAG=" -fprofile-instr-use=code.profclangd -Wno-profile-instr-unprofiled -Wno-profile-instr-out-of-date " + PGO_PROF_USE_FLAG=" -fprofile-instr-use=code.profclangd -Wno-profile-instr-unprofiled " LLVM_PROF_MERGER="${LLVM_PROFDATA} merge -output=code.profclangd *.profclangr" LLVM_PROF_FILE="LLVM_PROFILE_FILE=\"\$(shell pwd)/code-%p.profclangr\"" if test "${LLVM_PROF_FOUND}" = "not-found" diff --git a/configure.ac b/configure.ac index f35c01e16fa422..7b1a132860f476 100644 --- a/configure.ac +++ b/configure.ac @@ -2014,7 +2014,6 @@ case "$CC_BASENAME" in PGO_PROF_USE_FLAG=m4_normalize(" -fprofile-instr-use=code.profclangd -Wno-profile-instr-unprofiled - -Wno-profile-instr-out-of-date ") LLVM_PROF_MERGER="${LLVM_PROFDATA} merge -output=code.profclangd *.profclangr" LLVM_PROF_FILE="LLVM_PROFILE_FILE=\"\$(shell pwd)/code-%p.profclangr\"" @@ -2034,7 +2033,6 @@ case "$CC_BASENAME" in PGO_PROF_USE_FLAG=m4_normalize(" -fprofile-instr-use=code.profclangd -Wno-profile-instr-unprofiled - -Wno-profile-instr-out-of-date ") LLVM_PROF_MERGER="${LLVM_PROFDATA} merge -output=code.profclangd *.profclangr" LLVM_PROF_FILE="LLVM_PROFILE_FILE=\"\$(shell pwd)/code-%p.profclangr\""