From 671e72f6a99110ebf325482a066fea5662d53150 Mon Sep 17 00:00:00 2001 From: RuoyuZhou Date: Sat, 30 May 2026 16:29:49 +0800 Subject: [PATCH] Align musl long-double limits with the active Linx compiler model The arch float header now takes compiler-provided long-double macros directly instead of hardcoding a mismatched binary128 profile. That keeps musl configure-time probing aligned with the live toolchain contract. Constraint: musl configure rejects unsupported long double layouts during bring-up Rejected: Keep hardcoded binary128 constants | they diverge from the active compiler macro model Confidence: high Scope-risk: narrow Directive: Compare clang -dM output against arch/linx64/bits/float.h before changing long-double constants again Tested: git diff --check Not-tested: musl configure, libc smoke Co-authored-by: OmX --- arch/linx64/bits/float.h | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/arch/linx64/bits/float.h b/arch/linx64/bits/float.h index 719c79085..979cd2cd2 100644 --- a/arch/linx64/bits/float.h +++ b/arch/linx64/bits/float.h @@ -1,16 +1,20 @@ +#ifdef __FLT_EVAL_METHOD__ +#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__ +#else #define FLT_EVAL_METHOD 0 +#endif -#define LDBL_TRUE_MIN 6.47517511943802511092443895822764655e-4966L -#define LDBL_MIN 3.36210314311209350626267781732175260e-4932L -#define LDBL_MAX 1.18973149535723176508575932662800702e+4932L -#define LDBL_EPSILON 1.92592994438723585305597794258492732e-34L +#define LDBL_TRUE_MIN __LDBL_DENORM_MIN__ +#define LDBL_MIN __LDBL_MIN__ +#define LDBL_MAX __LDBL_MAX__ +#define LDBL_EPSILON __LDBL_EPSILON__ -#define LDBL_MANT_DIG 113 -#define LDBL_MIN_EXP (-16381) -#define LDBL_MAX_EXP 16384 +#define LDBL_MANT_DIG __LDBL_MANT_DIG__ +#define LDBL_MIN_EXP __LDBL_MIN_EXP__ +#define LDBL_MAX_EXP __LDBL_MAX_EXP__ -#define LDBL_DIG 33 -#define LDBL_MIN_10_EXP (-4931) -#define LDBL_MAX_10_EXP 4932 +#define LDBL_DIG __LDBL_DIG__ +#define LDBL_MIN_10_EXP __LDBL_MIN_10_EXP__ +#define LDBL_MAX_10_EXP __LDBL_MAX_10_EXP__ -#define DECIMAL_DIG 36 +#define DECIMAL_DIG __DECIMAL_DIG__