[v3,0/7] Fix some libm static issues 16/311016/1 sandbox/dkson95/2.39 accepted/tizen/base/toolchain/20240513.230938
authorDongkyun Son <dongkyun.s@samsung.com>
Mon, 13 May 2024 04:37:33 +0000 (13:37 +0900)
committerDongkyun Son <dongkyun.s@samsung.com>
Mon, 13 May 2024 04:37:33 +0000 (13:37 +0900)
https://patchwork.sourceware.org/project/glibc/list/?series=32436

  Some recent math optimizations removed some symbols from the static
build and due to the limited static build check, along with
--disable-shared being broken for some time [1], this issue has slipped
some releases.

Although the fix is straightforward, I added an extra framework to
enable static build for  math libraries using the generic type
framework (which autogenerated the tests for all supported types using
the C template files). I have not enabled it for all tests due to the
required extra size constraint, this is done with a new define that
can be used with make check (build-math-static-tests).

As an experiment, I enabled static build for all autogenerated math
tests. This has uncovered some extra missing symbols on some ABIs, along
with some issues with implementation used on static for some ABIs.  On
x86_64/i686 it shows that the assembly optimizations for acos, log10,
log2, and ldbl-96 y0/y1 show some issues:

  x86_64-linux-gnu$ grep ^FAIL math/subdir-tests.sum
  FAIL: math/test-float64x-acos-static
  FAIL: math/test-float64x-log10-static
  FAIL: math/test-float64x-log2-static
  FAIL: math/test-float64x-y0-static
  FAIL: math/test-float64x-y1-static
  FAIL: math/test-ldouble-acos-static
  FAIL: math/test-ldouble-log10-static
  FAIL: math/test-ldouble-log2-static
  FAIL: math/test-ldouble-y0-static
  FAIL: math/test-ldouble-y1-static

  i686-linux-gnu$ grep ^FAIL math/subdir-tests.sum
  FAIL: math/test-double-atanh-static
  FAIL: math/test-float-atanh-static
  FAIL: math/test-float32-atanh-static
  FAIL: math/test-float32x-atanh-static
  FAIL: math/test-float64-atanh-static
  FAIL: math/test-float64x-acos-static
  FAIL: math/test-float64x-acosh-static
  FAIL: math/test-float64x-atanh-static
  FAIL: math/test-float64x-log10-static
  FAIL: math/test-float64x-log2-static
  FAIL: math/test-float64x-y0-static
  FAIL: math/test-float64x-y1-static
  FAIL: math/test-ldouble-acos-static
  FAIL: math/test-ldouble-acosh-static
  FAIL: math/test-ldouble-atanh-static
  FAIL: math/test-ldouble-log10-static
  FAIL: math/test-ldouble-log2-static
  FAIL: math/test-ldouble-y0-static
  FAIL: math/test-ldouble-y1-static

The powerpc64le also shows multiple issues with the static linking
(using gcc 13.1):

  FAIL: math/test-float128-exp10-static
  FAIL: math/test-float64x-exp10-static
  FAIL: math/test-ibm128-acos-static
  FAIL: math/test-ibm128-copysign-static
  FAIL: math/test-ibm128-exp10-static
  FAIL: math/test-ibm128-fmod-static
  FAIL: math/test-ibm128-frexp-static
  FAIL: math/test-ibm128-modf-static
  [...]

I have not analyzed what is happening, but it might be due to the
'-mabi=ibmlongdouble' along with how libgcc.a was built (I saw some
issues on GCC bugzilla).

I also tested this patchset with build-math-static-tests=yes for all
ABIs, and there is not more build failures.

[1] https://sourceware.org/bugzilla/show_bug.cgi?id=20845

