powerpc64: apply -mabi=ibmlongdouble to special files
[glibc.git] / sysdeps / powerpc / powerpc64 / le / Makefile
blobd79ad222fc2570cebe9128475c607e0acefcb3b0
1 # When building float128 we need to ensure -mfloat128 is
2 # passed to all such object files.
4 # Bootstrapping code for enabling IEEE 128. This can be removed and
5 # any indirections simplified once IEEE 128 long double is enabled.
6 type-ldouble-CFLAGS =
7 no-gnu-attribute-CFLAGS =
8 ifeq ($(ibm128-fcts),yes)
9 ibm128-abi-CFLAGS := -mabi=ibmlongdouble
10 type-ldouble-CFLAGS += $(ibm128-abi-CFLAGS)
11 no-gnu-attribute-CFLAGS = -mno-gnu-attribute
12 endif
14 ifeq ($(subdir),math)
15 # sqrtf128 requires emulation before POWER9.
16 CPPFLAGS += -I../soft-fp
18 # float128 requires adding a handful of extra flags.
19 # Similarly, disable
20 $(foreach suf,$(all-object-suffixes),%f128$(suf)): CFLAGS += -mfloat128 $(no-gnu-attribute-CFLAGS)
21 $(foreach suf,$(all-object-suffixes),%f128_r$(suf)): CFLAGS += -mfloat128 $(no-gnu-attribute-CFLAGS)
22 $(foreach suf,$(all-object-suffixes),$(objpfx)test-float128%$(suf)): CFLAGS += -mfloat128
23 $(foreach suf,$(all-object-suffixes),$(objpfx)test-float64x%$(suf)): CFLAGS += -mfloat128
24 # Pairs of types with _Float128 / _Float64x as the wider type but not
25 # the narrower one.
26 f128-pairs = float32-float64x float32-float128 float64-float64x \
27 float64-float128 float32x-float64x float32x-float128
28 $(foreach suf,$(all-object-suffixes),$(foreach pair,$(f128-pairs),$(objpfx)test-$(pair)%$(suf))): CFLAGS += -mfloat128
30 CFLAGS-libm-test-support-float128.c += -mfloat128
31 CFLAGS-libm-test-support-float64x.c += -mfloat128
32 CFLAGS-test-math-iscanonical.cc += -mfloat128
33 CFLAGS-test-math-iseqsig.cc += -mfloat128
34 CFLAGS-test-math-issignaling.cc += -mfloat128
35 CFLAGS-test-math-iszero.cc += -mfloat128
37 CFLAGS-s_logbl-power7.c += $(type-ldouble-CFLAGS)
38 CFLAGS-s_logbl-ppc64.c += $(type-ldouble-CFLAGS)
40 $(foreach suf,$(all-object-suffixes),\
41 $(objpfx)s_copysignl$(suf) \
42 $(objpfx)s_fabsl$(suf)): \
43 ASFLAGS += $(type-ldouble-CFLAGS)
45 $(foreach suf,$(all-object-suffixes),\
46 $(objpfx)libm-test-%ibm128$(suf) \
47 $(objpfx)test-iibm128%$(suf) $(objpfx)test-ibm128%$(suf)): \
48 CFLAGS += $(type-ldouble-CFLAGS)
50 # Newer GCC (>7) doesn't like -mabi=* and -mlong-double-64
51 $(foreach suf,$(all-object-suffixes),\
52 $(objpfx)test-narrow-macros-ldbl-64$(suf) \
53 $(objpfx)test-nldbl-redirect$(suf) \
54 $(objpfx)test-redirection-ldbl-64$(suf) \
55 ): sysdep-CFLAGS := $(filter-out -mabi=ieeelongdouble,$(sysdep-CFLAGS))
57 endif
59 # Newer GCC (>7) doesn't like -mabi=* and -mlong-double-64
60 ifeq ($(subdir),misc)
61 $(foreach suf,$(all-object-suffixes),\
62 $(objpfx)tst-nldbl-warn$(suf) \
63 $(objpfx)tst-nldbl-error$(suf) \
64 ): sysdep-CFLAGS := $(filter-out -mabi=ieeelongdouble,$(sysdep-CFLAGS))
65 endif
67 # Newer GCC (>7) doesn't like -mabi=* and -mlong-double-64
68 ifeq ($(subdir),argp)
69 $(foreach suf,$(all-object-suffixes),\
70 $(objpfx)tst-nldbl-argp$(suf) \
71 ): sysdep-CFLAGS := $(filter-out -mabi=ieeelongdouble,$(sysdep-CFLAGS))
72 endif
74 # Append flags to string <-> _Float128 routines.
75 ifneq ($(filter $(subdir),wcsmbs stdlib),)
76 $(foreach suf,$(all-object-suffixes),%f128$(suf)): CFLAGS += -mfloat128 $(no-gnu-attribute-CFLAGS)
77 $(foreach suf,$(all-object-suffixes),%f128_l$(suf)): CFLAGS += -mfloat128 $(no-gnu-attribute-CFLAGS)
78 $(foreach suf,$(all-object-suffixes),%f128_nan$(suf)): CFLAGS += -mfloat128 $(no-gnu-attribute-CFLAGS)
79 $(foreach suf,$(all-object-suffixes),%float1282mpn$(suf)): CFLAGS += -mfloat128 $(no-gnu-attribute-CFLAGS)
80 $(foreach suf,$(all-object-suffixes),%mpn2float128$(suf)): CFLAGS += -mfloat128 $(no-gnu-attribute-CFLAGS)
81 CFLAGS-bug-strtod.c += -mfloat128
82 CFLAGS-bug-strtod2.c += -mfloat128
83 CFLAGS-tst-strtod-round.c += -mfloat128
84 CFLAGS-tst-wcstod-round.c += -mfloat128
85 CFLAGS-tst-strtod-nan-locale.c += -mfloat128
86 CFLAGS-tst-wcstod-nan-locale.c += -mfloat128
87 CFLAGS-tst-strtod6.c += -mfloat128
88 CFLAGS-tst-strfrom.c += -mfloat128
89 CFLAGS-tst-strfrom-locale.c += -mfloat128
90 CFLAGS-strfrom-skeleton.c += -mfloat128
91 CFLAGS-tst-strtod-nan-sign.c += -mfloat128
92 CFLAGS-tst-wcstod-nan-sign.c += -mfloat128
94 # When building glibc with support for _Float128, the powers of ten tables in
95 # fpioconst.c and in the string conversion functions must be extended. Some
96 # Makefiles (e.g.: wcsmbs/Makefile) override CFLAGS defined by the Makefiles in
97 # sysdeps. This is avoided with the use sysdep-CFLAGS instead of CFLAGS.
98 sysdep-CFLAGS += $(sysdep-CFLAGS-$(<F))
99 sysdep-CFLAGS-fpioconst.c += -mfloat128
100 sysdep-CFLAGS-strtod_l.c += -mfloat128
101 sysdep-CFLAGS-strtof_l.c += -mfloat128
102 sysdep-CFLAGS-strtold_l.c += -mfloat128
103 sysdep-CFLAGS-wcstod_l.c += -mfloat128
104 sysdep-CFLAGS-wcstof_l.c += -mfloat128
105 sysdep-CFLAGS-wcstold_l.c += -mfloat128
106 endif
108 # Append flags to printf routines.
109 ifeq ($(subdir),stdio-common)
110 CFLAGS-printf_fp.c = -mfloat128
111 CFLAGS-printf_fphex.c = -mfloat128
112 CFLAGS-printf_size.c = -mfloat128
113 endif
115 # Disable linker noise on files using ieee128 long double internally
116 ifeq ($(subdir),time)
117 CFLAGS-difftime.c += $(no-gnu-attribute-CFLAGS)
118 endif
120 $(foreach suf,$(all-object-suffixes),$(objpfx)nldbl-%$(suf)): \
121 CFLAGS += $(type-ldouble-CFLAGS)
123 ldbl-ibm128-files = $(objpfx)nldbl-%$(suf) \
124 $(objpfx)libm-test-%ibm128$(suf) \
125 $(objpfx)test-iibm128%$(suf) $(objpfx)test-ibm128%$(suf) \
126 $(objpfx)test-tgmath3-%$(suf)
128 # Remove -mabi=ieeelongdouble from ldbl-ibm128 files.
129 $(foreach suf,$(all-object-suffixes), $(ldbl-ibm128-files)) \
130 $(foreach r,$(ldbl-128ibm-routines) $(ldbl-tests), \
131 $(objpfx)$(r)$(suf)): \
132 sysdep-CFLAGS := $(filter-out -mabi=ieeelongdouble,$(sysdep-CFLAGS))