From dbef4ca96794552a1af21bf190eab10cf0d8a6f7 Mon Sep 17 00:00:00 2001 From: Roman Gershman Date: Tue, 29 Aug 2023 18:24:29 +0300 Subject: [PATCH] fix: make Dragonfly compatible with older systems (#1755) Change the Makefile to configure the compile to produce code compatible with core2 architecture for x86_64 systems. Plus specify precise CPU extensions that we use in the code. Partly addresses #1519 Before the change we relied on default helio logic that configured the build to run on sandybridge for x86_64. This PR overrides x86_64 settings to much older core2 processor. Also, we remove an unneeded cmake include. Signed-off-by: Roman Gershman --- CMakeLists.txt | 2 -- Makefile | 7 ++++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f1f8452a1..e9d00d618 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,5 +36,3 @@ include_directories(helio) add_subdirectory(helio) add_subdirectory(src) - -include(cmake/Packing.cmake) diff --git a/Makefile b/Makefile index b8c9b1ac1..dff72b955 100644 --- a/Makefile +++ b/Makefile @@ -8,11 +8,16 @@ HELIO_OPENSSL_USE_STATIC_LIBS = ON HELIO_ENABLE_GIT_VERSION = ON HELIO_WITH_UNWIND = OFF +# equivalent to: if $(uname_m) == x86_64 || $(uname_m) == amd64 +ifneq (, $(filter $(BUILD_ARCH),x86_64 amd64)) +HELIO_MARCH_OPT := -march=core2 -msse4.1 -mpopcnt -mtune=skylake +endif + HELIO_FLAGS = $(if $(HELIO_RELEASE),-release $(HELIO_RELEASE_FLAGS),) \ -DBoost_USE_STATIC_LIBS=$(HELIO_USE_STATIC_LIBS) \ -DOPENSSL_USE_STATIC_LIBS=$(HELIO_OPENSSL_USE_STATIC_LIBS) \ -DENABLE_GIT_VERSION=$(HELIO_ENABLE_GIT_VERSION) \ - -DWITH_UNWIND=$(HELIO_WITH_UNWIND) \ + -DWITH_UNWIND=$(HELIO_WITH_UNWIND) -DMARCH_OPT="$(HELIO_MARCH_OPT)" .PHONY: default