Adhemerval Zanella (7):
  math: Add support for auto static math tests
  math: Fix i386 and m68k fmod/fmodf on static build (BZ 31488)
  math: Fix i386 and m68k exp10 on static build
  math: Fix isnanf128 static build
  math: Provided copysignf128 for static libm on alpha, s390, and
    sparcv9
  math: Provide frexpf128 for static libm on alpha, s390, and sparcv9
  math: Provide modf128 for static libm on alpha, s390, and sparcv9

 Makeconfig                                  |   5 +
 Makefile.help                               |   4 +
 math/Makefile                               | 113 +++++++++++++++++++-
 math/test-double-static.h                   |   1 +
 math/test-float-static.h                    |   1 +
 math/test-float128-static.h                 |   1 +
 math/test-float32-static.h                  |   1 +
 math/test-float32x-static.h                 |   1 +
 math/test-float64-static.h                  |   1 +
 math/test-float64x-static.h                 |   1 +
 math/test-ibm128-static.h                   |   1 +
 math/test-ldouble-static.h                  |   1 +
 sysdeps/i386/fpu/w_exp10_compat.c           |   9 +-
 sysdeps/i386/fpu/w_fmod_compat.c            |   7 +-
 sysdeps/i386/fpu/w_fmodf_compat.c           |   7 +-
 sysdeps/ieee754/float128/float128_private.h |   2 +-
 sysdeps/ieee754/float128/s_isnanf128.c      |   4 +
 sysdeps/ieee754/ldbl-64-128/s_copysignl.c   |   4 +-
 sysdeps/ieee754/ldbl-64-128/s_frexpl.c      |   4 +-
 sysdeps/ieee754/ldbl-64-128/s_modfl.c       |   4 +-
 sysdeps/ieee754/ldbl-opt/s_ldexpl.c         |   4 +-
 sysdeps/m68k/m680x0/fpu/w_exp10_compat.c    |   9 +-
 sysdeps/m68k/m680x0/fpu/w_fmod_compat.c     |   5 +-
 sysdeps/m68k/m680x0/fpu/w_fmodf_compat.c    |   7 +-
 24 files changed, 170 insertions(+), 27 deletions(-)
 create mode 100644 math/test-double-static.h
 create mode 100644 math/test-float-static.h
 create mode 100644 math/test-float128-static.h
 create mode 100644 math/test-float32-static.h
 create mode 100644 math/test-float32x-static.h
 create mode 100644 math/test-float64-static.h
 create mode 100644 math/test-float64x-static.h
 create mode 100644 math/test-ibm128-static.h
 create mode 100644 math/test-ldouble-static.h

Change-Id: If786619491f27cdc1e142c3e3961089ef5a1a251
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
24 files changed:
Makeconfig
Makefile.help
math/Makefile
math/test-double-static.h [new file with mode: 0644]
math/test-float-static.h [new file with mode: 0644]
math/test-float128-static.h [new file with mode: 0644]
math/test-float32-static.h [new file with mode: 0644]
math/test-float32x-static.h [new file with mode: 0644]
math/test-float64-static.h [new file with mode: 0644]
math/test-float64x-static.h [new file with mode: 0644]
math/test-ibm128-static.h [new file with mode: 0644]
math/test-ldouble-static.h [new file with mode: 0644]
sysdeps/i386/fpu/w_exp10_compat.c
sysdeps/i386/fpu/w_fmod_compat.c
sysdeps/i386/fpu/w_fmodf_compat.c
sysdeps/ieee754/float128/float128_private.h
sysdeps/ieee754/float128/s_isnanf128.c
sysdeps/ieee754/ldbl-64-128/s_copysignl.c
sysdeps/ieee754/ldbl-64-128/s_frexpl.c
sysdeps/ieee754/ldbl-64-128/s_modfl.c
sysdeps/ieee754/ldbl-opt/s_ldexpl.c
sysdeps/m68k/m680x0/fpu/w_exp10_compat.c
sysdeps/m68k/m680x0/fpu/w_fmod_compat.c
sysdeps/m68k/m680x0/fpu/w_fmodf_compat.c

index 85e00ce..9d287da 100644 (file)
@@ -742,6 +742,11 @@ run-built-tests = yes
 endif
 endif
 
