Skip to content
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

Prebuild aws lc #817

Merged
merged 75 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from 70 commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
d44e4ac
Prebuild aws-lc
sfodagain Aug 12, 2024
fda36fe
fixup
sfodagain Aug 12, 2024
f6c3021
Update submodules
sfodagain Aug 12, 2024
096b3b7
Merge branch 'main' into prebuild-aws-lc
sfodagain Oct 8, 2024
62452b4
Fix naming
sfodagain Oct 8, 2024
4960428
Try without PERL_EXECUTABLE
sfodagain Oct 8, 2024
2199d06
Comment out another PERL_EXECUTABLE
sfodagain Oct 8, 2024
cf27dc5
Debug android
sfodagain Oct 8, 2024
c38275d
Pass android vars
sfodagain Oct 8, 2024
bd89df2
Pass more android options
sfodagain Oct 9, 2024
91c194f
lc compiles, but s2n fails to find it
sfodagain Oct 9, 2024
e54a749
Add debug message
sfodagain Oct 9, 2024
d0fd2ca
More debugging
sfodagain Oct 9, 2024
942f076
Add scan
sfodagain Oct 9, 2024
93b7f35
Debugging
sfodagain Oct 9, 2024
534ed54
Print CMAKE_SYSROOT
sfodagain Oct 9, 2024
1241d2f
Print cmake vars
sfodagain Oct 10, 2024
198e541
Set CMAKE_FIND_ROOT_PATH
sfodagain Oct 10, 2024
be1cc06
Remove debugging
sfodagain Oct 10, 2024
79ec2e6
Capture cmd vars and pass them to prebuild
sfodagain Oct 10, 2024
1a66e3a
Print cmd vars
sfodagain Oct 11, 2024
98201c8
Debugging
sfodagain Oct 11, 2024
3e80ac9
Set all vars explicitly
sfodagain Oct 11, 2024
b19e243
Back to working version
sfodagain Oct 11, 2024
ea3fddf
Add more vars
sfodagain Oct 11, 2024
992fe2c
debugging
sfodagain Oct 11, 2024
e2f70bb
More vars
sfodagain Oct 11, 2024
b2eacf9
More vars
sfodagain Oct 11, 2024
b1a5f6d
Set cmake generator
sfodagain Oct 11, 2024
897dc6a
Remove debugging
sfodagain Oct 11, 2024
9dcea61
CLean up
sfodagain Oct 11, 2024
e8b31fa
test get_cmake_property
xiazhvera Oct 16, 2024
f85ad04
Revert "test get_cmake_property"
xiazhvera Oct 16, 2024
f59bcdb
Merge branch 'main' into prebuild-aws-lc
sfodagain Oct 24, 2024
eecbf05
Remove unnecessary flags
sfodagain Oct 29, 2024
2cc1092
Forward command line vars for all builds
sfodagain Oct 29, 2024
d310793
Ignore some cmd line vars that
sfodagain Nov 4, 2024
a628d21
Dump aws-lc cmake args
sfodagain Nov 4, 2024
6f5e9c1
Debugging
sfodagain Nov 4, 2024
f9ca281
Debugging
sfodagain Nov 4, 2024
527559a
Fix var name
sfodagain Nov 4, 2024
e578a65
Debug build
sfodagain Nov 4, 2024
eb79bb4
Try to pass everything to lc
sfodagain Nov 4, 2024
ba7be8b
Try to disable warnings
sfodagain Nov 4, 2024
f80623f
Enable perl
sfodagain Nov 4, 2024
697f90c
Debugging
sfodagain Nov 4, 2024
f3ca8c6
Merge branch 'main' into prebuild-aws-lc
sfodagain Nov 4, 2024
9b8975c
cleanup
sfodagain Nov 4, 2024
0e08f6c
Remove aws_get_cmd_arguments
sfodagain Nov 5, 2024
d4da307
Use aws-c-common branch with aws_get_cmd_arguments
sfodagain Nov 5, 2024
02e5e59
Include missing AwsGetCmdArguments
sfodagain Nov 5, 2024
156420a
Prebuild aws-lc through pom.xml
sfodagain Nov 6, 2024
1b9d463
Revert aws-c-common
sfodagain Nov 6, 2024
8bfde96
Set CMAKE_FIND_ROOT_PATH
sfodagain Nov 6, 2024
7c41432
Remove aws_get_cmd_arguments
sfodagain Nov 6, 2024
0d6ebbf
Expand comment
sfodagain Nov 6, 2024
97858ca
Merge branch 'main' into prebuild-aws-lc
sfodagain Nov 6, 2024
13ef4a4
Fixing armv7
sfodagain Nov 7, 2024
721bb2e
Another try
sfodagain Nov 7, 2024
3016c66
Revert back to cmd args
sfodagain Nov 7, 2024
1fa032e
Update aws-c-common
sfodagain Nov 7, 2024
3e6c138
Debugging
sfodagain Nov 7, 2024
3327913
Update aws-c-common
sfodagain Nov 7, 2024
4284527
Update aws-c-common
sfodagain Nov 8, 2024
2ac906f
Update aws-c-common
sfodagain Nov 8, 2024
79f3295
Update aws-c-common
sfodagain Nov 8, 2024
1eb97b1
Remove vars handled by aws_prebuild_dependency
sfodagain Nov 8, 2024
a89a6f3
Do not set CMAKE_FIND_ROOT_PATH
sfodagain Nov 8, 2024
20638f6
Update aws-c-common
sfodagain Nov 14, 2024
76f39d9
Update aws-c-common
sfodagain Nov 14, 2024
daa1e3d
Update aws-c-common
sfodagain Nov 25, 2024
0c645cb
Merge branch 'main' into prebuild-aws-lc
sfodagain Nov 27, 2024
43e83aa
Use tag for aws-c-common
sfodagain Nov 27, 2024
1c7118c
Remove unused vars
sfodagain Nov 27, 2024
79fd28d
fips fixup
sfodagain Nov 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,46 +56,46 @@ if (BUILD_DEPS)
set(BUILD_TESTING OFF)
add_subdirectory(crt/aws-c-common)
if (UNIX AND NOT APPLE)
set(BUILD_LIBSSL OFF CACHE BOOL "Don't need libssl, only need libcrypto")
include(AwsPrebuildDependency)

