Skip to content

Commit facb82f

Browse files
committed
disable LTO for s2n
1 parent 82d28e2 commit facb82f

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

cpp/cmake_modules/ThirdpartyToolchain.cmake

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4871,11 +4871,18 @@ macro(build_awssdk)
48714871
BUILD_BYPRODUCTS ${AWS_LC_STATIC_LIBRARY})
48724872
add_dependencies(AWS::crypto aws_lc_ep)
48734873

4874+
set(S2N_TLS_C_FLAGS ${EP_C_FLAGS})
4875+
string(APPEND S2N_TLS_C_FLAGS " -Wno-error=overlength-strings -Wno-error=pedantic")
4876+
# Link time optimization is causing trouble like #34349
4877+
string(REPLACE "-flto=auto" "" S2N_TLS_C_FLAGS "${S2N_TLS_C_FLAGS}")
4878+
string(REPLACE "-ffat-lto-objects" "" S2N_TLS_C_FLAGS "${S2N_TLS_C_FLAGS}")
4879+
48744880
set(S2N_TLS_CMAKE_ARGS ${AWSSDK_COMMON_CMAKE_ARGS})
48754881
list(APPEND
48764882
S2N_TLS_CMAKE_ARGS
48774883
-DS2N_INTERN_LIBCRYPTO=ON # internalize libcrypto to avoid name conflict with openssl
4878-
-DCMAKE_PREFIX_PATH=${AWS_LC_PREFIX}) # path to find crypto provided by aws-lc
4884+
-DCMAKE_PREFIX_PATH=${AWS_LC_PREFIX} # path to find crypto provided by aws-lc
4885+
-DCMAKE_C_FLAGS=${S2N_TLS_C_FLAGS})
48794886

48804887
externalproject_add(s2n_tls_ep
48814888
${EP_COMMON_OPTIONS}
@@ -4885,9 +4892,6 @@ macro(build_awssdk)
48854892
BUILD_BYPRODUCTS ${S2N_TLS_STATIC_LIBRARY}
48864893
DEPENDS aws_lc_ep)
48874894
add_dependencies(AWS::s2n-tls s2n_tls_ep)
4888-
set_property(TARGET AWS::s2n-tls
4889-
APPEND
4890-
PROPERTY INTERFACE_LINK_LIBRARIES OpenSSL::Crypto OpenSSL::SSL)
48914895
endif()
48924896

48934897
externalproject_add(aws_c_cal_ep

0 commit comments

Comments
 (0)