From 69a154be28b416c33c5d030c22d6eb11671e8459 Mon Sep 17 00:00:00 2001 From: Dengke Date: Fri, 30 Aug 2024 13:39:44 -0700 Subject: [PATCH 01/13] apply the change from aws-c-auth --- crt/aws-c-auth | 2 +- test/test_websocket.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/crt/aws-c-auth b/crt/aws-c-auth index 52bf59161..4164e0584 160000 --- a/crt/aws-c-auth +++ b/crt/aws-c-auth @@ -1 +1 @@ -Subproject commit 52bf591613d1a001c43ec99af7376f871759c5fe +Subproject commit 4164e0584f2ff6166c8d11af01970c98a84b5afe diff --git a/test/test_websocket.py b/test/test_websocket.py index b0e748b24..17de0a92d 100644 --- a/test/test_websocket.py +++ b/test/test_websocket.py @@ -467,7 +467,6 @@ def test_send_receive_data(self): self.assertIsNone(handler.exception) def test_send_frame_exceptions(self): - init_logging(LogLevel.Trace, 'stderr') with WebSocketServer(self.host, self.port) as server: handler = ClientHandler() handler.connect_sync(self.host, self.port) From fb9867d550c6b3af1ea4541d6229f35709b4d196 Mon Sep 17 00:00:00 2001 From: Dengke Date: Tue, 3 Sep 2024 12:00:37 -0700 Subject: [PATCH 02/13] test aws-lc main --- crt/CMakeLists.txt | 3 +++ crt/aws-lc | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/crt/CMakeLists.txt b/crt/CMakeLists.txt index 99296e6e7..8e2bbe8da 100644 --- a/crt/CMakeLists.txt +++ b/crt/CMakeLists.txt @@ -39,6 +39,9 @@ if(UNIX AND NOT APPLE) if(CMAKE_C_COMPILER_ID MATCHES "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS "5.0") set(MY_ASSEMBLER_IS_TOO_OLD_FOR_512AVX ON CACHE BOOL "Disable AVX512 on old GCC that not supports it") endif() + if(CMAKE_SYSTEM_PROCESSOR_LOWER MATCHES "x86|i386|i686") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2") + endif() add_subdirectory(aws-lc) endif() diff --git a/crt/aws-lc b/crt/aws-lc index 057477806..173bd098e 160000 --- a/crt/aws-lc +++ b/crt/aws-lc @@ -1 +1 @@ -Subproject commit 05747780676652f41d0b9c570a495e4bb6608560 +Subproject commit 173bd098e45232b8aef36abb3770ab3f4583badf From 8294818c63aae9399fc40014bc2cda2007140568 Mon Sep 17 00:00:00 2001 From: Dengke Date: Tue, 3 Sep 2024 12:07:30 -0700 Subject: [PATCH 03/13] hmmm? --- crt/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crt/CMakeLists.txt b/crt/CMakeLists.txt index 8e2bbe8da..4a299bb0e 100644 --- a/crt/CMakeLists.txt +++ b/crt/CMakeLists.txt @@ -42,6 +42,8 @@ if(UNIX AND NOT APPLE) if(CMAKE_SYSTEM_PROCESSOR_LOWER MATCHES "x86|i386|i686") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2") endif() + message(STATUS "XXXXXXXXX CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}") + add_subdirectory(aws-lc) endif() From 1cec29985447470657afed7a58c379475cd0f9f4 Mon Sep 17 00:00:00 2001 From: Dengke Date: Tue, 3 Sep 2024 12:10:43 -0700 Subject: [PATCH 04/13] is the check wrong? --- crt/CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crt/CMakeLists.txt b/crt/CMakeLists.txt index 4a299bb0e..3fa73f27b 100644 --- a/crt/CMakeLists.txt +++ b/crt/CMakeLists.txt @@ -39,9 +39,8 @@ if(UNIX AND NOT APPLE) if(CMAKE_C_COMPILER_ID MATCHES "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS "5.0") set(MY_ASSEMBLER_IS_TOO_OLD_FOR_512AVX ON CACHE BOOL "Disable AVX512 on old GCC that not supports it") endif() - if(CMAKE_SYSTEM_PROCESSOR_LOWER MATCHES "x86|i386|i686") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2") - endif() + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2") + message(STATUS "XXXXXXXXX CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}") From c77a84b8a40c55f203e2665cddc9e21a4fbb50c3 Mon Sep 17 00:00:00 2001 From: Dengke Date: Tue, 3 Sep 2024 13:00:21 -0700 Subject: [PATCH 05/13] GNU and x86 --- crt/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crt/CMakeLists.txt b/crt/CMakeLists.txt index 3fa73f27b..9710c1ebe 100644 --- a/crt/CMakeLists.txt +++ b/crt/CMakeLists.txt @@ -39,9 +39,11 @@ if(UNIX AND NOT APPLE) if(CMAKE_C_COMPILER_ID MATCHES "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS "5.0") set(MY_ASSEMBLER_IS_TOO_OLD_FOR_512AVX ON CACHE BOOL "Disable AVX512 on old GCC that not supports it") endif() - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2") - + if(CMAKE_C_COMPILER_ID MATCHES "GNU" AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86|X86|i386|i686") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2") + endif() message(STATUS "XXXXXXXXX CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}") + message(STATUS "XXXXXXXXX CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}") add_subdirectory(aws-lc) From dcbb5575301756cf4a8b8d453f64b9bf61a2bf78 Mon Sep 17 00:00:00 2001 From: Dengke Date: Tue, 3 Sep 2024 13:17:48 -0700 Subject: [PATCH 06/13] copy the check from aws-lc --- crt/CMakeLists.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/crt/CMakeLists.txt b/crt/CMakeLists.txt index 9710c1ebe..6308dc7d4 100644 --- a/crt/CMakeLists.txt +++ b/crt/CMakeLists.txt @@ -39,13 +39,14 @@ if(UNIX AND NOT APPLE) if(CMAKE_C_COMPILER_ID MATCHES "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS "5.0") set(MY_ASSEMBLER_IS_TOO_OLD_FOR_512AVX ON CACHE BOOL "Disable AVX512 on old GCC that not supports it") endif() - if(CMAKE_C_COMPILER_ID MATCHES "GNU" AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86|X86|i386|i686") + + string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" CMAKE_SYSTEM_PROCESSOR_LOWER) + + if(CMAKE_SYSTEM_PROCESSOR_LOWER MATCHES "x86_64|amd64" AND CMAKE_SIZEOF_VOID_P EQUAL 4 OR CMAKE_SYSTEM_PROCESSOR_LOWER MATCHES "x86|i386|i686") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2") endif() - message(STATUS "XXXXXXXXX CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}") - message(STATUS "XXXXXXXXX CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}") - + message(STATUS "XXXXXXXXX CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}") add_subdirectory(aws-lc) endif() From 00dedb162a05f76c59ae6e06e4744604552f0431 Mon Sep 17 00:00:00 2001 From: Dengke Date: Tue, 3 Sep 2024 13:21:18 -0700 Subject: [PATCH 07/13] clean it up and add comments --- crt/CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crt/CMakeLists.txt b/crt/CMakeLists.txt index 6308dc7d4..1e1e33ace 100644 --- a/crt/CMakeLists.txt +++ b/crt/CMakeLists.txt @@ -41,12 +41,11 @@ if(UNIX AND NOT APPLE) endif() string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" CMAKE_SYSTEM_PROCESSOR_LOWER) - - if(CMAKE_SYSTEM_PROCESSOR_LOWER MATCHES "x86_64|amd64" AND CMAKE_SIZEOF_VOID_P EQUAL 4 OR CMAKE_SYSTEM_PROCESSOR_LOWER MATCHES "x86|i386|i686") + if(CMAKE_SYSTEM_PROCESSOR_LOWER MATCHES "x86_64|amd64|x86|i386|i686" AND CMAKE_SIZEOF_VOID_P EQUAL 4) + # Add -msse2 for x86 because of https://github.com/aws/aws-lc/commit/6fe8dcbe96e580ea85233fdb98a142e42951b70b set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2") endif() - message(STATUS "XXXXXXXXX CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}") add_subdirectory(aws-lc) endif() From 530d51b27333d4f4f8ed187c1c887f5419322bb3 Mon Sep 17 00:00:00 2001 From: Dengke Date: Tue, 3 Sep 2024 13:25:00 -0700 Subject: [PATCH 08/13] submodules --- crt/aws-c-auth | 2 +- crt/aws-c-cal | 2 +- crt/aws-c-compression | 2 +- crt/aws-lc | 2 +- crt/s2n | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crt/aws-c-auth b/crt/aws-c-auth index 4164e0584..877c029fc 160000 --- a/crt/aws-c-auth +++ b/crt/aws-c-auth @@ -1 +1 @@ -Subproject commit 4164e0584f2ff6166c8d11af01970c98a84b5afe +Subproject commit 877c029fc4e93d205f9c6855188c3c51f6b497b4 diff --git a/crt/aws-c-cal b/crt/aws-c-cal index 77ca3aea8..2cb1d2eac 160000 --- a/crt/aws-c-cal +++ b/crt/aws-c-cal @@ -1 +1 @@ -Subproject commit 77ca3aea879bc768082fe7ec715adcde8e98c332 +Subproject commit 2cb1d2eac925e2dbc45025eb89af82bd790c23a0 diff --git a/crt/aws-c-compression b/crt/aws-c-compression index ea1d421a4..f36d01672 160000 --- a/crt/aws-c-compression +++ b/crt/aws-c-compression @@ -1 +1 @@ -Subproject commit ea1d421a421ad83a540309a94c38d50b6a5d836b +Subproject commit f36d01672d61e49d96a777870d456f66fa391cd4 diff --git a/crt/aws-lc b/crt/aws-lc index 173bd098e..2f1879759 160000 --- a/crt/aws-lc +++ b/crt/aws-lc @@ -1 +1 @@ -Subproject commit 173bd098e45232b8aef36abb3770ab3f4583badf +Subproject commit 2f1879759b2e0fc70592665bdf10087b64f44b7d diff --git a/crt/s2n b/crt/s2n index 79c0f1b43..87f4a0585 160000 --- a/crt/s2n +++ b/crt/s2n @@ -1 +1 @@ -Subproject commit 79c0f1b434742d9f1152c48d3781433649f6f8fe +Subproject commit 87f4a0585dc3056433f193b9305f587cff239be3 From f52c214df75f262c82bb15d071c97fcc0d49075a Mon Sep 17 00:00:00 2001 From: Dengke Date: Tue, 3 Sep 2024 13:33:16 -0700 Subject: [PATCH 09/13] use latest aws-c-auth --- crt/aws-c-auth | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crt/aws-c-auth b/crt/aws-c-auth index 877c029fc..1de544597 160000 --- a/crt/aws-c-auth +++ b/crt/aws-c-auth @@ -1 +1 @@ -Subproject commit 877c029fc4e93d205f9c6855188c3c51f6b497b4 +Subproject commit 1de544597e9739f689e8ad2c055a86656856b3eb From 94dfebfec0fe99165f0734796b6ce5e022cb705b Mon Sep 17 00:00:00 2001 From: Dengke Date: Wed, 4 Sep 2024 09:19:46 -0700 Subject: [PATCH 10/13] add comments --- crt/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crt/CMakeLists.txt b/crt/CMakeLists.txt index 1e1e33ace..f09a533ed 100644 --- a/crt/CMakeLists.txt +++ b/crt/CMakeLists.txt @@ -42,7 +42,10 @@ if(UNIX AND NOT APPLE) 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) - # Add -msse2 for x86 because of https://github.com/aws/aws-lc/commit/6fe8dcbe96e580ea85233fdb98a142e42951b70b + # Add -msse2 for x86-32bit because of https://github.com/aws/aws-lc/commit/6fe8dcbe96e580ea85233fdb98a142e42951b70b + # In some cases such as when building in Docker, where the host-level architecture is 64-bit + # but the Docker image should result in building for a 32-bit architecture. So that when ARCH + # is originally detected as 64-bit,perform an additional check to determine whether to build as 32-bit or 64-bit. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2") endif() From af6950bb8446173ffaecb91d69401c6e8b73338e Mon Sep 17 00:00:00 2001 From: Dengke Date: Wed, 4 Sep 2024 09:21:01 -0700 Subject: [PATCH 11/13] missing space --- crt/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crt/CMakeLists.txt b/crt/CMakeLists.txt index f09a533ed..afbf3eec9 100644 --- a/crt/CMakeLists.txt +++ b/crt/CMakeLists.txt @@ -45,7 +45,7 @@ if(UNIX AND NOT APPLE) # Add -msse2 for x86-32bit because of https://github.com/aws/aws-lc/commit/6fe8dcbe96e580ea85233fdb98a142e42951b70b # In some cases such as when building in Docker, where the host-level architecture is 64-bit # but the Docker image should result in building for a 32-bit architecture. So that when ARCH - # is originally detected as 64-bit,perform an additional check to determine whether to build as 32-bit or 64-bit. + # is originally detected as 64-bit, perform an additional check to determine whether to build as 32-bit or 64-bit. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2") endif() From 5114b54683b4e6a9ce19086b57399703b2108dc7 Mon Sep 17 00:00:00 2001 From: Dengke Date: Wed, 4 Sep 2024 13:38:25 -0700 Subject: [PATCH 12/13] update the comments --- crt/CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crt/CMakeLists.txt b/crt/CMakeLists.txt index afbf3eec9..7773a2637 100644 --- a/crt/CMakeLists.txt +++ b/crt/CMakeLists.txt @@ -43,9 +43,10 @@ if(UNIX AND NOT APPLE) 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) # Add -msse2 for x86-32bit because of https://github.com/aws/aws-lc/commit/6fe8dcbe96e580ea85233fdb98a142e42951b70b - # In some cases such as when building in Docker, where the host-level architecture is 64-bit - # but the Docker image should result in building for a 32-bit architecture. So that when ARCH - # is originally detected as 64-bit, perform an additional check to determine whether to build as 32-bit or 64-bit. + # 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. + # So, check for both CMAKE_SIZEOF_VOID_P and CMAKE_SYSTEM_PROCESSOR_LOWER for x86-32bit set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2") endif() From c8dcb53169012a23e6015f13570665d9059fe0ed Mon Sep 17 00:00:00 2001 From: Dengke Date: Wed, 4 Sep 2024 13:46:42 -0700 Subject: [PATCH 13/13] that's better --- crt/CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crt/CMakeLists.txt b/crt/CMakeLists.txt index 7773a2637..25e7d1891 100644 --- a/crt/CMakeLists.txt +++ b/crt/CMakeLists.txt @@ -43,9 +43,8 @@ if(UNIX AND NOT APPLE) 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) # Add -msse2 for x86-32bit because of https://github.com/aws/aws-lc/commit/6fe8dcbe96e580ea85233fdb98a142e42951b70b - # 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. + # 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 # So, check for both CMAKE_SIZEOF_VOID_P and CMAKE_SYSTEM_PROCESSOR_LOWER for x86-32bit set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2") endif()