From d7aa2fe9d7efc30591e22ddcd276e85f1d13e9d2 Mon Sep 17 00:00:00 2001 From: Alessandro Gatti Date: Sat, 1 Jun 2024 11:49:38 +0200 Subject: [PATCH] lib/libm: Define _IEEE_LIBM only if not set. fdilibm was originally meant to see _IEEE_LIBM defined from outside the libm code, not it being hardcoded in. Picolibc assumes this assumption holds true and attempts to define itself, conflicting with the existing definition. Signed-off-by: Alessandro Gatti --- lib/libm/wf_lgamma.c | 2 ++ lib/libm/wf_tgamma.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/libm/wf_lgamma.c b/lib/libm/wf_lgamma.c index 834a4de48..4b07a7289 100644 --- a/lib/libm/wf_lgamma.c +++ b/lib/libm/wf_lgamma.c @@ -24,7 +24,9 @@ */ #include "fdlibm.h" +#ifndef _IEEE_LIBM #define _IEEE_LIBM 1 +#endif #ifdef __STDC__ float lgammaf(float x) diff --git a/lib/libm/wf_tgamma.c b/lib/libm/wf_tgamma.c index 3ff05f331..1a6c74ca1 100644 --- a/lib/libm/wf_tgamma.c +++ b/lib/libm/wf_tgamma.c @@ -24,7 +24,9 @@ #include "math.h" #include "fdlibm.h" +#ifndef _IEEE_LIBM #define _IEEE_LIBM 1 +#endif #ifdef __STDC__ float tgammaf(float x)