Browse Source

libm: honor NO_LONG_DOUBLE in ldouble_wrappers

Fixes SH build breakage due to attempts to define hidden defs for
unavailable long double functions.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer 9 years ago
parent
commit
730db44f08
3 changed files with 11 additions and 8 deletions
  1. 1 1
      extra/Configs/Config.in.arch
  2. 1 1
      ldso/ldso/sh/dl-syscalls.h
  3. 9 6
      libm/ldouble_wrappers.c

+ 1 - 1
extra/Configs/Config.in.arch

@@ -191,7 +191,7 @@ config UCLIBC_HAS_FENV
 config UCLIBC_HAS_LONG_DOUBLE_MATH
 	bool "Enable long double support"
 	depends on DO_C99_MATH
-	depends on TARGET_i386 || TARGET_m68k || TARGET_sparc || TARGET_x86_64 || TARGET_powerpc || TARGET_sh || TARGET_microblaze || TARGET_xtensa
+	depends on TARGET_aarch64 || TARGET_alpha || TARGET_i386 || TARGET_ia64 || TARGET_m68k || TARGET_powerpc || TARGET_s390 || TARGET_sparc || TARGET_tile || TARGET_x86_64
 	default y
 	help
 	  If you want the uClibc math library to contain the full set of C99

+ 1 - 1
ldso/ldso/sh/dl-syscalls.h

@@ -1,4 +1,4 @@
-#if __GNUC_PREREQ (4, 1)
+#if __GNUC_PREREQ (4, 1) && !__GNUC_PREREQ (4, 9)
 #warning !!! gcc 4.1 and later have problems with __always_inline so redefined as inline
 # ifdef __always_inline
 # undef __always_inline

+ 9 - 6
libm/ldouble_wrappers.c

@@ -16,27 +16,28 @@
 #include "math.h"
 #include <complex.h>
 
-#define WRAPPER1(func) \
+#if !defined __NO_LONG_DOUBLE_MATH
+# define WRAPPER1(func) \
 long double func##l(long double x) \
 { \
 	return (long double) func((double) x); \
 }
-#define WRAPPER2(func) \
+# define WRAPPER2(func) \
 long double func##l(long double x, long double y) \
 { \
 	return (long double) func((double) x, (double) y); \
 }
-#define int_WRAPPER1(func) \
+# define int_WRAPPER1(func) \
 int func##l(long double x) \
 { \
 	return func((double) x); \
 }
-#define long_WRAPPER1(func) \
+# define long_WRAPPER1(func) \
 long func##l(long double x) \
 { \
 	return func((double) x); \
 }
-#define long_long_WRAPPER1(func) \
+# define long_long_WRAPPER1(func) \
 long long func##l(long double x) \
 { \
 	return func((double) x); \
@@ -447,4 +448,6 @@ int_WRAPPER1(__isinf)
 libm_hidden_def(__isinfl)
 # endif
 
-#endif
+#endif /* __DO_C99_MATH__ */
+
+#endif /* __NO_LONG_DOUBLE_MATH */