[PATCH] x86-64: Compile gmon tests with -mfentry [BZ #33121]
Sam James
sam@gentoo.org
Thu Jul 3 04:12:21 GMT 2025
"H.J. Lu" <hjl.tools@gmail.com> writes:
> When glibc was configured with --enable-stack-protector=all and built
> with GCC 16, I got:
>
> FAIL: gmon/tst-gmon-gprof
> FAIL: gmon/tst-gmon-pie-gprof
> FAIL: gmon/tst-gmon-static-gprof
> FAIL: gmon/tst-gmon-static-pie-gprof
>
> [hjl@gnu-tgl-3 build-x86_64-linux]$ cat gmon/tst-gmon-gprof.out
> --- expected
> +++ actual
> @@ -1,3 +1,2 @@
> f1 2000
> f2 1000
> -f3 1
> FAIL
> [hjl@gnu-tgl-3 build-x86_64-linux]$
>
> This is because -pg doesn't work with separate shrink wrapping in GCC 16:
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120881
>
> Compile gmon tests with -mfentry to call __fentry__ before the prologue.
> This fixes BZ #33121.
>
> OK for master?
Should we wait for a decision on the GCC side, and then if we add the
configure option there, we can add a note in glibc NEWS that we
recommend building GCC with --enable-default-XXX?
If someone will object there for something we're missing, we may have to
go with the original _mcount.S change.
But the change looks fine once that is resolved.
More information about the Libc-alpha
mailing list