mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 16:47:37 +00:00
Check ARCH=.... variable
to prevent user errors or generating untested code, check explicitly that the ARCH variable is equivalent to a supported architecture as listed in `make help`. To nevertheless compile for an untested target the user can override the internal variable, passing the undocumented `SUPPORTED_ARCH=true` to make. closes https://github.com/official-stockfish/Stockfish/pull/3062 No functional change.
This commit is contained in:
+14
-3
@@ -85,8 +85,15 @@ endif
|
|||||||
|
|
||||||
### 2.1. General and architecture defaults
|
### 2.1. General and architecture defaults
|
||||||
|
|
||||||
ifeq ($(ARCH),)
|
# explicitly check for the list of supported architectures (as listed with make help),
|
||||||
empty_arch = yes
|
# the user can override with `make ARCH=x86-32-vnni256 SUPPORTED_ARCH=true`
|
||||||
|
ifeq ($(ARCH),$(filter $(ARCH),x86-64-vnni512 x86-64-vnni256 x86-64-avx512 x86-64-bmi2 x86-64-avx2 \
|
||||||
|
x86-64-sse41-popcnt x86-64-modern x86-64-ssse3 x86-64-sse3-popcnt \
|
||||||
|
x86-64 x86-32-sse41-popcnt x86-32-sse2 x86-32 ppc-64 ppc-32 \
|
||||||
|
armv7 armv7-neon armv8 apple-silicon general-64 general-32))
|
||||||
|
SUPPORTED_ARCH=true
|
||||||
|
else
|
||||||
|
SUPPORTED_ARCH=false
|
||||||
endif
|
endif
|
||||||
|
|
||||||
optimize = yes
|
optimize = yes
|
||||||
@@ -625,6 +632,7 @@ endif
|
|||||||
### Section 4. Public Targets
|
### Section 4. Public Targets
|
||||||
### ==========================================================================
|
### ==========================================================================
|
||||||
|
|
||||||
|
|
||||||
help:
|
help:
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo "To compile stockfish, type: "
|
@echo "To compile stockfish, type: "
|
||||||
@@ -684,10 +692,12 @@ help:
|
|||||||
@echo "make -j profile-build ARCH=x86-64-bmi2 COMP=gcc COMPCXX=g++-9.0"
|
@echo "make -j profile-build ARCH=x86-64-bmi2 COMP=gcc COMPCXX=g++-9.0"
|
||||||
@echo "make -j build ARCH=x86-64-ssse3 COMP=clang"
|
@echo "make -j build ARCH=x86-64-ssse3 COMP=clang"
|
||||||
@echo ""
|
@echo ""
|
||||||
ifneq ($(empty_arch), yes)
|
|
||||||
@echo "-------------------------------"
|
@echo "-------------------------------"
|
||||||
|
ifeq ($(SUPPORTED_ARCH), true)
|
||||||
@echo "The selected architecture $(ARCH) will enable the following configuration: "
|
@echo "The selected architecture $(ARCH) will enable the following configuration: "
|
||||||
@$(MAKE) ARCH=$(ARCH) COMP=$(COMP) config-sanity
|
@$(MAKE) ARCH=$(ARCH) COMP=$(COMP) config-sanity
|
||||||
|
else
|
||||||
|
@echo "Specify a supported architecture with the ARCH option for more details"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
@@ -802,6 +812,7 @@ config-sanity:
|
|||||||
@test "$(debug)" = "yes" || test "$(debug)" = "no"
|
@test "$(debug)" = "yes" || test "$(debug)" = "no"
|
||||||
@test "$(sanitize)" = "undefined" || test "$(sanitize)" = "thread" || test "$(sanitize)" = "address" || test "$(sanitize)" = "no"
|
@test "$(sanitize)" = "undefined" || test "$(sanitize)" = "thread" || test "$(sanitize)" = "address" || test "$(sanitize)" = "no"
|
||||||
@test "$(optimize)" = "yes" || test "$(optimize)" = "no"
|
@test "$(optimize)" = "yes" || test "$(optimize)" = "no"
|
||||||
|
@test "$(SUPPORTED_ARCH)" = "true"
|
||||||
@test "$(arch)" = "any" || test "$(arch)" = "x86_64" || test "$(arch)" = "i386" || \
|
@test "$(arch)" = "any" || test "$(arch)" = "x86_64" || test "$(arch)" = "i386" || \
|
||||||
test "$(arch)" = "ppc64" || test "$(arch)" = "ppc" || \
|
test "$(arch)" = "ppc64" || test "$(arch)" = "ppc" || \
|
||||||
test "$(arch)" = "armv7" || test "$(arch)" = "armv8" || test "$(arch)" = "arm64"
|
test "$(arch)" = "armv7" || test "$(arch)" = "armv8" || test "$(arch)" = "arm64"
|
||||||
|
|||||||
Reference in New Issue
Block a user