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.
This commit is contained in:
Arni Dagur 2026-07-01 01:00:31 +01:00
parent 81034ce1f1
commit 4b54050abe

View file

@ -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],