Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ARM build issues #3602

Merged
merged 6 commits into from
Jan 26, 2021
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@ 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 "^arm.*")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This regex does not work now, because it matches a "armv8b" which is a arm64. This means it matches some arm64.
Please revert to the original and add a comment why this is correct.
Something like:
// CMAKE_SYSTEM_PROCESSOR is just "arm" for all 32 bit ARMs. These flags are not valid with AArch64 and ARMv8 targets where CMAKE_SYSTEM_PROCESSOR is one of ("aarch64_be (arm64)", "aarch64 (arm64)", "armv8b (arm64 compat)" and "armv8l (arm64 compat)".

add_compile_options(
-mflat-abi=hard
uklotzde marked this conversation as resolved.
Show resolved Hide resolved
-mfloat-abi=hard
-mfpu=neon
)
endif()
Expand All @@ -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 "^arm.*")
add_compile_options(
-mfloat-abi=hard
-mfpu=neon
Expand Down