glibc/sysdeps/ieee754/float128/Makefile
Joseph Myers f66780ba46 Fix build with GCC 13 _FloatN, _FloatNx built-in functions
GCC 13 has added more _FloatN and _FloatNx versions of existing
<math.h> and <complex.h> built-in functions, for use in libstdc++-v3.

This breaks the glibc build because of how those functions are defined
as aliases to functions with the same ABI but different types.  Add
appropriate -fno-builtin-* options for compiling relevant files, as
already done for the case of long double functions aliasing double
ones and based on the list of files used there.

I fixed some mistakes in that list of double files that I noticed
while implementing this fix, but there may well be more such
(harmless) cases, in this list or the new one (files that don't
actually exist or don't define the named functions as aliases so don't
need the options).  I did try to exclude cases where glibc doesn't
define certain functions for _FloatN or _FloatNx types at all from the
new uses of -fno-builtin-* options.  As with the options for double
files (see the commit message for commit
49348beafe, "Fix build with GCC 10 when
long double = double."), it's deliberate that the options are used
even if GCC currently doesn't have a built-in version of a given
functions, so providing some level of future-proofing against more
such built-in functions being added in future.

Tested with build-many-glibcs.py for aarch64-linux-gnu
powerpc-linux-gnu powerpc64le-linux-gnu x86_64-linux-gnu (compilers
and glibcs builds) with GCC mainline.
2022-10-31 23:20:08 +00:00

140 lines
6.3 KiB
Makefile

ifeq ($(subdir),stdlib)
routines += float1282mpn strfromf128
routines += strtof128 strtof128_l strtof128_nan mpn2float128
# The strfrom class of functions call __printf_fp in order to convert the
# floating-point value to characters. This requires the value of IO_MTSAFE_IO.
CFLAGS-strfromf128.c += $(libio-mtsafe)
endif
ifeq ($(subdir),wcsmbs)
routines += wcstof128_l wcstof128 wcstof128_nan
endif
ifeq ($(subdir),math)
CFLAGS-w_acosf128.c += -fno-builtin-acosf64x
CFLAGS-w_acoshf128.c += -fno-builtin-acoshf64x
CFLAGS-w_asinf128.c += -fno-builtin-asinf64x
CFLAGS-s_asinhf128.c += -fno-builtin-asinhf64x
CFLAGS-s_atanf128.c += -fno-builtin-atanf64x
CFLAGS-w_atan2f128.c += -fno-builtin-atan2f64x
CFLAGS-w_atanhf128.c += -fno-builtin-atanhf64x
CFLAGS-s_cabsf128.c += -fno-builtin-cabsf64x
CFLAGS-s_cacosf128.c += -fno-builtin-cacosf64x
CFLAGS-s_cacoshf128.c += -fno-builtin-cacoshf64x
CFLAGS-s_canonicalizef128.c += -fno-builtin-canonicalizef64x
CFLAGS-s_cargf128.c += -fno-builtin-cargf64x
CFLAGS-s_casinf128.c += -fno-builtin-casinf64x
CFLAGS-s_casinhf128.c += -fno-builtin-casinhf64x
CFLAGS-s_catanf128.c += -fno-builtin-catanf64x
CFLAGS-s_catanhf128.c += -fno-builtin-catanhf64x
CFLAGS-s_cbrtf128.c += -fno-builtin-cbrtf64x
CFLAGS-s_ccosf128.c += -fno-builtin-ccosf64x
CFLAGS-s_ccoshf128.c += -fno-builtin-ccoshf64x
CFLAGS-s_ceilf128.c += -fno-builtin-ceilf64x
CFLAGS-s_cexpf128.c += -fno-builtin-cexpf64x
CFLAGS-s_cimagf128.c += -fno-builtin-cimagf64x
CFLAGS-s_clogf128.c += -fno-builtin-clogf64x
CFLAGS-s_clog10f128.c += -fno-builtin-clog10f64x
CFLAGS-s_conjf128.c += -fno-builtin-conjf64x
CFLAGS-s_copysignf128.c += -fno-builtin-copysignf64x
CFLAGS-s_cosf128.c += -fno-builtin-cosf64x
CFLAGS-w_coshf128.c += -fno-builtin-coshf64x
CFLAGS-s_cpowf128.c += -fno-builtin-cpowf64x
CFLAGS-s_cprojf128.c += -fno-builtin-cprojf64x
CFLAGS-s_crealf128.c += -fno-builtin-crealf64x
CFLAGS-s_csinf128.c += -fno-builtin-csinf64x
CFLAGS-s_csinhf128.c += -fno-builtin-csinhf64x
CFLAGS-s_csqrtf128.c += -fno-builtin-csqrtf64x
CFLAGS-s_ctanf128.c += -fno-builtin-ctanf64x
CFLAGS-s_ctanhf128.c += -fno-builtin-ctanhf64x
CFLAGS-s_daddf128.c += -fno-builtin-f64addf64x
CFLAGS-s_ddivf128.c += -fno-builtin-f64divf64x
CFLAGS-s_dfmaf128.c += -fno-builtin-f64fmaf64x
CFLAGS-s_dmulf128.c += -fno-builtin-f64mulf64x
CFLAGS-s_dsqrtf128.c += -fno-builtin-f64sqrtf64x
CFLAGS-s_dsubf128.c += -fno-builtin-f64subf64x
CFLAGS-s_erff128.c += -fno-builtin-erff64x
CFLAGS-s_erfcf128.c += -fno-builtin-erfcf64x
CFLAGS-e_expf128.c += -fno-builtin-expf64x
CFLAGS-w_exp10f128.c += -fno-builtin-exp10f64x
CFLAGS-e_exp2f128.c += -fno-builtin-exp2f64x
CFLAGS-s_expm1f128.c += -fno-builtin-expm1f64x
CFLAGS-s_fabsf128.c += -fno-builtin-fabsf64x
CFLAGS-s_faddf128.c += -fno-builtin-f32addf64x
CFLAGS-s_fdimf128.c += -fno-builtin-fdimf64x
CFLAGS-s_fdivf128.c += -fno-builtin-f32divf64x
CFLAGS-s_ffmaf128.c += -fno-builtin-f32fmaf64x
CFLAGS-s_floorf128.c += -fno-builtin-floorf64x
CFLAGS-s_fmaf128.c += -fno-builtin-fmaf64x
CFLAGS-s_fmaxf128.c += -fno-builtin-fmaxf64x
CFLAGS-s_fmaximumf128.c += -fno-builtin-fmaximumf64x
CFLAGS-s_fmaximum_magf128.c += -fno-builtin-fmaximum_magf64x
CFLAGS-s_fmaximum_mag_numf128.c += -fno-builtin-fmaximum_mag_numf64x
CFLAGS-s_fmaximum_numf128.c += -fno-builtin-fmaximum_numf64x
CFLAGS-s_fmaxmagf128.c += -fno-builtin-fmaxmagf64x
CFLAGS-s_fminf128.c += -fno-builtin-fminf64x
CFLAGS-s_fminimumf128.c += -fno-builtin-fminimumf64x
CFLAGS-s_fminimum_magf128.c += -fno-builtin-fminimum_magf64x
CFLAGS-s_fminimum_mag_numf128.c += -fno-builtin-fminimum_mag_numf64x
CFLAGS-s_fminimum_numf128.c += -fno-builtin-fminimum_numf64x
CFLAGS-s_fminmagf128.c += -fno-builtin-fminmagf64x
CFLAGS-w_fmodf128.c += -fno-builtin-fmodf64x
CFLAGS-s_fmulf128.c += -fno-builtin-f32mulf64x
CFLAGS-s_frexpf128.c += -fno-builtin-frexpf64x
CFLAGS-s_fromfpf128.c += -fno-builtin-fromfpf64x
CFLAGS-s_fromfpxf128.c += -fno-builtin-fromfpxf64x
CFLAGS-s_fsqrtf128.c += -fno-builtin-f32sqrtf64x
CFLAGS-s_fsubf128.c += -fno-builtin-f32subf64x
CFLAGS-s_getpayloadf128.c += -fno-builtin-getpayloadf64x
CFLAGS-w_hypotf128.c += -fno-builtin-hypotf64x
CFLAGS-w_ilogbf128.c += -fno-builtin-ilogbf64x
CFLAGS-w_j0f128.c += -fno-builtin-j0f64x
CFLAGS-w_j1f128.c += -fno-builtin-j1f64x
CFLAGS-w_jnf128.c += -fno-builtin-jnf64x
CFLAGS-s_ldexpf128.c += -fno-builtin-ldexpf64x
CFLAGS-w_lgammaf128.c += -fno-builtin-lgammaf64x
CFLAGS-w_lgammaf128_r.c += -fno-builtin-lgammaf64x_r
CFLAGS-w_llogbf128.c += -fno-builtin-llogbf64x
CFLAGS-s_llrintf128.c += -fno-builtin-llrintf64x
CFLAGS-s_llroundf128.c += -fno-builtin-llroundf64x
CFLAGS-e_logf128.c += -fno-builtin-logf64x
CFLAGS-w_log10f128.c += -fno-builtin-log10f64x
CFLAGS-w_log1pf128.c += -fno-builtin-log1pf64x
CFLAGS-e_log2f128.c += -fno-builtin-log2f64x
CFLAGS-s_logbf128.c += -fno-builtin-logbf64x
CFLAGS-s_lrintf128.c += -fno-builtin-lrintf64x
CFLAGS-s_lroundf128.c += -fno-builtin-lroundf64x
CFLAGS-s_modff128.c += -fno-builtin-modff64x
CFLAGS-s_nanf128.c += -fno-builtin-nanf64x
CFLAGS-s_nearbyintf128.c += -fno-builtin-nearbyintf64x
CFLAGS-s_nextafterf128.c += -fno-builtin-nextafterf64x
CFLAGS-s_nextdownf128.c += -fno-builtin-nextdownf64x
CFLAGS-s_nextupf128.c += -fno-builtin-nextupf64x
CFLAGS-e_powf128.c += -fno-builtin-powf64x
CFLAGS-w_remainderf128.c += -fno-builtin-remainderf64x
CFLAGS-s_remquof128.c += -fno-builtin-remquof64x
CFLAGS-s_rintf128.c += -fno-builtin-rintf64x
CFLAGS-s_roundf128.c += -fno-builtin-roundf64x
CFLAGS-s_roundevenf128.c += -fno-builtin-roundevenf64x
CFLAGS-w_scalblnf128.c += -fno-builtin-scalblnf64x
CFLAGS-s_scalbnf128.c += -fno-builtin-scalbnf64x
CFLAGS-s_setpayloadf128.c += -fno-builtin-setpayloadf64x
CFLAGS-s_setpayloadsigf128.c += -fno-builtin-setpayloadsigf64x
CFLAGS-s_sinf128.c += -fno-builtin-sinf64x
CFLAGS-s_sincosf128.c += -fno-builtin-sincosf64x
CFLAGS-w_sinhf128.c += -fno-builtin-sinhf64x
CFLAGS-w_sqrtf128.c += -fno-builtin-sqrtf64x
CFLAGS-s_tanf128.c += -fno-builtin-tanf64x
CFLAGS-s_tanhf128.c += -fno-builtin-tanhf64x
CFLAGS-w_tgammaf128.c += -fno-builtin-tgammaf64x
CFLAGS-s_totalorderf128.c += -fno-builtin-totalorderf64x
CFLAGS-s_totalordermagf128.c += -fno-builtin-totalordermagf64x
CFLAGS-s_truncf128.c += -fno-builtin-truncf64x
CFLAGS-s_ufromfpf128.c += -fno-builtin-ufromfpf64x
CFLAGS-s_ufromfpxf128.c += -fno-builtin-ufromfpxf64x
CFLAGS-s_y0f128.c += -fno-builtin-y0f64x
CFLAGS-s_y1f128.c += -fno-builtin-y1f64x
CFLAGS-s_ynf128.c += -fno-builtin-ynf64x
endif