This is an automated email from the ASF dual-hosted git repository.
wangdan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pegasus.git
The following commit(s) were added to refs/heads/master by this push:
new e09804161 fix: fix build failure on Apple M chips (#2252)
e09804161 is described below
commit e09804161e521ed1f5a133f6bfd5078cd4df435a
Author: Yingchun Lai <[email protected]>
AuthorDate: Thu May 22 11:04:02 2025 +0800
fix: fix build failure on Apple M chips (#2252)
Fix the build failure on MacOS with M chips, the error is:
```
c++: error: unsupported option '-msse4.1' for target
'arm64-apple-darwin24.4.0'
```
Add the patch from
https://github.com/abseil/abseil-cpp/commit/26ee072e14dea17fa8870d47cd7e8b4cc1c95e93
---
thirdparty/CMakeLists.txt | 1 +
thirdparty/fix_absl_build_on_macos_arm64.patch | 13 +++++++++++++
2 files changed, 14 insertions(+)
diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt
index ecdf8af5c..d8f7899df 100644
--- a/thirdparty/CMakeLists.txt
+++ b/thirdparty/CMakeLists.txt
@@ -123,6 +123,7 @@ ExternalProject_Add(abseil
URL ${OSS_URL_PREFIX}/abseil-20230802.1.zip
https://github.com/abseil/abseil-cpp/archive/refs/tags/20230802.1.zip
URL_MD5 5c6193dbc82834f8e762c6a28c9cc615
+ PATCH_COMMAND patch -p1 < ${TP_DIR}/fix_absl_build_on_macos_arm64.patch
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${TP_OUTPUT}
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DABSL_FIND_GOOGLETEST=OFF
diff --git a/thirdparty/fix_absl_build_on_macos_arm64.patch
b/thirdparty/fix_absl_build_on_macos_arm64.patch
new file mode 100644
index 000000000..f29a57c3f
--- /dev/null
+++ b/thirdparty/fix_absl_build_on_macos_arm64.patch
@@ -0,0 +1,13 @@
+diff --git a/absl/copts/AbseilConfigureCopts.cmake
b/absl/copts/AbseilConfigureCopts.cmake
+index 3f737c81..8b0c3240 100644
+--- a/absl/copts/AbseilConfigureCopts.cmake
++++ b/absl/copts/AbseilConfigureCopts.cmake
+@@ -42,7 +42,7 @@ if(APPLE AND CMAKE_CXX_COMPILER_ID MATCHES [[Clang]])
+ string(TOUPPER "${_arch}" _arch_uppercase)
+ string(REPLACE "X86_64" "X64" _arch_uppercase ${_arch_uppercase})
+ foreach(_flag IN LISTS ABSL_RANDOM_HWAES_${_arch_uppercase}_FLAGS)
+- list(APPEND ABSL_RANDOM_RANDEN_COPTS "-Xarch_${_arch}" "${_flag}")
++ list(APPEND ABSL_RANDOM_RANDEN_COPTS "SHELL:-Xarch_${_arch} ${_flag}")
+ endforeach()
+ endforeach()
+ # If a compiler happens to deal with an argument for a currently unused
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]