-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Support cpuid for win32 #8339
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
Support cpuid for win32 #8339
Changes from 6 commits
308cb23
e8c4bf1
0ecb635
64cca2f
1322613
bb4f63c
158eead
74f2c15
d2d3d63
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4626,7 +4626,7 @@ component_test_m32_o0 () { | |
# build) and not the i386-specific inline assembly. | ||
msg "build: i386, make, gcc -O0 (ASan build)" # ~ 30s | ||
scripts/config.py full | ||
scripts/config.py unset MBEDTLS_AESNI_C # AESNI depends on cpu modifiers | ||
scripts/config.py unset MBEDTLS_AESNI_C # AESNI for 32-bit is tested in test_aesni_m32 | ||
make CC=gcc CFLAGS="$ASAN_CFLAGS -m32 -O0" LDFLAGS="-m32 $ASAN_CFLAGS" | ||
|
||
msg "test: i386, make, gcc -O0 (ASan build)" | ||
|
@@ -4644,7 +4644,7 @@ component_test_m32_o2 () { | |
# and go faster for tests. | ||
msg "build: i386, make, gcc -O2 (ASan build)" # ~ 30s | ||
scripts/config.py full | ||
scripts/config.py unset MBEDTLS_AESNI_C # AESNI depends on cpu modifiers | ||
scripts/config.py unset MBEDTLS_AESNI_C # AESNI for 32-bit is tested in test_aesni_m32 | ||
make CC=gcc CFLAGS="$ASAN_CFLAGS -m32 -O2" LDFLAGS="-m32 $ASAN_CFLAGS" | ||
|
||
msg "test: i386, make, gcc -O2 (ASan build)" | ||
|
@@ -4660,7 +4660,7 @@ support_test_m32_o2 () { | |
component_test_m32_everest () { | ||
msg "build: i386, Everest ECDH context (ASan build)" # ~ 6 min | ||
scripts/config.py set MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED | ||
scripts/config.py unset MBEDTLS_AESNI_C # AESNI depends on cpu modifiers | ||
scripts/config.py unset MBEDTLS_AESNI_C # AESNI for 32-bit is tested in test_aesni_m32 | ||
make CC=gcc CFLAGS="$ASAN_CFLAGS -m32 -O2" LDFLAGS="-m32 $ASAN_CFLAGS" | ||
|
||
msg "test: i386, Everest ECDH context - main suites (inc. selftests) (ASan build)" # ~ 50s | ||
|
@@ -5114,14 +5114,24 @@ component_test_tls13_only_record_size_limit () { | |
|
||
component_build_mingw () { | ||
msg "build: Windows cross build - mingw64, make (Link Library)" # ~ 30s | ||
scripts/config.py unset MBEDTLS_AESNI_C # AESNI depends on cpu modifiers | ||
make CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar LD=i686-w64-minggw32-ld CFLAGS='-Werror -Wall -Wextra' WINDOWS_BUILD=1 lib programs | ||
make CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar LD=i686-w64-minggw32-ld CFLAGS='-Werror -Wall -Wextra -maes -msse2 -mpclmul' WINDOWS_BUILD=1 lib programs | ||
|
||
# note Make tests only builds the tests, but doesn't run them | ||
make CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar LD=i686-w64-minggw32-ld CFLAGS='-Werror' WINDOWS_BUILD=1 tests | ||
make CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar LD=i686-w64-minggw32-ld CFLAGS='-Werror -maes -msse2 -mpclmul' WINDOWS_BUILD=1 tests | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change should be replace with Pragma or function attribute in future. |
||
make WINDOWS_BUILD=1 clean | ||
|
||
msg "build: Windows cross build - mingw64, make (DLL)" # ~ 30s | ||
make CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar LD=i686-w64-minggw32-ld CFLAGS='-Werror -Wall -Wextra -maes -msse2 -mpclmul' WINDOWS_BUILD=1 SHARED=1 lib programs | ||
make CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar LD=i686-w64-minggw32-ld CFLAGS='-Werror -Wall -Wextra -maes -msse2 -mpclmul' WINDOWS_BUILD=1 SHARED=1 tests | ||
make WINDOWS_BUILD=1 clean | ||
|
||
msg "build: Windows cross build - mingw64, make (Link Library, default config without MBEDTLS_AESNI_C)" # ~ 30s | ||
./scripts/config.py unset MBEDTLS_AESNI_C # | ||
make CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar LD=i686-w64-minggw32-ld CFLAGS='-Werror -Wall -Wextra' WINDOWS_BUILD=1 lib programs | ||
make CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar LD=i686-w64-minggw32-ld CFLAGS='-Werror' WINDOWS_BUILD=1 tests | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For the config without There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We do not need to test |
||
make WINDOWS_BUILD=1 clean | ||
|
||
msg "build: Windows cross build - mingw64, make (DLL, default config without MBEDTLS_AESNI_C)" # ~ 30s | ||
make CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar LD=i686-w64-minggw32-ld CFLAGS='-Werror -Wall -Wextra' WINDOWS_BUILD=1 SHARED=1 lib programs | ||
make CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar LD=i686-w64-minggw32-ld CFLAGS='-Werror -Wall -Wextra' WINDOWS_BUILD=1 SHARED=1 tests | ||
make WINDOWS_BUILD=1 clean | ||
|
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.
Do we need to
make lib
withoutMBEDTLS_AESNI_C
to check that it works on mingw?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.
Do you mean to test the build of pure C impl of AES? I think they have been covered because
MBEDTLS_AES_USE_HARDWARE_ONLY
is unset in defaul config.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.
Yes, but I mean to check that the C code builds under mingw, which is quite a "strange" environment - just
lib
, notprograms
, which shouldn't take longThere 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.
Sorry, I didn't get the point. We do build
lib
andprograms
and latertests
for both static and dynamic linked libraries in thismingw
test...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.
So with this PR, under mingw we are now building only with
MBEDTLS_AESNI_C
set, and not without it? So we are no longer checking that we build correctly under mingw withoutMBEDTLS_AESNI_C
. If that's right, I think we should add a build oflib
on its own withoutMBEDTLS_AESNI_C