From c04586afb1069bf5c6bbd2f3a47cc19524015a55 Mon Sep 17 00:00:00 2001 From: cloudwalk Date: Thu, 4 Jun 2020 16:03:45 +0000 Subject: [PATCH] Disable unsupported compiler optimization if CC=clang git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12636 d7cf8633-e32d-0410-b094-e92efae38249 --- makefile.inc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/makefile.inc b/makefile.inc index 9bcac173..b43af1b0 100644 --- a/makefile.inc +++ b/makefile.inc @@ -22,7 +22,11 @@ CC?=gcc # Experimental #CPUOPTIMIZATIONS?=-fno-math-errno -fno-rounding-math -fno-signaling-nans -fassociative-math -freciprocal-math -fno-signed-zeros -fno-trapping-math # Normal -CPUOPTIMIZATIONS?=-fno-math-errno -fno-rounding-math -fno-signaling-nans -fno-trapping-math +ifeq ($(CC), clang) + CPUOPTIMIZATIONS?=-fno-math-errno -fno-rounding-math -fno-trapping-math +else + CPUOPTIMIZATIONS?=-fno-math-errno -fno-rounding-math -fno-signaling-nans -fno-trapping-math +endif # NOTE: *never* *ever* use the -ffast-math or -funsafe-math-optimizations flag # Also, since gcc 5, -ffinite-math-only makes NaN and zero compare equal inside engine code but not inside QC, which causes error spam for seemingly valid QC code like if (x != 0) return 1 / x; -- 2.39.2