+# Whether to build the static math tests
+ifndef build-math-static-tests
+build-math-static-tests = no
+endif
+
 # Whether to stop immediately when a test fails.  Nonempty means to
 # stop, empty means not to stop.
 ifndef stop-on-test-failure
index b49df9c..17e7154 100644 (file)
@@ -33,6 +33,10 @@ test
        Note that this will rebuild the test if needed, but will not
        rebuild what "make all" would have rebuilt.
 
+build-math-static-tests
+       Enable extra math tests for static linking.  Use like this:
+               make test t=math/test-float-exp10-static build-math-static-tests=yes
+
 --
 Other useful hints:
 
index 79ef4eb..98a98d6 100644 (file)
@@ -274,8 +274,10 @@ endif
 
 libm-vec-tests = $(addprefix test-,$(libmvec-tests))
 libm-test-support = $(foreach t,$(test-types),libm-test-support-$(t))
-test-extras += $(libm-test-support)
-extra-test-objs += $(addsuffix .o, $(libm-test-support))
+libm-test-support-static = $(foreach t,$(test-types),libm-test-support-$(t)-static)
+test-extras += $(libm-test-support) $(libm-test-support-static)
+extra-test-objs += $(addsuffix .o, $(libm-test-support)) \
+                  $(addsuffix .o, $(libm-test-support-static))
 libm-vec-test-wrappers = $(addsuffix -wrappers, $(libm-vec-tests))
 test-extras += $(libm-vec-test-wrappers)
 extra-test-objs += $(addsuffix .o, $(libm-vec-test-wrappers))
@@ -305,7 +307,7 @@ libm-test-funcs-noauto = canonicalize ceil cimag conj copysign cproj creal \
                         nextup remainder remquo rint round roundeven scalb \
                         scalbln scalbn setpayload setpayloadsig signbit \
                         significand totalorder totalordermag trunc ufromfp \
-                        ufromfpx compat_totalorder compat_totalordermag
+                        ufromfpx
 libm-test-funcs-compat = compat_totalorder compat_totalordermag
 libm-test-funcs-narrow = add div fma mul sqrt sub
 libm-test-funcs-all = $(libm-test-funcs-auto) $(libm-test-funcs-noauto)
@@ -364,6 +366,71 @@ $(libm-test-c-narrow-obj): $(objpfx)libm-test%.c: libm-test%.inc \
        $(make-target-directory)
        $(PYTHON) gen-libm-test.py -c $< -a auto-libm-test-out$* -C $@
 
