]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
math: Fix i386 and m68k fmod/fmodf on static build (BZ 31488)
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 14 Mar 2024 17:59:35 +0000 (14:59 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 21 May 2024 16:43:39 +0000 (13:43 -0300)
The commit 16439f419b removed the static fmod/fmodf on i386 and m68k
with and empty w_fmod.c (required for the ABIs that uses the newly
implementation).  This patch fixes by adding the required symbols on
the arch-specific w_fmod{f}_compat.c implementation.

To statically build fmod fails on some ABI (alpha, s390, sparc) because
it does not export the ldexpf128, this is also fixed by this patch.

Checked on i686-linux-gnu and with a build for m68k-linux-gnu.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Tested-by: Aurelien Jarno <aurelien@aurel32.net>
sysdeps/i386/fpu/w_fmod_compat.c
sysdeps/i386/fpu/w_fmodf_compat.c
sysdeps/ieee754/ldbl-opt/s_ldexpl.c
sysdeps/m68k/m680x0/fpu/w_fmod_compat.c
sysdeps/m68k/m680x0/fpu/w_fmodf_compat.c

index 5ac9995ffd862a7fc7674cbf2f6529fa6f7921af..528bfc2a135b5251a91df759aec9bb5c2a817e03 100644 (file)
@@ -7,8 +7,9 @@
 # define LIBM_SVID_COMPAT 1
 # undef compat_symbol
 # define compat_symbol(a, b, c, d)
-#endif
-#include <math/w_fmod_compat.c>
-#ifdef SHARED
+# include <math/w_fmod_compat.c>
 libm_alias_double (__fmod_compat, fmod)
+#else
+#include <math-type-macros-double.h>
+#include <w_fmod_template.c>
 #endif
index cc417e07d39b271d83aaeb0f6e92836d2efecdfb..5a61693e51f98f8fe1fb4a1f8fa5fbcee9df333a 100644 (file)
@@ -7,8 +7,9 @@
 # define LIBM_SVID_COMPAT 1
 # undef compat_symbol
 # define compat_symbol(a, b, c, d)
-#endif
-#include <math/w_fmodf_compat.c>
-#ifdef SHARED
+# include <math/w_fmodf_compat.c>
 libm_alias_float (__fmod_compat, fmod)
+#else
+#include <math-type-macros-float.h>
+#include <w_fmod_template.c>
 #endif
index 1afbe7d8adbb00ae0dc1db004041a40a4f3a3d76..932cc4341c53dec37fc1a70521ef82da34b70f65 100644 (file)
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#if IS_IN (libc)
+#if IS_IN (libc) && defined SHARED
 # define declare_mgen_alias(f,t)
 #endif
 #include <math-type-macros-ldouble.h>
 #include <s_ldexp_template.c>
 
-#if IS_IN (libc)
+#if IS_IN (libc) && defined SHARED
 long_double_symbol (libc, __ldexpl, ldexpl);
 long_double_symbol (libc, __wrap_scalbnl, scalbnl);
 #endif
index 527d4fbed201d4b4383beda7567245364b169ca6..57f38091e67248487939b949b7a5364eaf4d65bc 100644 (file)
@@ -7,8 +7,9 @@
 # define LIBM_SVID_COMPAT 1
 # undef compat_symbol
 # define compat_symbol(a, b, c, d)
-#endif
 #include <math/w_fmod_compat.c>
-#ifdef SHARED
 libm_alias_double (__fmod_compat, fmod)
+#else
+#include <math-type-macros-double.h>
+#include <w_fmod_template.c>
 #endif
index 5043586b910e765f4db51e2eddd1180c2dd28000..88db07f443b0c3394f9ea5ddae20895fc94e671c 100644 (file)
@@ -7,8 +7,9 @@
 # define LIBM_SVID_COMPAT 1
 # undef compat_symbol
 # define compat_symbol(a, b, c, d)
-#endif
-#include <math/w_fmodf_compat.c>
-#ifdef SHARED
+# include <math/w_fmodf_compat.c>
 libm_alias_float (__fmod_compat, fmod)
+#else
+#include <math-type-macros-float.h>
+#include <w_fmod_template.c>
 #endif