You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by gr...@apache.org on 2020/12/08 21:16:10 UTC

[kudu] 04/05: [build] CMake fixes for Apple ARM builds

This is an automated email from the ASF dual-hosted git repository.

granthenke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit 42e3ae332ab91a713a31c84acb3d256d9b23edd1
Author: Grant Henke <gr...@apache.org>
AuthorDate: Thu Dec 3 09:37:36 2020 -0600

    [build] CMake fixes for Apple ARM builds
    
    This patch includes some small tweaks for CMake when building Kudu on
    Apple ARM architectures. It also includes some logging to help debug an
    issues in the future.
    
    Change-Id: Ifad9a4d272e6d720ac006da313f53490cfd47a9c
    Reviewed-on: http://gerrit.cloudera.org:8080/16816
    Tested-by: Kudu Jenkins
    Reviewed-by: Andrew Wong <aw...@cloudera.com>
---
 CMakeLists.txt                | 14 ++++++++++++--
 src/kudu/gutil/CMakeLists.txt |  2 +-
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7d75ea8..d613233 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -24,8 +24,11 @@ cmake_minimum_required(VERSION 3.11.2)
 
 project(Kudu)
 
-# Print out the CMAKE_OSX_SYSROOT to help debug Apple build issues.
-if (CMAKE_OSX_SYSROOT)
+
+if (APPLE)
+  # Print out the CMAKE_OSX_* variables to help debug Apple build issues.
+  message(STATUS "Using CMAKE_OSX_ARCHITECTURES: ${CMAKE_OSX_ARCHITECTURES}")
+  message(STATUS "Using CMAKE_OSX_DEPLOYMENT_TARGET: ${CMAKE_OSX_DEPLOYMENT_TARGET}")
   message(STATUS "Using CMAKE_OSX_SYSROOT: ${CMAKE_OSX_SYSROOT}")
 endif()
 
@@ -157,6 +160,13 @@ 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")
+  set(ARCH_NAME "aarch64")
+endif()
+message(STATUS "Using ARCH_NAME: ${ARCH_NAME}")
 if("${ARCH_NAME}" MATCHES "aarch64")
   # Certain platforms such as ARM do not use signed chars by default
   # which causes issues with certain bounds checks.
diff --git a/src/kudu/gutil/CMakeLists.txt b/src/kudu/gutil/CMakeLists.txt
index 02808d9..460c975 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 CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
+if (NOT "${ARCH_NAME}" MATCHES "aarch64")
 set(GUTIL_SRCS
   atomicops-internals-x86.cc
   ${GUTIL_SRCS})