glibc-2.44 math/test-float32x-tanh math/test-float64-tanh failing

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Thu Jul 30 00:35:41 GMT 2026



On 29/07/26 19:26, Michael Brunnbauer wrote:
> 
> hi,
> 
> On Wed, Jul 29, 2026 at 06:29:27PM +0200, Michael Brunnbauer wrote:
>> BTW what's the proper way to run these tests manually? I noticed they link
>> to globally installed glibc components. There is a testrun.sh script...

It depends of how you built glibc. For default configuration, tests are not
built with RPATH so you need to use testrun.sh (which issues the binaries
using the built glibc). For the math tests you can also just issue:

  $ elf/ld.so --library-path .:math <test>

We have the configure option --enable-hardcoded-path-in-tests that build
all tests with -Wl,-dynamic-loader=... and -Wl,-rpath,... so there is no
need to use testrun.sh.

> 
> This seems to be what actually happens during make check of glibc-2.44:
> 
>  ./testrun.sh ./math/test-float32x-tanh
>  testing _Float32x (without inline functions)
>  Illegal instruction
> 
>  echo $?
>  132
> 
> I'm running the test on the machine that compiled glibc and the rest of the
> toolchain. So does stuff get pulled in that is not supported by my CPU? This
> is not supposed to happen, right? Should I try --disable-mathvec?

Now it makes more sense and it seems that my tanh ifunc fix (ebb12ffa3e895487)
was incomplete because it did not handled _FloatXX alias.  Could you check
whether the following fix it? I will fix it tomorrow and backport to 2.44.

diff --git a/sysdeps/ieee754/dbl-64/s_tanh.c b/sysdeps/ieee754/dbl-64/s_tanh.c
index 2029de8fa5e..ef80b9edb63 100644
--- a/sysdeps/ieee754/dbl-64/s_tanh.c
+++ b/sysdeps/ieee754/dbl-64/s_tanh.c
@@ -283,4 +283,6 @@ __tanh (double x)
     return as_tanh_database (x, res);
   return res;
 }
+#ifndef __tanh
 libm_alias_double (__tanh, tanh)
+#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/s_tanh-fma.c b/sysdeps/x86_64/fpu/multiarch/s_tanh-fma.c
index 1b808b1227f..1e6b33740aa 100644
--- a/sysdeps/x86_64/fpu/multiarch/s_tanh-fma.c
+++ b/sysdeps/x86_64/fpu/multiarch/s_tanh-fma.c
@@ -1,10 +1,4 @@
 #define __tanh __tanh_fma
-#define __expm1 __expm1_fma
-
-/* NB: __expm1 may be expanded to __expm1_fma in the following
-   prototypes.  */
-extern long double __expm1l (long double);
-extern long double __expm1f128 (long double);

 #define SECTION __attribute__ ((section (".text.fma")))

diff --git a/sysdeps/x86_64/fpu/multiarch/s_tanh.c b/sysdeps/x86_64/fpu/multiarch/s_tanh.c
index ec8826f6343..9048c977c1a 100644
--- a/sysdeps/x86_64/fpu/multiarch/s_tanh.c
+++ b/sysdeps/x86_64/fpu/multiarch/s_tanh.c
@@ -25,10 +25,9 @@ extern double __redirect_tanh (double);
 # define SYMBOL_NAME tanh
 # include "ifunc-fma.h"

-libc_ifunc_redirected (__redirect_tanh, tanh, IFUNC_SELECTOR ());
+libc_ifunc_redirected (__redirect_tanh, __tanh, IFUNC_SELECTOR ());
+libm_alias_double (__tanh, tanh)

 # define __tanh __tanh_sse2
-# undef libm_alias_double
-# define libm_alias_double(a, b)
 #endif
 #include <sysdeps/ieee754/dbl-64/s_tanh.c>



More information about the Libc-help mailing list