set(AWSLC_CMAKE_ARGUMENTS
-DBUILD_LIBSSL=OFF
-DBUILD_TESTING=OFF
)

message("Build with FIPS: " ${CRT_FIPS})
if (CRT_FIPS)
set(FIPS ON CACHE BOOL "FIPS compliance")
sfod marked this conversation as resolved.
Show resolved Hide resolved
set(PERL_EXECUTABLE "perl")
list(APPEND AWSLC_CMAKE_ARGUMENTS -DFIPS=ON)
list(APPEND AWSLC_CMAKE_ARGUMENTS -DDISABLE_PERL=OFF)

if (DEFINED ENV{GO_PATH})
set(GO_EXECUTABLE $ENV{GO_PATH}/go)
sfod marked this conversation as resolved.
Show resolved Hide resolved
list(APPEND AWSLC_CMAKE_ARGUMENTS -DGO_EXECUTABLE=${GO_EXECUTABLE})
message(STATUS "Overriding GO_EXECUTABLE to ${GO_EXECUTABLE}")
endif()
else()
set(DISABLE_PERL ON CACHE BOOL "Disable codegen")
set(DISABLE_GO ON CACHE BOOL "Disable codegen")
list(APPEND AWSLC_CMAKE_ARGUMENTS -DDISABLE_PERL=ON) # Disable codegen
list(APPEND AWSLC_CMAKE_ARGUMENTS -DDISABLE_GO=ON) # Disable codegen
endif()

if(CMAKE_C_COMPILER_ID MATCHES "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS "5.0")
set(DISABLE_PERL OFF CACHE BOOL "Build with Perl to avoid using pre-compiled binary with AVX512")
set(PERL_EXECUTABLE "perl")
set(MY_ASSEMBLER_IS_TOO_OLD_FOR_512AVX ON CACHE BOOL "Disable AVX512 on old GCC that not supports it")
# Disable AVX512 on old GCC that not supports it
list(APPEND AWSLC_CMAKE_ARGUMENTS -DMY_ASSEMBLER_IS_TOO_OLD_FOR_512AVX=ON)
endif()

# temporarily disable certain warnings as errors for the aws-lc build
set(OLD_CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
if (NOT MSVC)
check_c_compiler_flag(-Wno-stringop-overflow HAS_WNO_STRINGOP_OVERFLOW)
if (HAS_WNO_STRINGOP_OVERFLOW)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-stringop-overflow")
endif()

check_c_compiler_flag(-Wno-array-parameter HAS_WNO_ARRAY_PARAMETER)
if (HAS_WNO_ARRAY_PARAMETER)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-array-parameter")
endif()
if (ANDROID)
list(APPEND AWSLC_CMAKE_ARGUMENTS -DANDROID_DEPS_DIR=${ANDROID_DEPS_DIR})
list(APPEND AWSLC_CMAKE_ARGUMENTS -DAWS_LIBRARY_OUTPUT_DIR="${AWS_LIBRARY_OUTPUT_DIR}")
endif()

add_subdirectory(crt/aws-lc)

# restore previous build flags
set(CMAKE_C_FLAGS "${OLD_CMAKE_C_FLAGS}")
# s2n-tls uses libcrypto during its configuration, so we need to prebuild aws-lc.
aws_prebuild_dependency(
DEPENDENCY_NAME AWSLC
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/crt/aws-lc
CMAKE_ARGUMENTS ${AWSLC_CMAKE_ARGUMENTS}
)

set(SEARCH_LIBCRYPTO OFF CACHE BOOL "Let S2N use libcrypto from AWS-LC.")
set(UNSAFE_TREAT_WARNINGS_AS_ERRORS OFF CACHE BOOL "Disable warnings-as-errors when building S2N")
add_subdirectory(crt/s2n)
endif()
Expand Down
Loading