+
+libm-test-funcs-auto-static = \
+  $(libm-test-funcs-auto) \
+  # libm-test-funcs-auto-static
+libm-test-funcs-noauto-static = \
+  $(libm-test-funcs-noauto) \
+  # libm-test-funcs-noauto-static
+libm-test-funcs-narrow-static = \
+  $(libm-test-funcs-narrow) \
+  # libm-test-funcs-narrow-static
+libm-test-funcs-all-static = $(libm-test-funcs-auto-static) $(libm-test-funcs-noauto-static)
+
+libm-test-c-auto-static = $(foreach f,$(libm-test-funcs-auto-static),libm-test-$(f)-static.c)
+libm-test-c-noauto-static = $(foreach f,$(libm-test-funcs-noauto-static),libm-test-$(f)-static.c)
+libm-test-c-narrow-static = $(foreach f,$(libm-test-funcs-narrow-static),\
+                                libm-test-narrow-$(f)-static.c)
+generated += $(libm-test-c-auto-static) $(libm-test-c-noauto-static) $(libm-test-c-narrow-static)
+
+libm-tests-normal-static = $(foreach t,$(libm-tests-base-normal),\
+                               $(foreach f,$(libm-test-funcs-all-static),\
+                                           $(t)-$(f)-static))
+libm-tests-narrow-static = $(foreach t,$(libm-tests-base-narrow-static),\
+                               $(foreach f,$(libm-test-funcs-narrow-static),\
+                                           $(t)-$(f)-static))
+libm-tests-vector-static = $(foreach t,$(libmvec-tests-static),\
+                               $(foreach f,$($(t)-funcs),test-$(t)-$(f)-static))
+libm-tests-static = $(libm-tests-normal-static) $(libm-tests-narrow-static) $(libm-tests-vector-static)
+libm-tests-for-type-static = $(foreach f,$(libm-test-funcs-all-static),\
+                                        test-$(1)-$(f)-static test-i$(1)-$(f)-static) \
+                            $(filter test-$(1)-%,$(libm-tests-vector-static) \
+                                                 $(libm-tests-narrow-static))
+
+libm-tests.o += $(addsuffix .o,$(libm-tests-static))
+
+ifeq ($(build-math-static-tests),yes)
+tests-static += $(libm-tests-static)
+generated += $(addsuffix .c,$(libm-tests)) \
+            $(foreach t,$(test-types),libm-test-support-$(t)-static.c)
+endif
+
+libm-test-c-auto-obj-static = $(addprefix $(objpfx),$(libm-test-c-auto-static))
+libm-test-c-noauto-obj-static = $(addprefix $(objpfx),$(libm-test-c-noauto-static))
+libm-test-c-narrow-obj-static = $(addprefix $(objpfx),$(libm-test-c-narrow-static))
+
+# Use the same input test definitions for both dynamic and static tests.
+.SECONDEXPANSION:
+$(libm-test-c-noauto-obj-static): $(objpfx)libm-test%.c: libm-test$$(subst -static,,%).inc \
+                                                        gen-libm-test.py
+       $(make-target-directory)
+       $(PYTHON) gen-libm-test.py -c $< -a /dev/null -C $@
+
+.SECONDEXPANSION:
+$(libm-test-c-auto-obj-static): $(objpfx)libm-test%.c: libm-test$$(subst -static,,%).inc \
+                                                      gen-libm-test.py \
+                                                      auto-libm-test-out$$(subst -static,,%)
+       $(make-target-directory)
+       $(PYTHON) gen-libm-test.py -c $< -a auto-libm-test-out`echo $* | sed 's/-static//'` -C $@
+
+.SECONDEXPANSION:
+$(libm-test-c-narrow-obj-static): $(objpfx)libm-test%.c: libm-test$$(subst -static,,%).inc \
+                                                        gen-libm-test.py \
+                                                        auto-libm-test-out$$(subst -static,,%)
+       $(make-target-directory)
+       $(PYTHON) gen-libm-test.py -c $< -a auto-libm-test-out`echo $* | sed 's/-static//'` -C $@
+
 # Tests for totalorder compat symbols reuse the table of tests as
 # processed by gen-libm-test.py, so add dependencies on the generated
 # .c files.
@@ -505,6 +572,18 @@ $(foreach t,$(libm-tests-normal),$(objpfx)$(t).c): $(objpfx)test-%.c:
          echo "#include <libm-test-$$func.c>"; \
        ) > $@
 
