From: Martin Kroeker Date: Tue, 27 Aug 2019 20:52:17 +0000 (+0200) Subject: Do not abuse the global ARCH variable as a local temporary X-Git-Tag: upstream/0.3.21~30^2~95^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3635fdbf2bfbb3bd56a7fb3e0c1a1e21ef4d0b72;p=platform%2Fupstream%2Fopenblas.git Do not abuse the global ARCH variable as a local temporary Setting it with a simple "uname -m" just to be able to decide whether to compile getarch.c with -march=native may actually keep getarch from doing a proper probe. Fixes #2231, a regression caused by #2110 --- diff --git a/Makefile.system b/Makefile.system index a54282f..fe6be79 100644 --- a/Makefile.system +++ b/Makefile.system @@ -9,9 +9,11 @@ ifndef TOPDIR TOPDIR = . endif -# If ARCH is not set, we use the host system's architecture. +# If ARCH is not set, we use the host system's architecture for getarch compile options. ifndef ARCH -ARCH := $(shell uname -m) +HOSTARCH := $(shell uname -m) +else +HOSTARCH = $(ARCH) endif # Catch conflicting usage of ARCH in some BSD environments @@ -143,7 +145,7 @@ endif # On x86_64 build getarch with march=native unless the compiler is PGI. This is required to detect AVX512 support in getarch. -ifeq ($(ARCH), x86_64) +ifeq ($(HOSTARCH), x86_64) ifeq ($(findstring pgcc,$(HOSTCC)),) GETARCH_FLAGS += -march=native endif