[PATCH] x86-64: Compile ISA versions of modf/modff with -fno-stack-protector

Andreas K. Huettel dilfridge@gentoo.org
Thu Jul 17 12:41:29 GMT 2025


Am Donnerstag, 17. Juli 2025, 04:48:12 Mitteleuropäische Sommerzeit schrieb H.J. Lu:
> Since modf and modff are compiled into both libc and libm, when glibc is
> configured with --enable-stack-protector=all, ISA versions of modf and
> modff should be compiled with -fno-stack-protector to avoid calling
> __stack_chk_fail via PLT in libc.so.
> 
> This fixes BZ #33165.
> 

OK

> Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
> ---
>  sysdeps/x86_64/fpu/multiarch/Makefile | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/sysdeps/x86_64/fpu/multiarch/Makefile b/sysdeps/x86_64/fpu/multiarch/Makefile
> index 5fe872b898..81a870d3b1 100644
> --- a/sysdeps/x86_64/fpu/multiarch/Makefile
> +++ b/sysdeps/x86_64/fpu/multiarch/Makefile
> @@ -159,11 +159,18 @@ CFLAGS-s_sin-avx.c = -msse2avx -DSSE2AVX
>  CFLAGS-s_tan-avx.c = -msse2avx -DSSE2AVX
>  CFLAGS-s_sincos-avx.c = -msse2avx -DSSE2AVX
>  
> -CFLAGS-s_modf-sse4_1.c = -msse4.1 -fno-builtin-modff32x -fno-builtin-modff64
> -CFLAGS-s_modff-sse4_1.c = -msse4.1 -fno-builtin-modff32
> +CFLAGS-s_modf-c.c = $(no-stack-protector)
> +CFLAGS-s_modff-c.c = $(no-stack-protector)
>  
> -CFLAGS-s_modf-avx.c = -msse2avx -DSSE2AVX -fno-builtin-modff32x -fno-builtin-modff64
> -CFLAGS-s_modff-avx.c = -msse2avx -DSSE2AVX -fno-builtin-modff32
> +CFLAGS-s_modf-sse4_1.c = -msse4.1 -fno-builtin-modff32x \
> +			 -fno-builtin-modff64 $(no-stack-protector)
> +CFLAGS-s_modff-sse4_1.c = -msse4.1 -fno-builtin-modff32 \
> +			  $(no-stack-protector)
> +
> +CFLAGS-s_modf-avx.c = -msse2avx -DSSE2AVX -fno-builtin-modff32x \
> +		      $(no-stack-protector) -fno-builtin-modff64
> +CFLAGS-s_modff-avx.c = -msse2avx -DSSE2AVX -fno-builtin-modff32 \
> +		      $(no-stack-protector)
>  endif
>  
>  ifeq ($(subdir),mathvec)
> 


-- 
Andreas K. Hüttel
dilfridge@gentoo.org
Gentoo Linux developer
(council, toolchain, base-system, perl, libreoffice)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 981 bytes
Desc: This is a digitally signed message part.
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20250717/3d6f8873/attachment.sig>


More information about the Libc-alpha mailing list