-
Notifications
You must be signed in to change notification settings - Fork 43
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
apply the change from aws-c-auth #590
Conversation
@@ -40,6 +40,12 @@ if(UNIX AND NOT APPLE) | |||
set(MY_ASSEMBLER_IS_TOO_OLD_FOR_512AVX ON CACHE BOOL "Disable AVX512 on old GCC that not supports it") | |||
endif() | |||
|
|||
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" CMAKE_SYSTEM_PROCESSOR_LOWER) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added this for aws/aws-lc@6fe8dcb to work on manylinux-1-x86, it's not released yet, but we will need this once it's
@@ -40,6 +40,12 @@ if(UNIX AND NOT APPLE) | |||
set(MY_ASSEMBLER_IS_TOO_OLD_FOR_512AVX ON CACHE BOOL "Disable AVX512 on old GCC that not supports it") | |||
endif() | |||
|
|||
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" CMAKE_SYSTEM_PROCESSOR_LOWER) | |||
if(CMAKE_SYSTEM_PROCESSOR_LOWER MATCHES "x86_64|amd64|x86|i386|i686" AND CMAKE_SIZEOF_VOID_P EQUAL 4) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why doesn't AWS-LC's CMakeLists.txt handle this, vs having every consumer handle it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems weird to include x86_64 and amd64, since those are never 32bit.
And if you take those out, it's all 32-bit architectures, so you don't need to compare pointer size
if(CMAKE_SYSTEM_PROCESSOR_LOWER MATCHES "x86_64|amd64|x86|i386|i686" AND CMAKE_SIZEOF_VOID_P EQUAL 4) | |
if(CMAKE_SYSTEM_PROCESSOR_LOWER MATCHES "^(x86|i386|i686)$") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that aws-lc can still support machine without SSE2 with -DOPENSSL_NO_ASM
to disable the assembly optimization. But, for us, we can assume we don't support 20 years old x86 CPUs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/awslabs/aws-crt-python/actions/runs/10689757684/job/29632625853 line 429
-- XXXXXXXXX CMAKE_SYSTEM_PROCESSOR: x86_64
https://cmake.org/cmake/help/latest/variable/CMAKE_SYSTEM_PROCESSOR.html
this will correspond to the target architecture for the build, but this is not guaranteed. (E.g. on Windows, the host may be AMD64 even when using a MSVC cl compiler with a 32-bit target.)
So, I copied the logic from aws-lc. https://github.com/aws/aws-lc/blob/main/CMakeLists.txt#L791-L800
I'll copy the comments as well probably for clarity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah, I see in the CMAKE_SYSTEM_PROCESSOR docs that it may not be correct (emphasis mine):
In many cases, this will correspond to the target architecture for the build, but this is not guaranteed. (E.g. on Windows, the host may be AMD64 even when using a MSVC cl compiler with a 32-bit target.)
When cross-compiling, a CMAKE_TOOLCHAIN_FILE should set the CMAKE_SYSTEM_PROCESSOR variable to match target architecture that it specifies
Maybe edit the comment to be more like the docs, instead of some ramble about Docker.
Be wary that CMAKE_SYSTEM_PROCESSOR may not correspond to the target architecture when cross-compiling. (E.g. on Windows, the host may be AMD64 even when using a MSVC cl compiler with a 32-bit target). The CMAKE_TOOLCHAIN_FILE is supposed to set it correctly, but may not have.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or just
CMAKE_SYSTEM_PROCESSOR is supposed to match the target architecture when cross-compiling, but this is not guaranteed. See: https://cmake.org/cmake/help/v3.30/variable/CMAKE_SYSTEM_PROCESSOR.html
submodules update:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.