Skip to content

Commit ea140bb

Browse files
committed
gh-149202: Don't use -fno-omit-frame-pointer on ppc64le
The power ABI specification requires that compilers maintain a back chain by default, so unwinding already works without a dedicated frame pointer. Don't use -fno-omit-frame-pointer on ppc64le.
1 parent 612140e commit ea140bb

4 files changed

Lines changed: 19 additions & 0 deletions

File tree

Doc/using/configure.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,8 @@ also be used to improve performance.
792792
- ``-marm`` and/or ``-mno-thumb`` is added on 32-bit ARM when supported,
793793
- on s390x platforms, when supported, ``-mbackchain`` is added *instead*.
794794
of the above frame pointer flags.
795+
- on ppc64le platforms, no compiler flags is needed since the power ABI
796+
requires that compilers maintain a back chain by default.
795797

796798
Frame pointers enable profilers, debuggers, and system tracing tools
797799
(``perf``, ``eBPF``, ``dtrace``, ``gdb``) to walk the C call stack

Lib/test/test_frame_pointer_unwind.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ def _frame_pointers_expected(machine):
5656
if sys.maxsize < 2**32:
5757
return None
5858
return True
59+
if machine == "ppc64le":
60+
# The power ABI specification requires that compilers maintain a
61+
# back chain by default, so unwinding already works without a
62+
# dedicated frame pointer.
63+
# https://openpowerfoundation.org/specifications/64bitelfabi/
64+
return True
5965
if machine == "x86_64":
6066
final_opt = ""
6167
for opt in cflags.split():

configure

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2557,6 +2557,9 @@ AS_VAR_IF([ac_cv_gcc_compat], [yes], [
25572557
frame_pointer_cflags="$frame_pointer_cflags -mno-thumb"
25582558
], [], [-Werror])
25592559
])
2560+
AS_CASE([$host_cpu], [powerpc64le], [
2561+
frame_pointer_cflags=""
2562+
])
25602563
AS_CASE([$host_cpu], [s390*], [
25612564
AX_CHECK_COMPILE_FLAG([-mbackchain], [
25622565
dnl Do not use no-omit-frame-pointer; see gh-149362

0 commit comments

Comments
 (0)