From 573591915d41333bcaa1cab868afbf707e749f82 Mon Sep 17 00:00:00 2001 From: Shamil Abdulaev Date: Tue, 21 Apr 2026 16:42:01 +0300 Subject: [PATCH 1/3] Use -icf=safe in BOLT_APPLY_FLAGS --- configure | 2 +- configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 49319bc2aa4459..0892f990b3c004 100755 --- a/configure +++ b/configure @@ -9585,7 +9585,7 @@ 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=1 -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 " + BOLT_APPLY_FLAGS=" ${BOLT_COMMON_FLAGS} -reorder-blocks=ext-tsp -reorder-functions=cdsort -split-functions -icf=safe -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 " fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $BOLT_APPLY_FLAGS" >&5 diff --git a/configure.ac b/configure.ac index 7b6f3c5e0ed5be..1b6b9107a87e7e 100644 --- a/configure.ac +++ b/configure.ac @@ -2255,7 +2255,7 @@ then -reorder-blocks=ext-tsp -reorder-functions=cdsort -split-functions - -icf=1 + -icf=safe -inline-all -split-eh -reorder-functions-use-hot-size From 5c89a9ae2ae34f45d95bae1d9a7d61f5a3b85323 Mon Sep 17 00:00:00 2001 From: Shamil Abdulaev Date: Tue, 21 Apr 2026 17:28:02 +0300 Subject: [PATCH 2/3] Add blurb --- .../next/Build/2026-04-21-17-27-52.gh-issue-148832.Kx9aQ1.rst | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 Misc/NEWS.d/next/Build/2026-04-21-17-27-52.gh-issue-148832.Kx9aQ1.rst diff --git a/Misc/NEWS.d/next/Build/2026-04-21-17-27-52.gh-issue-148832.Kx9aQ1.rst b/Misc/NEWS.d/next/Build/2026-04-21-17-27-52.gh-issue-148832.Kx9aQ1.rst new file mode 100644 index 00000000000000..9f55ac6c24eb43 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2026-04-21-17-27-52.gh-issue-148832.Kx9aQ1.rst @@ -0,0 +1,4 @@ +Fix :option:`--enable-bolt` build by switching the default BOLT flag from +``-icf=1`` to ``-icf=safe``. ``-icf=1`` folds address-taken functions and +breaks type-slot dispatch, crashing on :mod:`list` and :mod:`tuple` +concatenation. Patched by Shamil Abdulaev. From 0b0404a2c96e5ec0bec1391f37d5142107be7115 Mon Sep 17 00:00:00 2001 From: Shamil Abdulaev Date: Tue, 21 Apr 2026 17:54:26 +0300 Subject: [PATCH 3/3] Use -icf=0 for older BOLT compatibility --- .../next/Build/2026-04-21-17-27-52.gh-issue-148832.Kx9aQ1.rst | 2 +- configure | 2 +- configure.ac | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Misc/NEWS.d/next/Build/2026-04-21-17-27-52.gh-issue-148832.Kx9aQ1.rst b/Misc/NEWS.d/next/Build/2026-04-21-17-27-52.gh-issue-148832.Kx9aQ1.rst index 9f55ac6c24eb43..867cfcc5ab62ca 100644 --- a/Misc/NEWS.d/next/Build/2026-04-21-17-27-52.gh-issue-148832.Kx9aQ1.rst +++ b/Misc/NEWS.d/next/Build/2026-04-21-17-27-52.gh-issue-148832.Kx9aQ1.rst @@ -1,4 +1,4 @@ Fix :option:`--enable-bolt` build by switching the default BOLT flag from -``-icf=1`` to ``-icf=safe``. ``-icf=1`` folds address-taken functions and +``-icf=1`` to ``-icf=0``. ``-icf=1`` folds address-taken functions and breaks type-slot dispatch, crashing on :mod:`list` and :mod:`tuple` concatenation. Patched by Shamil Abdulaev. diff --git a/configure b/configure index 0892f990b3c004..1914c84f469049 100755 --- a/configure +++ b/configure @@ -9585,7 +9585,7 @@ 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=safe -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 " + 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 " fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $BOLT_APPLY_FLAGS" >&5 diff --git a/configure.ac b/configure.ac index 1b6b9107a87e7e..0a4e4f09e07ca5 100644 --- a/configure.ac +++ b/configure.ac @@ -2255,7 +2255,7 @@ then -reorder-blocks=ext-tsp -reorder-functions=cdsort -split-functions - -icf=safe + -icf=0 -inline-all -split-eh -reorder-functions-use-hot-size