From 00b283c04290a93c63b81aa91e2089bfd42a609f Mon Sep 17 00:00:00 2001 From: PulkoMandy Date: Wed, 8 May 2019 19:21:52 +0200 Subject: [PATCH] Fix long double support for ARM. Fixes #15056. Change-Id: I48c00b955346971aa88b731ccad1953a4044983d Reviewed-on: https://review.haiku-os.org/c/1442 Reviewed-by: Alex von Gluck IV --- .../libroot/posix/glibc/arch/arm/Jamfile | 24 +++++++++---------- .../posix/glibc/include/arch/arm/config.h | 5 ++++ src/system/libroot/posix/glibc/math/Jamfile | 5 ++++ 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/system/libroot/posix/glibc/arch/arm/Jamfile b/src/system/libroot/posix/glibc/arch/arm/Jamfile index 18924a7e2f..56ef3e16cc 100644 --- a/src/system/libroot/posix/glibc/arch/arm/Jamfile +++ b/src/system/libroot/posix/glibc/arch/arm/Jamfile @@ -32,15 +32,15 @@ local genericSources = mul.c mul_n.c s_isinf.c s_isinff.c s_isnan.c s_isnanf.c - s_signbit.c s_signbitf.c s_signbitl.c + s_signbit.c s_signbitf.c - s_nan.c s_nanf.c s_nanl.c - e_hypot.c e_hypotf.c e_hypotl.c - w_hypot.c w_hypotf.c w_hypotl.c + s_nan.c s_nanf.c + e_hypot.c e_hypotf.c + w_hypot.c w_hypotf.c s_fpclassify.c s_fpclassifyf.c - s_clog.c s_clogf.c s_clogl.c - s_log1p.c s_log1pf.c s_log1pl.c - s_csqrt.c s_csqrtf.c s_csqrtl.c + s_clog.c s_clogf.c + s_log1p.c s_log1pf.c + s_csqrt.c s_csqrtf.c s_floor.c s_floorf.c s_ceil.c s_ceilf.c s_modf.c @@ -55,15 +55,15 @@ local genericSources = halfulp.c mpa.c mplog.c mpexp.c s_sin.c - s_atan.c s_atanf.c s_atanl.c + s_atan.c s_atanf.c s_tan.c e_asin.c e_asinl.c - w_asin.c w_asinl.c + w_asin.c e_log10.c w_log10.c e_logf.c e_logl.c e_acos.c w_acos.c - e_atan2.c e_atan2l.c - w_atan2.c w_atan2l.c mpatan2.c mpatan.c mptan.c mpsqrt.c w_sqrt.c w_sqrtf.c + e_atan2.c + w_atan2.c mpatan2.c mpatan.c mptan.c mpsqrt.c w_sqrt.c w_sqrtf.c e_sqrtl.c e_fmod.c w_fmod.c e_log.c w_log.c @@ -73,7 +73,7 @@ local genericSources = s_sinf.c k_sinf.c s_ldexp.c s_ldexpf.c s_scalbnf.c s_scalbn.c - s_copysign.c s_copysignf.c s_copysignl.c + s_copysign.c s_copysignf.c s_tanh.c s_tanf.c k_tanf.c s_lround.c s_lroundf.c s_round.c s_roundf.c s_rint.c s_rintf.c s_lrintf.c diff --git a/src/system/libroot/posix/glibc/include/arch/arm/config.h b/src/system/libroot/posix/glibc/include/arch/arm/config.h index bccc55a90a..8de412c79e 100644 --- a/src/system/libroot/posix/glibc/include/arch/arm/config.h +++ b/src/system/libroot/posix/glibc/include/arch/arm/config.h @@ -188,6 +188,11 @@ /* Mach/i386 specific: define if the `i386_set_gdt' RPC is available. */ #undef HAVE_I386_SET_GDT +/* arm does not support 128bit long doubles, so let's just use 64bit ones. + * This mcro aliases the long double symbols to the double implementation. */ +#define NO_LONG_DOUBLE 1 +#define __NO_LONG_DOUBLE_MATH 1 + /* */ diff --git a/src/system/libroot/posix/glibc/math/Jamfile b/src/system/libroot/posix/glibc/math/Jamfile index 4476eb1ba1..97655bc64f 100644 --- a/src/system/libroot/posix/glibc/math/Jamfile +++ b/src/system/libroot/posix/glibc/math/Jamfile @@ -17,10 +17,15 @@ for architectureObject in [ MultiArchSubDirSetup ] { UsePrivateHeaders libroot ; + # ppc, m68k and arm use regular doubles as long doubles (through + # aliases), so they must be built without these files. + # FIXME: ppc should use ldbl-128ibm, and m68k should probably use + # ldbl-96 as for x86. local longDoubleObjects ; switch $(architecture) { case ppc : longDoubleObjects = ; case m68k : longDoubleObjects = ; + case arm : longDoubleObjects = ; case * : longDoubleObjects = cabsl.c cargl.c cimagl.c conjl.c creall.c k_casinhl.c ; }