-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Cross-compiling for x86_64 on arm mac fails #970
Comments
is there any workaround for this issue? |
I don't have a machine with the specific configuration needed to test this one. Can someone affected by this issue try derekmauro@6d09f76? |
The workaround does not work. |
Can you share the failing command and the error message? |
I see the same error: My objective was to get things working for Unity Apple Silicon, which uses Workaround: Patching diff --git a/absl/copts/AbseilConfigureCopts.cmake b/absl/copts/AbseilConfigureCopts.cmake
index 9cd6fd1..143f2de 100644
--- a/absl/copts/AbseilConfigureCopts.cmake
+++ b/absl/copts/AbseilConfigureCopts.cmake
@@ -19,7 +19,9 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64|AMD64")
set(ABSL_RANDOM_RANDEN_COPTS "${ABSL_RANDOM_HWAES_X64_FLAGS}")
endif()
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm.*|aarch64")
- if (CMAKE_SIZEOF_VOID_P STREQUAL "8")
+ if(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64")
+ set(ABSL_RANDOM_RANDEN_COPTS "${ABSL_RANDOM_HWAES_X64_FLAGS}")
+ elseif(CMAKE_SIZEOF_VOID_P STREQUAL "8")
set(ABSL_RANDOM_RANDEN_COPTS "${ABSL_RANDOM_HWAES_ARM64_FLAGS}")
elseif(CMAKE_SIZEOF_VOID_P STREQUAL "4")
set(ABSL_RANDOM_RANDEN_COPTS "${ABSL_RANDOM_HWAES_ARM32_FLAGS}") Copy the above using the GitHub copy button, then inside the
As you can see I'm special casing a single architecture build here. I use the following command:
Re: grpc/grpc#28433 To create the multi-arch binaries for |
Describe the bug
When I try to cross-compile for x86_64 from an ARM mac, it fails with
error: unknown target CPU 'armv8-a+crypto'
. It appears thatABSL_RANDOM_HWAES_ARM64_FLAGS
has-march=armv8-a+crypto
and is the cause of this problem.Steps to reproduce the bug
Run
cmake -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 && make ...
on an ARM mac.What version of Abseil are you using?
Latest LTS, 20210324.2
What operating system and version are you using
macOS 11.2.3
What compiler and version are you using?
Apple clang version 12.0.5 (clang-1205.0.22.9)
Target: arm64-apple-darwin20.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
What build system are you using?
cmake version 3.20.3
The text was updated successfully, but these errors were encountered: