[PATCH] arm: Prevent GCC from using VFP registers in code used during dynamic linking

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Mon May 11 13:54:21 GMT 2026



On 10/05/26 19:00, Aurelien Jarno wrote:
> Starting with GCC 15, VFP registers are used more aggressively on ARM,
> including in ld.so code involved in runtime linking. For instance d7 is
> used in _dl_lookup_symbol_, which clobbers the 8th floating point
> argument of a function on its first call.

We added the --with-rtld-early-cflags configure option for avoid such issue,
couldn't this be used instead of specific flags to specific objects?

> ---
>  sysdeps/arm/Makefile | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> This has been found by debugging the erfa testsuite failure on
> debian/armhf:
> https://buildd.debian.org/status/fetch.php?pkg=erfa&arch=armhf&ver=2.0.1-3&stamp=1778424772&raw=0
> 
> diff --git a/sysdeps/arm/Makefile b/sysdeps/arm/Makefile
> index d08dade3c5..d66ea902cb 100644
> --- a/sysdeps/arm/Makefile
> +++ b/sysdeps/arm/Makefile
> @@ -2,6 +2,11 @@ gnulib-arch = $(elf-objpfx)libgcc-stubs.a
>  static-gnulib-arch = $(elf-objpfx)libgcc-stubs.a
>  
>  ifeq ($(subdir),elf)
> +# Prevent GCC from using VFP register in code used during dynamic linking.
> +CFLAGS-dl-lookup.os = -mgeneral-regs-only
> +CFLAGS-dl-misc.os = -mgeneral-regs-only
> +CFLAGS-dl-runtime.os = -mgeneral-regs-only
> +
>  sysdep-dl-routines += tlsdesc dl-tlsdesc
>  sysdep_routines += aeabi_unwind_cpp_pr1 find_exidx
>  sysdep-rtld-routines += aeabi_unwind_cpp_pr1



More information about the Libc-alpha mailing list