+$(foreach t,$(libm-tests-normal-static),$(objpfx)$(t).c): $(objpfx)test-%.c:
+       type_func=$*; \
+       type=$${type_func%%-*}; \
+       func=$${type_func#*-}; \
+       ( \
+         echo "#include <test-$$type.h>"; \
+         echo "#include <test-math-exceptions.h>"; \
+         echo "#include <test-math-errno.h>"; \
+         echo "#include <test-math-scalar.h>"; \
+         echo "#include <libm-test-$$func.c>"; \
+       ) > $@
+
 $(foreach t,$(libm-tests-narrow),$(objpfx)$(t).c): $(objpfx)test-%.c:
        type_pair_func=$*; \
        type_pair=$${type_pair_func%-*}; \
@@ -539,6 +618,13 @@ $(foreach t,$(test-types),\
          echo "#include <libm-test-support.c>"; \
        ) > $@
 
+$(foreach t,$(test-types),\
+           $(objpfx)libm-test-support-$(t)-static.c): $(objpfx)libm-test-support-%.c:
+       ( \
+         echo "#include <test-$*.h>"; \
+         echo "#include <libm-test-support.c>"; \
+       ) > $@
+
 $(addprefix $(objpfx), $(libm-tests.o)): $(objpfx)libm-test-ulps.h
 
 define o-iterator-doit
@@ -549,6 +635,13 @@ object-suffixes-left := $(libm-tests-base)
 include $(o-iterator)
 
 define o-iterator-doit
+$(foreach f,$(libm-test-funcs-all-static),\
+           $(objpfx)$(o)-$(f)-static.o): $(objpfx)$(o)%.o: $(objpfx)libm-test%.c
+endef
+object-suffixes-left := $(libm-tests-base)
+include $(o-iterator)
+
+define o-iterator-doit
 $(foreach f,$(libm-test-funcs-narrow),\
            $(objpfx)$(o)-$(f).o): $(objpfx)$(o)%.o: \
                                   $(objpfx)libm-test-narrow%.c
@@ -564,6 +657,13 @@ object-suffixes-left := $(libm-tests-base-normal)
 include $(o-iterator)
 
 define o-iterator-doit
+$(foreach f,$(libm-test-funcs-all-static),\
+           $(objpfx)$(o)-$(f)-static.o): CFLAGS += $(libm-test-no-inline-cflags)
+endef
+object-suffixes-left := $(libm-tests-base-normal)
+include $(o-iterator)
+
+define o-iterator-doit
 $(foreach f,$(libm-test-funcs-narrow),\
            $(objpfx)$(o)-$(f).o): CFLAGS += $(libm-test-no-inline-cflags)
 endef
@@ -585,6 +685,13 @@ object-suffixes-left := $(test-types)
 include $(o-iterator)
 
 define o-iterator-doit
+$(addprefix $(objpfx),\
+           $(call libm-tests-for-type-static,$(o))): $(objpfx)libm-test-support-$(o)-static.o
+endef
+object-suffixes-left := $(test-types)
+include $(o-iterator)
+
+define o-iterator-doit
 $(objpfx)libm-test-support-$(o).o: CFLAGS += $(libm-test-no-inline-cflags)
 endef
 object-suffixes-left := $(test-types)
diff --git a/math/test-double-static.h b/math/test-double-static.h
new file mode 100644 (file)
index 0000000..d53f468
--- /dev/null
@@ -0,0 +1 @@
+#include "test-double.h"
diff --git a/math/test-float-static.h b/math/test-float-static.h
new file mode 100644 (file)
index 0000000..7834c9e
--- /dev/null
@@ -0,0 +1 @@
+#include "test-float.h"
diff --git a/math/test-float128-static.h b/math/test-float128-static.h
new file mode 100644 (file)
index 0000000..5f82064
--- /dev/null
@@ -0,0 +1 @@
+#include "test-float128.h"
diff --git a/math/test-float32-static.h b/math/test-float32-static.h
new file mode 100644 (file)
index 0000000..2df27d1
--- /dev/null
@@ -0,0 +1 @@
+#include "test-float32.h"
diff --git a/math/test-float32x-static.h b/math/test-float32x-static.h
new file mode 100644 (file)
index 0000000..62f78b4
--- /dev/null
@@ -0,0 +1 @@
+#include "test-float32x.h"
diff --git a/math/test-float64-static.h b/math/test-float64-static.h
new file mode 100644 (file)
index 0000000..807c174
--- /dev/null
@@ -0,0 +1 @@
+#include "test-float64.h"
diff --git a/math/test-float64x-static.h b/math/test-float64x-static.h
new file mode 100644 (file)
index 0000000..a7801db
--- /dev/null
@@ -0,0 +1 @@
+#include "test-float64x.h"
diff --git a/math/test-ibm128-static.h b/math/test-ibm128-static.h
new file mode 100644 (file)
index 0000000..b66a570
--- /dev/null
@@ -0,0 +1 @@
+#include "test-ibm128.h"
diff --git a/math/test-ldouble-static.h b/math/test-ldouble-static.h
new file mode 100644 (file)
index 0000000..beabedb
--- /dev/null
@@ -0,0 +1 @@
+#include "test-ldouble.h"
index b534553..49a0e03 100644 (file)
@@ -1,3 +1,8 @@
 /* i386 provides an optimized __ieee754_exp10.  */
-#define NO_COMPAT_NEEDED 1
-#include <math/w_exp10_compat.c>
+#ifdef SHARED
+# define NO_COMPAT_NEEDED 1
+# include <math/w_exp10_compat.c>
+#else
+# include <math-type-macros-double.h>
+# include <w_exp10_template.c>
+#endif
index 5ac9995..528bfc2 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 cc417e0..5a61693 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 38a8bdd..672bf3c 100644 (file)
 #define frexpl frexpf128
 #define getpayloadl getpayloadf128
 #define isinfl isinff128_do_not_use
-#define isnanl isnanf128_do_not_use
+#define isnanl isnanf128
 #define ldexpl ldexpf128
 #define llrintl llrintf128
 #define llroundl llroundf128
index 59f7153..b73a4e8 100644 (file)
 #include "../ldbl-128/s_isnanl.c"
 #if !IS_IN (libm)
 #include <float128-abi.h>
+#ifdef SHARED
 hidden_ver (__isnanf128_impl, __isnanf128)
+#else
+strong_alias (__isnanf128_impl, __isnanf128)
+#endif
 _weak_alias (__isnanf128_impl, isnanl)
 versioned_symbol (libc, __isnanf128_impl, __isnanf128, GLIBC_2_34);
 #if (SHLIB_COMPAT (libc, FLOAT128_VERSION_M, GLIBC_2_34))
index 11b42d0..8013784 100644 (file)
@@ -1,10 +1,10 @@
 #include <math_ldbl_opt.h>
 #include <libm-alias-ldouble.h>
-#if IS_IN (libc)
+#if IS_IN (libc) && defined SHARED
 # undef libm_alias_ldouble
 # define libm_alias_ldouble(from, to)
 #endif
 #include <sysdeps/ieee754/ldbl-128/s_copysignl.c>
-#if IS_IN (libc)
+#if IS_IN (libc) && defined SHARED
 long_double_symbol (libc, __copysignl, copysignl);
 #endif
index 73ac41e..f5f7d34 100644 (file)
@@ -1,10 +1,10 @@
 #include <math_ldbl_opt.h>
 #include <libm-alias-ldouble.h>
-#if IS_IN (libc)
+#if IS_IN (libc) && defined SHARED
 # undef libm_alias_ldouble
 # define libm_alias_ldouble(from, to)
 #endif
 #include <sysdeps/ieee754/ldbl-128/s_frexpl.c>
-#if IS_IN (libc)
+#if IS_IN (libc) && defined SHARED
 long_double_symbol (libc, __frexpl, frexpl);
 #endif
index 7d7aeae..ba3d313 100644 (file)
@@ -1,10 +1,10 @@
 #include <math_ldbl_opt.h>
 #include <libm-alias-ldouble.h>
-#if IS_IN (libc)
+#if IS_IN (libc) && defined SHARED
 # undef libm_alias_ldouble
 # define libm_alias_ldouble(from, to)
 #endif
 #include <sysdeps/ieee754/ldbl-128/s_modfl.c>
-#if IS_IN (libc)
+#if IS_IN (libc) && defined SHARED
 long_double_symbol (libc, __modfl, modfl);
 #endif
index 1afbe7d..932cc43 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 0d3e718..350f2e4 100644 (file)
@@ -1,3 +1,8 @@
 /* m68k provides an optimized __ieee754_exp10.  */
-#define NO_COMPAT_NEEDED 1
-#include <math/w_exp10_compat.c>
+#ifdef SHARED
+# define NO_COMPAT_NEEDED 1
+# include <math/w_exp10_compat.c>
+#else
+# include <math-type-macros-double.h>
+# include <w_exp10_template.c>
+#endif
index 527d4fb..57f3809 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 5043586..88db07f 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