From 7b257524a40be3c77fcd4f1f7b1f7691c4344b38 Mon Sep 17 00:00:00 2001 From: Steven Noonan Date: Wed, 17 Oct 2018 14:27:24 -0700 Subject: [PATCH] makefile_base: use -march=nocona instead of individual -m$isa flags Also use instruction scheduling model for Haswell if available. Signed-off-by: Steven Noonan --- build/makefile_base.mak | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build/makefile_base.mak b/build/makefile_base.mak index 611f8a16..ad2bf38f 100644 --- a/build/makefile_base.mak +++ b/build/makefile_base.mak @@ -47,6 +47,10 @@ endif export CC export CXX +cc-option = $(shell if test -z "`echo 'void*p=1;' | \ + $(1) $(2) -S -o /dev/null -xc - 2>&1 | grep -- $(2) -`"; \ + then echo "$(2)"; else echo "$(3)"; fi ;) + # Selected container mode shell DOCKER_SHELL_BASE = docker run --rm --init -v $(HOME):$(HOME) -w $(CURDIR) -e HOME=$(HOME) \ -v /etc/passwd:/etc/passwd:ro -u $(shell id -u):$(shell id -g) -h $(shell hostname) \ @@ -132,7 +136,7 @@ STRIP := strip WINE32_AUTOCONF := WINE64_AUTOCONF := -OPTIMIZE_FLAGS := -O2 -mmmx -msse -msse2 -mfpmath=sse +OPTIMIZE_FLAGS := -O2 -march=nocona $(call cc-option,$(CC),-mtune=core-avx2,) -mfpmath=sse # Use $(call QUOTE,$(VAR)) to flatten a list to a single element (for feeding to a shell)