[compiler-rt] [llvm] [compiler-rt] Allow define MACOS_ARM_SUPPORT from cmake to skip the c… (PR #127019)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 13 04:38:56 PST 2025
https://github.com/trcrsired updated https://github.com/llvm/llvm-project/pull/127019
>From 5e17d5ca811fc1a401594d0eb0af44c89fa3133e Mon Sep 17 00:00:00 2001
From: cqwrteur <100043421+trcrsired at users.noreply.github.com>
Date: Thu, 13 Feb 2025 02:50:33 -0500
Subject: [PATCH] [compiler-rt] Allow define MACOS_ARM_SUPPORT from cmake to
skip the check
This is for cross compiling from other OS like linux to Mac to skip the check
[macos] Fix cross compile with CMAKE_LIBTOOL
if CMAKE_LIBTOOL is defined, we should include(UseLibtool) like
compiler-rt does for llvm and its runtimes
---
compiler-rt/cmake/builtin-config-ix.cmake | 4 +++-
llvm/CMakeLists.txt | 2 +-
runtimes/CMakeLists.txt | 2 +-
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/compiler-rt/cmake/builtin-config-ix.cmake b/compiler-rt/cmake/builtin-config-ix.cmake
index b1bde47ec8555..465b0fbd4c357 100644
--- a/compiler-rt/cmake/builtin-config-ix.cmake
+++ b/compiler-rt/cmake/builtin-config-ix.cmake
@@ -129,7 +129,9 @@ if(APPLE)
set(DARWIN_osx_BUILTIN_ALL_POSSIBLE_ARCHS ${X86} ${X86_64})
# Add support for arm64 macOS if available in SDK.
foreach(arch ${ARM64})
- sdk_has_arch_support(${DARWIN_osx_SYSROOT} macosx ${arch} MACOS_ARM_SUPPORT)
+ if(NOT MACOS_ARM_SUPPORT)
+ sdk_has_arch_support(${DARWIN_osx_SYSROOT} macosx ${arch} MACOS_ARM_SUPPORT)
+ endif()
if (MACOS_ARM_SUPPORT)
list(APPEND DARWIN_osx_BUILTIN_ALL_POSSIBLE_ARCHS ${arch})
endif()
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index f5293e8663243..8abe421598817 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -943,7 +943,7 @@ if (LLVM_BUILD_STATIC)
endif()
# Use libtool instead of ar if you are both on an Apple host, and targeting Apple.
-if(CMAKE_HOST_APPLE AND APPLE)
+if((CMAKE_HOST_APPLE OR CMAKE_LIBTOOL) AND APPLE)
include(UseLibtool)
endif()
diff --git a/runtimes/CMakeLists.txt b/runtimes/CMakeLists.txt
index 4a6b317a03f66..fe6bb81c4f22a 100644
--- a/runtimes/CMakeLists.txt
+++ b/runtimes/CMakeLists.txt
@@ -216,7 +216,7 @@ option(LLVM_INCLUDE_DOCS "Generate build targets for the runtimes documentation.
option(LLVM_ENABLE_SPHINX "Use Sphinx to generate the runtimes documentation." OFF)
# Use libtool instead of ar if you are both on an Apple host, and targeting Apple.
-if(CMAKE_HOST_APPLE AND APPLE)
+if((CMAKE_HOST_APPLE OR CMAKE_LIBTOOL) AND APPLE)
include(UseLibtool)
endif()
More information about the llvm-commits
mailing list