This is an automated email from the ASF dual-hosted git repository.
alexey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git
The following commit(s) were added to refs/heads/master by this push:
new 71e2ba276 [CMakeLists] clean-up ARCH_NAME conditions for x86_64
71e2ba276 is described below
commit 71e2ba276c6bb4d429fa642e8ff93a626036365b
Author: Alexey Serbin <[email protected]>
AuthorDate: Mon Oct 9 17:22:51 2023 -0700
[CMakeLists] clean-up ARCH_NAME conditions for x86_64
This patch simplifies the criteria based on ARCH_NAME in CMakeLists.
Change-Id: Iced035819fc54035d4cb654f4c206c3bd85aa660
Reviewed-on: http://gerrit.cloudera.org:8080/20552
Tested-by: Kudu Jenkins
Reviewed-by: Yingchun Lai <[email protected]>
---
CMakeLists.txt | 13 +++++++------
src/kudu/gutil/CMakeLists.txt | 2 +-
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5493cce1e..d4c9f4fc7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -177,21 +177,22 @@ include(CompilerInfo)
# compiler flags that are common across debug/release builds
execute_process(COMMAND uname -m OUTPUT_VARIABLE ARCH_NAME)
message(STATUS "Found ARCH_NAME: ${ARCH_NAME}")
-# The Apple backend for aarch64 is called arm64.
-# Rename to aarch64 to simplify all of our build checks.
if("${ARCH_NAME}" MATCHES "arm64")
+ # The Apple backend for aarch64 is called arm64.
+ # Change ARCH_NAME to aarch64 to simplify all of our build checks.
set(ARCH_NAME "aarch64")
endif()
message(STATUS "Using ARCH_NAME: ${ARCH_NAME}")
-if("${ARCH_NAME}" MATCHES "aarch64")
+
+if("${ARCH_NAME}" MATCHES "x86_64")
+ # -msse4.2: Enable sse4.2 compiler intrinsics on x86_64
+ set(CXX_COMMON_FLAGS "-msse4.2")
+elseif("${ARCH_NAME}" MATCHES "aarch64")
# Certain platforms such as ARM do not use signed chars by default
# which causes issues with certain bounds checks.
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -fsigned-char")
# Turn off fp-contract on aarch64 to avoid multiply-add operation result
difference.
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -ffp-contract=off")
-elseif( NOT ( "${ARCH_NAME}" MATCHES "ppc64le" ))
- # -msse4.2: Enable sse4.2 compiler intrinsics.
- set(CXX_COMMON_FLAGS "-msse4.2")
endif()
# -Wall: Enable all warnings.
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wall")
diff --git a/src/kudu/gutil/CMakeLists.txt b/src/kudu/gutil/CMakeLists.txt
index 137904791..3b8d60d78 100644
--- a/src/kudu/gutil/CMakeLists.txt
+++ b/src/kudu/gutil/CMakeLists.txt
@@ -50,7 +50,7 @@ set(GUTIL_SRCS
utf/rune.c
walltime.cc)
-if (NOT "${ARCH_NAME}" MATCHES "aarch64" AND NOT "${ARCH_NAME}" MATCHES
"ppc64le")
+if ("${ARCH_NAME}" MATCHES "x86_64")
set(GUTIL_SRCS
atomicops-internals-x86.cc
${GUTIL_SRCS})