Skip to content

Commit 41ee2c9

Browse files
committed
gh-101060: conditionally add -fno-reorder-blocks-and-partition
The flag isn't implemented on Clang. So we need this so we can enable BOLT on Clang.
1 parent 0502b8c commit 41ee2c9

File tree

3 files changed

+49
-2
lines changed

3 files changed

+49
-2
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Conditionally add ``-fno-reorder-blocks-and-partition`` in configure.
2+
Effectively fixes ``--enable-bolt`` when using Clang, as this appears to be
3+
a GCC-only flag.

configure

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

configure.ac

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2015,8 +2015,13 @@ if test "$Py_BOLT" = 'true' ; then
20152015
DEF_MAKE_ALL_RULE="bolt-opt"
20162016
DEF_MAKE_RULE="build_all"
20172017

2018+
# -fno-reorder-blocks-and-partition is required for bolt to work.
2019+
# Possibly GCC only.
2020+
AX_CHECK_COMPILE_FLAG([-fno-reorder-blocks-and-partition],[
2021+
CFLAGS_NODIST="$CFLAGS_NODIST -fno-reorder-blocks-and-partition"
2022+
])
2023+
20182024
# These flags are required for bolt to work:
2019-
CFLAGS_NODIST="$CFLAGS_NODIST -fno-reorder-blocks-and-partition"
20202025
LDFLAGS_NODIST="$LDFLAGS_NODIST -Wl,--emit-relocs"
20212026

20222027
# These flags are required to get good performance from bolt:

0 commit comments

Comments
 (0)