From daddee0bb479137a3e95a1a16f1c93906a1511ec Mon Sep 17 00:00:00 2001 From: Uwe Klotz Date: Tue, 26 Jan 2021 19:10:03 +0100 Subject: [PATCH 1/6] Fix typo in ARM build options --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 20f9f6f4423..e72f46adeaf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -203,7 +203,7 @@ elseif(GNU_GCC OR LLVM_CLANG) # https://stackoverflow.com/questions/45917280/mac-osx-minumum-support-sse-version elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm") add_compile_options( - -mflat-abi=hard + -mfloat-abi=hard -mfpu=neon ) endif() From ed512347d85ff09e7563a442154b42f4691c257a Mon Sep 17 00:00:00 2001 From: Uwe Klotz Date: Tue, 26 Jan 2021 19:11:16 +0100 Subject: [PATCH 2/6] Improve detection of ARM architectures --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e72f46adeaf..4efbef6afe3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -201,7 +201,7 @@ elseif(GNU_GCC OR LLVM_CLANG) # TODO(rryan): macOS can use SSE3, and possibly SSE 4.1 once # we require macOS 10.12. # https://stackoverflow.com/questions/45917280/mac-osx-minumum-support-sse-version - elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm") + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|AARCH64|arm|ARM).*") add_compile_options( -mfloat-abi=hard -mfpu=neon @@ -224,7 +224,7 @@ elseif(GNU_GCC OR LLVM_CLANG) # Note: requires gcc >= 4.2.0 # macros like __SSE2_MATH__ __SSE_MATH__ __SSE2__ __SSE__ # are set automatically - if(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm") + if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|AARCH64|arm|ARM).*") add_compile_options( -mfloat-abi=hard -mfpu=neon From fd73c110980b21f9a3a3d972729a4f5885dfa34f Mon Sep 17 00:00:00 2001 From: Uwe Klotz Date: Tue, 26 Jan 2021 19:55:11 +0100 Subject: [PATCH 3/6] Remove capital ARM architecture names --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4efbef6afe3..462c5a0bebb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -201,7 +201,7 @@ elseif(GNU_GCC OR LLVM_CLANG) # TODO(rryan): macOS can use SSE3, and possibly SSE 4.1 once # we require macOS 10.12. # https://stackoverflow.com/questions/45917280/mac-osx-minumum-support-sse-version - elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|AARCH64|arm|ARM).*") + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm).*") add_compile_options( -mfloat-abi=hard -mfpu=neon @@ -224,7 +224,7 @@ elseif(GNU_GCC OR LLVM_CLANG) # Note: requires gcc >= 4.2.0 # macros like __SSE2_MATH__ __SSE_MATH__ __SSE2__ __SSE__ # are set automatically - if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|AARCH64|arm|ARM).*") + if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm).*") add_compile_options( -mfloat-abi=hard -mfpu=neon From 1a68935e0f59a91281b9fb524037ecb09585c274 Mon Sep 17 00:00:00 2001 From: Uwe Klotz Date: Tue, 26 Jan 2021 21:40:17 +0100 Subject: [PATCH 4/6] Don't use ARMv7 build options for AArch64 --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 462c5a0bebb..4395139570d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -201,7 +201,7 @@ elseif(GNU_GCC OR LLVM_CLANG) # TODO(rryan): macOS can use SSE3, and possibly SSE 4.1 once # we require macOS 10.12. # https://stackoverflow.com/questions/45917280/mac-osx-minumum-support-sse-version - elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm).*") + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm.*") add_compile_options( -mfloat-abi=hard -mfpu=neon @@ -224,7 +224,7 @@ elseif(GNU_GCC OR LLVM_CLANG) # Note: requires gcc >= 4.2.0 # macros like __SSE2_MATH__ __SSE_MATH__ __SSE2__ __SSE__ # are set automatically - if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm).*") + if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm.*") add_compile_options( -mfloat-abi=hard -mfpu=neon From 71a2531c0dfdd3b23a43c776c882b696ef93b95a Mon Sep 17 00:00:00 2001 From: Uwe Klotz Date: Tue, 26 Jan 2021 22:54:53 +0100 Subject: [PATCH 5/6] Restrict compile options to ARMv7 --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4395139570d..98e2e12a3a5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -201,7 +201,7 @@ elseif(GNU_GCC OR LLVM_CLANG) # TODO(rryan): macOS can use SSE3, and possibly SSE 4.1 once # we require macOS 10.12. # https://stackoverflow.com/questions/45917280/mac-osx-minumum-support-sse-version - elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm.*") + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm|armv7.*)") # but not armv8 add_compile_options( -mfloat-abi=hard -mfpu=neon @@ -224,7 +224,7 @@ elseif(GNU_GCC OR LLVM_CLANG) # Note: requires gcc >= 4.2.0 # macros like __SSE2_MATH__ __SSE_MATH__ __SSE2__ __SSE__ # are set automatically - if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm.*") + if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm|armv7.*)") # but not armv8 add_compile_options( -mfloat-abi=hard -mfpu=neon From e846a7a496e7de49ef0d7fb3ffc8737f770699de Mon Sep 17 00:00:00 2001 From: Uwe Klotz Date: Tue, 26 Jan 2021 23:01:16 +0100 Subject: [PATCH 6/6] Add end-of-line matcher ...just in case and for consistency --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 98e2e12a3a5..5497717caf9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -201,7 +201,7 @@ elseif(GNU_GCC OR LLVM_CLANG) # TODO(rryan): macOS can use SSE3, and possibly SSE 4.1 once # we require macOS 10.12. # https://stackoverflow.com/questions/45917280/mac-osx-minumum-support-sse-version - elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm|armv7.*)") # but not armv8 + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm|armv7.*)$") # but not armv8 add_compile_options( -mfloat-abi=hard -mfpu=neon @@ -224,7 +224,7 @@ elseif(GNU_GCC OR LLVM_CLANG) # Note: requires gcc >= 4.2.0 # macros like __SSE2_MATH__ __SSE_MATH__ __SSE2__ __SSE__ # are set automatically - if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm|armv7.*)") # but not armv8 + if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm|armv7.*)$") # but not armv8 add_compile_options( -mfloat-abi=hard -mfpu=neon