From 034cd675286db07110a773fdb6a857285485d2d4 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 18 Dec 2024 18:58:34 +0800 Subject: [PATCH] Don't use glibc when testing with Clang Clang has its own and doesn't use from glibc. Pass "-I." to compiler only if $($( Reviewed-by: Sam James --- Makeconfig | 3 ++- include/tgmath.h | 8 +++++++- math/Makefile | 24 ++++++++++++++++++------ 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/Makeconfig b/Makeconfig index d33369eaaf..02a3d371b6 100644 --- a/Makeconfig +++ b/Makeconfig @@ -1031,7 +1031,8 @@ endif # current directory. +includes = -I$(..)include $(if $(subdir),$(objpfx:%/=-I%)) \ $(+sysdep-includes) $(includes) \ - $(patsubst %/,-I%,$(..)) $(libio-include) -I. $(sysincludes) + $(patsubst %/,-I%,$(..)) $(libio-include) \ + $(if $($( +/* NB: Clang has its own and doesn't use from + glibc. */ +#if defined _ISOMAC && defined __clang__ +# include_next +#else +# include +#endif diff --git a/math/Makefile b/math/Makefile index 36fe5c2bd4..d262de8bee 100644 --- a/math/Makefile +++ b/math/Makefile @@ -510,7 +510,6 @@ tests = \ $(tests-static) \ bug-nextafter \ bug-nexttoward \ - bug-tgmath1 \ test-ceil-except-2 \ test-femode \ test-femode-traps \ @@ -548,15 +547,18 @@ tests = \ test-signgam-ullong \ test-signgam-ullong-init \ test-snan \ - test-tgmath \ - test-tgmath-int \ - test-tgmath-ret \ - test-tgmath2 \ test-trunc-except-2 \ tst-CMPLX \ tst-CMPLX2 \ tst-definitions \ # tests +tests-tgmath = \ + bug-tgmath1 \ + test-tgmath \ + test-tgmath-int \ + test-tgmath-ret \ + test-tgmath2 \ + # tests-tgmath ifneq ($(config-cflags-signaling-nans),) tests += \ test-fe-snans-always-signal \ @@ -1026,7 +1028,9 @@ tgmath3-macros = \ ufromfpx \ # tgmath3-macros tgmath3-macro-tests = $(addprefix test-tgmath3-,$(tgmath3-macros)) -tests += $(tgmath3-macro-tests) +tests-tgmath += $(tgmath3-macro-tests) +tests += $(tests-tgmath) + generated += $(addsuffix .c,$(tgmath3-macro-tests)) $(tgmath3-macro-tests:%=$(objpfx)%.o): CFLAGS += -fno-builtin @@ -1043,6 +1047,14 @@ $(objpfx)test-tgmath3-macro-list.out: gen-tgmath-tests.py $(PYTHON) $< check-list $(tgmath3-macros) > $@; \ $(evaluate-test) +ifeq ($(have-test-clang),yes) +# NB: Clang has its own and doesn't use from glibc. +define no-include +$(1).c-no-include-dot = yes +endef +$(foreach m,$(tests-tgmath),$(eval $(call no-include,$(m)))) +endif + libm-test-fast-math-cflags = -fno-builtin -D__FAST_MATH__ -DTEST_FAST_MATH libm-test-vec-cflags = $(libm-test-fast-math-cflags) -fno-inline \ -ffloat-store -D_OPENMP=201307 -Wno-unknown-pragmas