1b6ea6d77627e9c76ac21966ada82972b4464909
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / uclibc / 0.9.33.2 / 0070-libm-honor-NO_LONG_DOUBLE-in-ldouble_wrappers.patch
1 From 730db44f0824f505a31822e250b9f04b9f8e7a1b Mon Sep 17 00:00:00 2001
2 From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
3 Date: Tue, 24 Mar 2015 00:11:47 +0100
4 Subject: [PATCH] libm: honor NO_LONG_DOUBLE in ldouble_wrappers
5
6 Fixes SH build breakage due to attempts to define hidden defs for
7 unavailable long double functions.
8
9 Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
10 [Gustavo: adapt to 0.9.33.2]
11 Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
12 ---
13  extra/Configs/Config.in.arch |  2 +-
14  ldso/ldso/sh/dl-syscalls.h   |  2 +-
15  libm/ldouble_wrappers.c      | 15 +++++++++------
16  3 files changed, 11 insertions(+), 8 deletions(-)
17
18 diff --git a/extra/Configs/Config.in.arch b/extra/Configs/Config.in.arch
19 index 68e03bf..0dae84b 100644
20 --- a/extra/Configs/Config.in.arch
21 +++ b/extra/Configs/Config.in.arch
22 @@ -191,7 +191,7 @@ config UCLIBC_HAS_FENV
23  config UCLIBC_HAS_LONG_DOUBLE_MATH
24         bool "Enable long double support"
25         depends on DO_C99_MATH
26 -       depends on TARGET_i386 || TARGET_m68k || TARGET_sparc || TARGET_x86_64 || TARGET_powerpc || TARGET_sh || TARGET_microblaze
27 +       depends on TARGET_aarch64 || TARGET_alpha || TARGET_i386 || TARGET_ia64 || TARGET_m68k || TARGET_powerpc || TARGET_s390 || TARGET_sparc || TARGET_tile || TARGET_x86_64
28         default y
29         help
30           If you want the uClibc math library to contain the full set of C99
31 diff --git a/ldso/ldso/sh/dl-syscalls.h b/ldso/ldso/sh/dl-syscalls.h
32 index f9f13c7..b99a9b5 100644
33 --- a/ldso/ldso/sh/dl-syscalls.h
34 +++ b/ldso/ldso/sh/dl-syscalls.h
35 @@ -1,4 +1,4 @@
36 -#if __GNUC_PREREQ (4, 1)
37 +#if __GNUC_PREREQ (4, 1) && !__GNUC_PREREQ (4, 9)
38  #warning !!! gcc 4.1 and later have problems with __always_inline so redefined as inline
39  # ifdef __always_inline
40  # undef __always_inline
41 diff --git a/libm/ldouble_wrappers.c b/libm/ldouble_wrappers.c
42 index b4215cb..840293f 100644
43 --- a/libm/ldouble_wrappers.c
44 +++ b/libm/ldouble_wrappers.c
45 @@ -16,27 +16,28 @@
46  #include "math.h"
47  #include <complex.h>
48  
49 -#define WRAPPER1(func) \
50 +#if !defined __NO_LONG_DOUBLE_MATH
51 +# define WRAPPER1(func) \
52  long double func##l(long double x) \
53  { \
54         return (long double) func((double) x); \
55  }
56 -#define WRAPPER2(func) \
57 +# define WRAPPER2(func) \
58  long double func##l(long double x, long double y) \
59  { \
60         return (long double) func((double) x, (double) y); \
61  }
62 -#define int_WRAPPER1(func) \
63 +# define int_WRAPPER1(func) \
64  int func##l(long double x) \
65  { \
66         return func((double) x); \
67  }
68 -#define long_WRAPPER1(func) \
69 +# define long_WRAPPER1(func) \
70  long func##l(long double x) \
71  { \
72         return func((double) x); \
73  }
74 -#define long_long_WRAPPER1(func) \
75 +# define long_long_WRAPPER1(func) \
76  long long func##l(long double x) \
77  { \
78         return func((double) x); \
79 @@ -447,4 +448,6 @@ int_WRAPPER1(__isinf)
80  libm_hidden_def(__isinfl)
81  # endif
82  
83 -#endif
84 +#endif /* __DO_C99_MATH__ */
85 +
86 +#endif /* __NO_LONG_DOUBLE_MATH */
87 -- 
88 2.0.5
89