- ``-marm`` and/or ``-mno-thumb`` is added on 32-bit ARM when supported,
- on s390x platforms, when supported, ``-mbackchain`` is added *instead*.
of the above frame pointer flags.
+ - on ppc64le platforms, no compiler flags is needed since the power ABI
+ requires that compilers maintain a back chain by default.
Frame pointers enable profilers, debuggers, and system tracing tools
(``perf``, ``eBPF``, ``dtrace``, ``gdb``) to walk the C call stack
if sys.maxsize < 2**32:
return None
return True
+ if machine == "ppc64le":
+ # The power ABI specification requires that compilers maintain a
+ # back chain by default, so unwinding already works without a
+ # dedicated frame pointer.
+ # https://openpowerfoundation.org/specifications/64bitelfabi/
+ return True
if machine == "x86_64":
final_opt = ""
for opt in cflags.split():
;; #(
*) :
;;
+esac
+ case $host_cpu in #(
+ powerpc64le) :
+
+ frame_pointer_cflags=""
+ ;; #(
+ *) :
+ ;;
esac
case $host_cpu in #(
s390*) :
frame_pointer_cflags="$frame_pointer_cflags -mno-thumb"
], [], [-Werror])
])
+ AS_CASE([$host_cpu], [powerpc64le], [
+ frame_pointer_cflags=""
+ ])
AS_CASE([$host_cpu], [s390*], [
AX_CHECK_COMPILE_FLAG([-mbackchain], [
dnl Do not use no-omit-frame-pointer; see gh-149362