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
Build on 10.6.8 Rosetta uses ABSL_RANDOM_HWAES_X64_FLAGS despite OSX_ARCHITECTURES = ppc #1227
Comments
|
Relying on To compile with CMake, you might need add support for your processor, e.g.: diff --git a/absl/copts/AbseilConfigureCopts.cmake b/absl/copts/AbseilConfigureCopts.cmake
index 73435e99..beff32cf 100644
--- a/absl/copts/AbseilConfigureCopts.cmake
+++ b/absl/copts/AbseilConfigureCopts.cmake
@@ -66,6 +66,8 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm.*|aarch64")
else()
message(WARNING "Value of CMAKE_SIZEOF_VOID_P (${CMAKE_SIZEOF_VOID_P}) is not supported.")
endif()
+elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc|ppc64")
+ set(ABSL_RANDOM_RANDEN_COPTS "${ABSL_RANDOM_HWAES_PPC_FLAGS}")
else()
message(WARNING "Value of CMAKE_SYSTEM_PROCESSOR (${CMAKE_SYSTEM_PROCESSOR}) is unknown and cannot be used to set ABSL_RANDOM_RANDEN_COPTS")
set(ABSL_RANDOM_RANDEN_COPTS "") Then set |
@anpol This is exactly what I tried, and it does not work. Cmake somehow forces cpu_arch instead, and applies Intel AES flags. I tried now changing my patch from
Looks good. And then it fails:
The only way that I found to be working is this: #1272 (the patch quoted there, not PR commits). |
Looks like you can't set You might need to ask CMake community about setting that variable properly. Probably you need to create a toolchain file. Their docs says that you have to set CMAKE_SYSTEM_NAME to trigger cross-compiling. |
@anpol Thank you. Well, I have solved the problem for myself via changing to CMAKE_OSX_ARCHITECTURES (in CMakeLists), but if I find a better solution that can be general, I open a separate PR. P. S. Often passing -DCMAKE_SYSTEM_PROCESSOR= via configure works fine. This is likely an issue of how the build system is set up here, not with Cmake as such. |
Describe the bug
I am building
abseil
on 10.6.8 Rosetta forppc
(well, in fact I has built it, but with an ugly solution of just editing away Intel flags). Despite Cmake correctly recognizingOSX_ARCHITECTURES="ppc"
, it still pulls out Intel HWAES flags, which obviously cause a failure.I tried specifying
CMAKE_SYSTEM_PROCESSOR=ppc
and tried a couple of patches to the source code, but nothing helped.Removing away flags in question from
abseil-abseil-cpp-273292d/absl/copts/GENERATED_AbseilCopts.cmake
solved the issue, at least on the surface, but it is clearly a bad solution.What is required is to ensure
ppc
is used all through, with nox86
setting pulled over.This chunk of code causes the problem:
What version of Abseil are you using?
What operating system and version are you using
10.6.8 Rosetta (build for
ppc32
), Xcode 3.2.6What compiler and version are you using?
What build system are you using?
I use Macports and
cmake-devel
3.24.0-rc4.The text was updated successfully, but these errors were encountered: