diff --git a/Misc/NEWS.d/next/Build/2026-10-21-14-52-56.gh-issue-128884.Xs5jK-.rst b/Misc/NEWS.d/next/Build/2026-10-21-14-52-56.gh-issue-128884.Xs5jK-.rst new file mode 100644 index 00000000000000..53233d06c5053a --- /dev/null +++ b/Misc/NEWS.d/next/Build/2026-10-21-14-52-56.gh-issue-128884.Xs5jK-.rst @@ -0,0 +1,2 @@ +Fix ``--enable-bolt`` build failures on AArch64 with recent LLVM: pass +``-frame-opt=hot`` only on x86. Patch by Donghee Na. diff --git a/configure b/configure index 38fd8575530e8a..a0682ff03422e1 100755 --- a/configure +++ b/configure @@ -9780,7 +9780,14 @@ printf "%s\n" "$BOLT_INSTRUMENT_FLAGS" >&6; } printf %s "checking BOLT_APPLY_FLAGS... " >&6; } if test -z "${BOLT_APPLY_FLAGS}" then - BOLT_APPLY_FLAGS=" ${BOLT_COMMON_FLAGS} -reorder-blocks=ext-tsp -reorder-functions=cdsort -split-functions -icf=0 -inline-all -split-eh -reorder-functions-use-hot-size -peepholes=none -jump-tables=aggressive -inline-ap -indirect-call-promotion=all -dyno-stats -use-gnu-stack -frame-opt=hot " + case $host_cpu in #( + x86_64) : + bolt_frame_opt_flags="-frame-opt=hot" ;; #( + *) : + bolt_frame_opt_flags="" + ;; +esac + BOLT_APPLY_FLAGS=" ${BOLT_COMMON_FLAGS} -reorder-blocks=ext-tsp -reorder-functions=cdsort -split-functions -icf=0 -inline-all -split-eh -reorder-functions-use-hot-size -peepholes=none -jump-tables=aggressive -inline-ap -indirect-call-promotion=all -dyno-stats -use-gnu-stack ${bolt_frame_opt_flags} " fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $BOLT_APPLY_FLAGS" >&5 diff --git a/configure.ac b/configure.ac index 777ced94454594..90eae31482d2e7 100644 --- a/configure.ac +++ b/configure.ac @@ -2288,6 +2288,12 @@ AC_ARG_VAR( AC_MSG_CHECKING([BOLT_APPLY_FLAGS]) if test -z "${BOLT_APPLY_FLAGS}" then + dnl The frame optimizer is only implemented for x86. BOLT 22 and newer + dnl refuse to run it on other architectures. + AS_CASE([$host_cpu], + [x86_64], [bolt_frame_opt_flags="-frame-opt=hot"], + [bolt_frame_opt_flags=""] + ) AS_VAR_SET( [BOLT_APPLY_FLAGS], [m4_normalize(" @@ -2305,7 +2311,7 @@ then -indirect-call-promotion=all -dyno-stats -use-gnu-stack - -frame-opt=hot + ${bolt_frame_opt_flags} ")] ) fi