From 4b54050abec63c2af11299334993ef9c368a4f39 Mon Sep 17 00:00:00 2001 From: Arni Dagur Date: Wed, 1 Jul 2026 01:00:31 +0100 Subject: [PATCH] Use $host_os for --enable-prof-frameptr availability Gate the frame-pointer profiling backtrace option on the canonical host OS (AC_CANONICAL_HOST) instead of `uname -s`. The latter reflects only the build machine, so cross-compiling for Linux from a non-Linux host (for example Darwin -> x86_64-unknown-linux-gnu) silently ignored --enable-prof-frameptr and fell back to another backtrace method. The frame-pointer unwinder remains Linux-target-only; only the detection of "are we configuring for Linux?" changes. --- configure.ac | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index e57d0667..e210d16c 100644 --- a/configure.ac +++ b/configure.ac @@ -1511,8 +1511,8 @@ if test "x$backtrace_method" = "x" -a "x$enable_prof_libunwind" = "x1" ; then fi fi -if test `uname -s` = "Linux" -then +case "${host_os}" in + linux*) AC_ARG_ENABLE([prof-frameptr], [AS_HELP_STRING([--enable-prof-frameptr], [Use optimized frame pointer unwinder for backtracing (Linux only)])], [if test "x$enable_prof_frameptr" = "xno" ; then @@ -1534,9 +1534,11 @@ then else enable_prof_frameptr="0" fi -else + ;; + *) enable_prof_frameptr="0" -fi + ;; +esac AC_ARG_ENABLE([prof-libgcc], [AS_HELP_STRING([--disable-prof-libgcc],