1 # When building float128 we need to ensure -mfloat128 is
2 # passed to all such object files.
3 type-float128-CFLAGS
:= -mfloat128
5 # Bootstrapping code for enabling IEEE 128. This can be removed and
6 # any indirections simplified once IEEE 128 long double is enabled.
8 no-gnu-attribute-CFLAGS
=
9 ifeq ($(ibm128-fcts
),yes
)
10 ibm128-abi-CFLAGS
:= -mabi
=ibmlongdouble
11 type-ldouble-CFLAGS
+= $(ibm128-abi-CFLAGS
)
12 no-gnu-attribute-CFLAGS
= -mno-gnu-attribute
15 # All _Float128 files should be built assuming an ibm128 long double.
16 # Likewise, this avoids some old GCC 7 compiler bugs whereby calls
17 # to __mulkc3 are swapped with __multc3, or worse. This is noted in
18 # GCC BZ 84914, and marked as will-not-fix.
19 type-float128-CFLAGS
+= $(type-ldouble-CFLAGS
)
22 # sqrtf128 requires emulation before POWER9.
23 CPPFLAGS
+= -I..
/soft-fp
25 # float128 requires adding a handful of extra flags.
27 $(foreach suf
,$(all-object-suffixes
),%f128
$(suf
)): CFLAGS
+= $(type-float128-CFLAGS
) $(no-gnu-attribute-CFLAGS
)
28 $(foreach suf
,$(all-object-suffixes
),%f128_r
$(suf
)): CFLAGS
+= $(type-float128-CFLAGS
) $(no-gnu-attribute-CFLAGS
)
29 $(foreach suf
,$(all-object-suffixes
),$(objpfx
)test-float128
%$(suf
)): CFLAGS
+= $(type-float128-CFLAGS
)
30 $(foreach suf
,$(all-object-suffixes
),$(objpfx
)test-float64x
%$(suf
)): CFLAGS
+= $(type-float128-CFLAGS
)
31 # Pairs of types with _Float128 / _Float64x as the wider type but not
33 f128-pairs
= float32-float64x float32-float128 float64-float64x \
34 float64-float128 float32x-float64x float32x-float128
35 $(foreach suf
,$(all-object-suffixes
),$(foreach pair
,$(f128-pairs
),$(objpfx
)test-
$(pair
)%$(suf
))): CFLAGS
+= $(type-float128-CFLAGS
)
36 CFLAGS-libm-test-support-float128.c
+= $(type-float128-CFLAGS
)
37 CFLAGS-libm-test-support-float64x.c
+= $(type-float128-CFLAGS
)
38 CFLAGS-test-math-iscanonical.
cc += $(type-float128-CFLAGS
)
39 CFLAGS-test-math-iseqsig.
cc += $(type-float128-CFLAGS
)
40 CFLAGS-test-math-issignaling.
cc += $(type-float128-CFLAGS
)
41 CFLAGS-test-math-iszero.
cc += $(type-float128-CFLAGS
)
43 CFLAGS-s_logbl-power7.c
+= $(type-ldouble-CFLAGS
)
44 CFLAGS-s_logbl-ppc64.c
+= $(type-ldouble-CFLAGS
)
46 $(foreach suf
,$(all-object-suffixes
),\
47 $(objpfx
)s_copysignl
$(suf
) \
48 $(objpfx
)s_fabsl
$(suf
)): \
49 ASFLAGS
+= $(type-ldouble-CFLAGS
)
51 $(foreach suf
,$(all-object-suffixes
),\
52 $(objpfx
)libm-test-
%ibm128
$(suf
) \
53 $(objpfx
)test-iibm128
%$(suf
) $(objpfx
)test-ibm128
%$(suf
)): \
54 CFLAGS
+= $(type-ldouble-CFLAGS
)
56 # Newer GCC (>7) doesn't like -mabi=* and -mlong-double-64
57 $(foreach suf
,$(all-object-suffixes
),\
58 $(objpfx
)test-narrow-macros-ldbl-64
$(suf
) \
59 $(objpfx
)test-nldbl-redirect
$(suf
) \
60 $(objpfx
)test-redirection-ldbl-64
$(suf
) \
61 ): sysdep-CFLAGS
:= $(filter-out -mabi
=ieeelongdouble
,$(sysdep-CFLAGS
))
65 # Newer GCC (>7) doesn't like -mabi=* and -mlong-double-64
67 $(foreach suf
,$(all-object-suffixes
),\
68 $(objpfx
)tst-nldbl-warn
$(suf
) \
69 $(objpfx
)tst-nldbl-error
$(suf
) \
70 ): sysdep-CFLAGS
:= $(filter-out -mabi
=ieeelongdouble
,$(sysdep-CFLAGS
))
73 # Newer GCC (>7) doesn't like -mabi=* and -mlong-double-64
75 $(foreach suf
,$(all-object-suffixes
),\
76 $(objpfx
)tst-nldbl-argp
$(suf
) \
77 ): sysdep-CFLAGS
:= $(filter-out -mabi
=ieeelongdouble
,$(sysdep-CFLAGS
))
81 # Append flags to string <-> _Float128 routines.
82 ifneq ($(filter $(subdir
),wcsmbs stdlib
),)
83 $(foreach suf
,$(all-object-suffixes
),%f128
$(suf
)): CFLAGS
+= $(type-float128-CFLAGS
) $(no-gnu-attribute-CFLAGS
)
84 $(foreach suf
,$(all-object-suffixes
),%f128_l
$(suf
)): CFLAGS
+= $(type-float128-CFLAGS
) $(no-gnu-attribute-CFLAGS
)
85 $(foreach suf
,$(all-object-suffixes
),%f128_nan
$(suf
)): CFLAGS
+= $(type-float128-CFLAGS
) $(no-gnu-attribute-CFLAGS
)
86 $(foreach suf
,$(all-object-suffixes
),%float1282mpn
$(suf
)): CFLAGS
+= $(type-float128-CFLAGS
) $(no-gnu-attribute-CFLAGS
)
87 $(foreach suf
,$(all-object-suffixes
),%mpn2float128
$(suf
)): CFLAGS
+= $(type-float128-CFLAGS
) $(no-gnu-attribute-CFLAGS
)
88 CFLAGS-bug-strtod.c
+= $(type-float128-CFLAGS
)
89 CFLAGS-bug-strtod2.c
+= $(type-float128-CFLAGS
)
90 CFLAGS-tst-strtod-round.c
+= $(type-float128-CFLAGS
)
91 CFLAGS-tst-wcstod-round.c
+= $(type-float128-CFLAGS
)
92 CFLAGS-tst-strtod-nan-locale.c
+= $(type-float128-CFLAGS
)
93 CFLAGS-tst-wcstod-nan-locale.c
+= $(type-float128-CFLAGS
)
94 CFLAGS-tst-strtod6.c
+= $(type-float128-CFLAGS
)
95 CFLAGS-tst-strfrom.c
+= $(type-float128-CFLAGS
)
96 CFLAGS-tst-strfrom-locale.c
+= $(type-float128-CFLAGS
)
97 CFLAGS-strfrom-skeleton.c
+= $(type-float128-CFLAGS
)
98 CFLAGS-tst-strtod-nan-sign.c
+= $(type-float128-CFLAGS
)
99 CFLAGS-tst-wcstod-nan-sign.c
+= $(type-float128-CFLAGS
)
101 # When building glibc with support for _Float128, the powers of ten tables in
102 # fpioconst.c and in the string conversion functions must be extended. Some
103 # Makefiles (e.g.: wcsmbs/Makefile) override CFLAGS defined by the Makefiles in
104 # sysdeps. This is avoided with the use sysdep-CFLAGS instead of CFLAGS.
105 sysdep-CFLAGS
+= $(sysdep-CFLAGS-
$(<F
))
106 sysdep-CFLAGS-fpioconst.c
+= $(type-float128-CFLAGS
)
107 sysdep-CFLAGS-strtod_l.c
+= $(type-float128-CFLAGS
)
108 sysdep-CFLAGS-strtof_l.c
+= $(type-float128-CFLAGS
)
109 sysdep-CFLAGS-strtold_l.c
+= $(type-float128-CFLAGS
)
110 sysdep-CFLAGS-wcstod_l.c
+= $(type-float128-CFLAGS
)
111 sysdep-CFLAGS-wcstof_l.c
+= $(type-float128-CFLAGS
)
112 sysdep-CFLAGS-wcstold_l.c
+= $(type-float128-CFLAGS
)
114 # Build any ibm128 specific stdlib tests with ibm128 ABI.
115 $(foreach suf
,$(all-object-suffixes
),%128ibm
$(suf
)): CFLAGS
+= $(type-ldouble-CFLAGS
)
118 # Append flags to printf routines.
119 ifeq ($(subdir
),stdio-common
)
120 CFLAGS-printf_fp.c
= $(type-float128-CFLAGS
)
121 CFLAGS-printf_fphex.c
= $(type-float128-CFLAGS
)
122 CFLAGS-printf_size.c
= $(type-float128-CFLAGS
)
125 # Disable linker noise on files using ieee128 long double internally
126 ifeq ($(subdir
),time
)
127 CFLAGS-difftime.c
+= $(no-gnu-attribute-CFLAGS
)
130 $(foreach suf
,$(all-object-suffixes
),$(objpfx
)nldbl-
%$(suf
)): \
131 CFLAGS
+= $(type-ldouble-CFLAGS
)
133 ldbl-ibm128-files
= $(objpfx
)nldbl-
%$(suf
) \
134 $(objpfx
)libm-test-
%ibm128
$(suf
) \
135 $(objpfx
)test-iibm128
%$(suf
) $(objpfx
)test-ibm128
%$(suf
) \
136 $(objpfx
)test-tgmath3-
%$(suf
)
138 # Remove -mabi=ieeelongdouble from ldbl-ibm128 files.
139 $(foreach suf
,$(all-object-suffixes
), $(ldbl-ibm128-files
)) \
140 $(foreach r
,$(ldbl-128ibm-routines
) $(ldbl-tests
), \
141 $(objpfx
)$(r
)$(suf
)): \
142 sysdep-CFLAGS
:= $(filter-out -mabi
=ieeelongdouble
,$(sysdep-CFLAGS
))