X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=makefile.inc;h=90e2bf86aaca8a5e9853a262f3a182c0b45a2a69;hb=540acd33401d3d6dd53cd38c1f68b1a345477ed2;hp=f613591e1f2044d708078f4daa2acff16f75841d;hpb=49f0e1cbc8bc4ea8a165e8b86092c40bf4599a8e;p=xonotic%2Fdarkplaces.git diff --git a/makefile.inc b/makefile.inc index f613591e..90e2bf86 100644 --- a/makefile.inc +++ b/makefile.inc @@ -18,15 +18,13 @@ CC?=gcc # 686 (Pentium Pro/II) optimizations #CPUOPTIMIZATIONS?=-march=i686 # No specific CPU (386 compatible) -#CPUOPTIMIZATIONS?= -# Experimental -#CPUOPTIMIZATIONS?=-fno-math-errno -fno-rounding-math -fno-signaling-nans -fassociative-math -freciprocal-math -fno-signed-zeros -fno-trapping-math -# Normal -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 +CPUOPTIMIZATIONS?= +# x86 +ifeq ($(DP_SSE),1) + CPUOPTIMIZATIONS+=-mno-avx endif +# bones_was_here: added -mno-avx because when compiling for (at least) haswell or skylake with gcc or clang, with both -O2 and -O3, AVX auto-vectorisation causes subtle bugs in Xonotic QC physics, and changes the hash generated by the CI pipeline. AVX2 seems to be OK. +# Also moved -fno-math-errno -fno-trapping-math (etc) to OPTIM_RELEASE as they're not CPU-specific. # 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; @@ -37,9 +35,9 @@ SDLCONFIG_UNIXLIBS?=`$(SDL_CONFIG) --libs` SDLCONFIG_UNIXLIBS_X11?=-lX11 SDLCONFIG_UNIXSTATICLIBS?=`$(SDL_CONFIG) --static-libs` SDLCONFIG_UNIXSTATICLIBS_X11?=-lX11 -SDLCONFIG_MACOSXCFLAGS=-I/Library/Frameworks/SDL2.framework/Headers -I$(HOME)/Library/Frameworks/SDL2.framework/Headers -SDLCONFIG_MACOSXLIBS=-F$(HOME)/Library/Frameworks/ -framework SDL2 -framework Cocoa $(SDLCONFIG_MACOSXCFLAGS) -SDLCONFIG_MACOSXSTATICLIBS=-F$(HOME)/Library/Frameworks/ -framework SDL2 -framework Cocoa $(SDLCONFIG_MACOSXCFLAGS) +SDLCONFIG_MACOSXCFLAGS=$(SDLCONFIG_UNIXCFLAGS) +SDLCONFIG_MACOSXLIBS=$(SDLCONFIG_UNIXLIBS) +SDLCONFIG_MACOSXSTATICLIBS=$(SDLCONFIG_UNIXSTATICLIBS) STRIP?=strip @@ -80,6 +78,7 @@ OBJ_COMMON= \ com_ents.o \ com_ents4.o \ com_game.o \ + com_infostring.o \ com_msg.o \ common.o \ console.o \ @@ -117,6 +116,7 @@ OBJ_COMMON= \ model_sprite.o \ netconn.o \ palette.o \ + phys.o \ polygon.o \ portals.o \ protocol.o \ @@ -200,7 +200,8 @@ OPTIM_DEBUG=$(CPUOPTIMIZATIONS) #OPTIM_RELEASE=-O2 -fno-strict-aliasing -fno-math-errno -fno-trapping-math -fno-signaling-nans -fcx-limited-range -funroll-loops $(CPUOPTIMIZATIONS) #OPTIM_RELEASE=-O2 -fno-strict-aliasing -funroll-loops $(CPUOPTIMIZATIONS) #OPTIM_RELEASE=-O2 -fno-strict-aliasing $(CPUOPTIMIZATIONS) -OPTIM_RELEASE=-O3 -fno-strict-aliasing $(CPUOPTIMIZATIONS) +#OPTIM_RELEASE=-O3 -fno-strict-aliasing $(CPUOPTIMIZATIONS) +OPTIM_RELEASE=-O3 -fno-strict-aliasing -fno-math-errno -fno-trapping-math $(CPUOPTIMIZATIONS) # 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; @@ -242,7 +243,7 @@ LDFLAGS_LINUXSDL=$(LDFLAGS_UNIXCOMMON) -lrt -ldl $(LDFLAGS_UNIXSDL) # Link LDFLAGS_MACOSXSV=$(LDFLAGS_UNIXCOMMON) -ldl -LDFLAGS_MACOSXSDL=$(LDFLAGS_UNIXCOMMON) -ldl -framework IOKit $(SDLCONFIG_STATICLIBS) ../../../SDLMain.m +LDFLAGS_MACOSXSDL=$(LDFLAGS_UNIXCOMMON) -ldl -framework IOKit $(SDLCONFIG_STATICLIBS) #../../../SDLMain.m ##### SunOS specific variables #####