Skip to content

Commit dfb0a1a

Browse files
committed
gh-145801: Use gcc -fprofile-update=atomic for PGO builds
When Python build is optimized by PGO, use GCC -fprofile-update=atomic option to use atomic operations when updating profile information. This option reduces the risk of gcov Data Files (.gcda) corruption which can cause random GCC crashes.
1 parent cf7c67b commit dfb0a1a

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
When Python build is optimized by PGO, use GCC ``-fprofile-update=atomic``
2+
option to use atomic operations when updating profile information. This option
3+
reduces the risk of gcov Data Files (.gcda) corruption which can cause random
4+
GCC crashes. Patch by Victor Stinner.

configure

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2084,7 +2084,7 @@ case "$ac_cv_cc_name" in
20842084
fi
20852085
;;
20862086
gcc)
2087-
PGO_PROF_GEN_FLAG="-fprofile-generate"
2087+
PGO_PROF_GEN_FLAG="-fprofile-generate -fprofile-update=atomic"
20882088
PGO_PROF_USE_FLAG="-fprofile-use -fprofile-correction"
20892089
LLVM_PROF_MERGER="true"
20902090
LLVM_PROF_FILE=""

0 commit comments

Comments
 (0)