Skip to content

Commit

Permalink
[openssl] Fix build for Android x86.
Browse files Browse the repository at this point in the history
OpenSSL3 uses atomics that are broken on clang for Android x86.
This commit fixes the build by disabling usage of these atomics on Android x86 only.

This fixes microsoft#24021.

Signed-off-by: Vitalii Koshura <[email protected]>
  • Loading branch information
AenBleidd committed May 19, 2022
1 parent 2f0872b commit bd7f0fc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ports/openssl/unix/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ if (CMAKE_OSX_DEPLOYMENT_TARGET AND CMAKE_C_OSX_DEPLOYMENT_TARGET_FLAG)
elseif((CMAKE_SYSTEM_NAME STREQUAL "Darwin") AND (VCPKG_TARGET_ARCHITECTURE MATCHES "arm64"))
set(CFLAGS "${CFLAGS} -mmacosx-version-min=11.0")
endif()
# clang for Android x86 has a crappy implementation of atomics
if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_SYSTEM_NAME STREQUAL "Android" AND VCPKG_TARGET_ARCHITECTURE MATCHES "x86")
set(CFLAGS "${CFLAGS} -DBROKEN_CLANG_ATOMICS")
endif()

string(REGEX REPLACE "^ " "" CFLAGS "${CFLAGS}")

Expand Down
2 changes: 1 addition & 1 deletion ports/openssl/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "openssl",
"version": "3.0.3",
"port-version": 2,
"port-version": 3,
"description": "OpenSSL is an open source project that provides a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It is also a general-purpose cryptography library.",
"homepage": "https://www.openssl.org",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -5182,7 +5182,7 @@
},
"openssl": {
"baseline": "3.0.3",
"port-version": 2
"port-version": 3
},
"openssl-unix": {
"baseline": "1.1.1h",
Expand Down
5 changes: 5 additions & 0 deletions versions/o-/openssl.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "f72e602e3fde9d592c2f8d01c4ca0ed21c4df63b",
"version": "3.0.3",
"port-version": 3
},
{
"git-tree": "cdd8b7c5c9ebba05598bc90a58f224f13cf0b611",
"version": "3.0.3",
Expand Down

0 comments on commit bd7f0fc

Please sign in to comment.