gprof: Compile tst-gmon.c with -O2 -fno-omit-frame-pointer

Compile tst-gmon.c with -O2 -fno-omit-frame-pointer to ensure proper call
graph generation.

	PR gprof/32768
	* configure.ac: Compile tst-gmon.c with -fno-omit-frame-pointer.
	* configure: Regenerated.
	* testsuite/Makefile.am (GPROF_FLAGS): Add -O2
	-fno-omit-frame-pointer.
	(AM_CFLAGS): Removed.
	(COMPILE): Append $(GPROF_FLAGS).
	(LINK): Likewise.
	* testsuite/Makefile.in: Regenerated.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
This commit is contained in:
H.J. Lu
2025-03-08 17:13:17 +08:00
parent 4f0636220e
commit 1563d43f32
4 changed files with 14 additions and 12 deletions

2
gprof/configure vendored
View File

@@ -13972,7 +13972,7 @@ if ${gprof_cv_sys_native+:} false; then :
else
gprof_cv_sys_native=no
if test x"${host}" = x"${target}" \
&& ${CC-cc} -O2 -pg -o tst-gmon $srcdir/testsuite/tst-gmon.c; then
&& ${CC-cc} -O2 -fno-omit-frame-pointer -pg -o tst-gmon $srcdir/testsuite/tst-gmon.c; then
rm -f gmon.out
./tst-gmon
if test -s gmon.out; then