From 29336e6b52dd15dbe037805abbbedd64d895f8c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20Negru=C8=9Biu?= Date: Wed, 10 Jul 2024 14:39:59 +0300 Subject: [PATCH] Minor updates to `openssl` vcpkg overlay --- vcpkg/overlay_ports/openssl/asm-armcap.patch | 96 +++++++++++++++++++ vcpkg/overlay_ports/openssl/portfile.cmake | 1 + .../overlay_ports/openssl/unix/portfile.cmake | 3 +- vcpkg/overlay_ports/openssl/vcpkg.json | 1 + 4 files changed, 99 insertions(+), 2 deletions(-) create mode 100644 vcpkg/overlay_ports/openssl/asm-armcap.patch diff --git a/vcpkg/overlay_ports/openssl/asm-armcap.patch b/vcpkg/overlay_ports/openssl/asm-armcap.patch new file mode 100644 index 0000000..148a718 --- /dev/null +++ b/vcpkg/overlay_ports/openssl/asm-armcap.patch @@ -0,0 +1,96 @@ +diff --git a/crypto/armv4cpuid.pl b/crypto/armv4cpuid.pl +index 04b342551c..9b933c70c4 100644 +--- a/crypto/armv4cpuid.pl ++++ b/crypto/armv4cpuid.pl +@@ -293,6 +293,7 @@ atomic_add_spinlock: + #endif + + .extern OPENSSL_armcap_P ++.hidden OPENSSL_armcap_P + ___ + + print $code; +diff --git a/crypto/bn/asm/armv4-gf2m.pl b/crypto/bn/asm/armv4-gf2m.pl +index 17af0e0774..5733a01746 100644 +--- a/crypto/bn/asm/armv4-gf2m.pl ++++ b/crypto/bn/asm/armv4-gf2m.pl +@@ -326,6 +326,7 @@ $code.=<<___; + + #if __ARM_MAX_ARCH__>=7 + .extern OPENSSL_armcap_P ++.hidden OPENSSL_armcap_P + #endif + ___ + +diff --git a/crypto/bn/asm/armv4-mont.pl b/crypto/bn/asm/armv4-mont.pl +index d85da92406..6e839d845c 100644 +--- a/crypto/bn/asm/armv4-mont.pl ++++ b/crypto/bn/asm/armv4-mont.pl +@@ -750,6 +750,7 @@ $code.=<<___; + .align 2 + #if __ARM_MAX_ARCH__>=7 + .extern OPENSSL_armcap_P ++.hidden OPENSSL_armcap_P + #endif + ___ + +diff --git a/crypto/chacha/asm/chacha-armv4.pl b/crypto/chacha/asm/chacha-armv4.pl +index ac32d5bda7..bb48b6eeb9 100755 +--- a/crypto/chacha/asm/chacha-armv4.pl ++++ b/crypto/chacha/asm/chacha-armv4.pl +@@ -1155,6 +1155,7 @@ $code.=<<___; + ldmia sp!,{r4-r11,pc} + .size ChaCha20_neon,.-ChaCha20_neon + .extern OPENSSL_armcap_P ++.hidden OPENSSL_armcap_P + #endif + ___ + }}} +diff --git a/crypto/poly1305/asm/poly1305-armv4.pl b/crypto/poly1305/asm/poly1305-armv4.pl +index b98beefa18..673ea62ec3 100755 +--- a/crypto/poly1305/asm/poly1305-armv4.pl ++++ b/crypto/poly1305/asm/poly1305-armv4.pl +@@ -1240,6 +1240,7 @@ $code.=<<___; + .align 2 + #if __ARM_MAX_ARCH__>=7 + .extern OPENSSL_armcap_P ++.hidden OPENSSL_armcap_P + #endif + ___ + +diff --git a/crypto/sha/asm/sha1-armv4-large.pl b/crypto/sha/asm/sha1-armv4-large.pl +index 2832c5b530..b3a8ec6941 100644 +--- a/crypto/sha/asm/sha1-armv4-large.pl ++++ b/crypto/sha/asm/sha1-armv4-large.pl +@@ -708,6 +708,7 @@ ___ + $code.=<<___; + #if __ARM_MAX_ARCH__>=7 + .extern OPENSSL_armcap_P ++.hidden OPENSSL_armcap_P + #endif + ___ + +diff --git a/crypto/sha/asm/sha256-armv4.pl b/crypto/sha/asm/sha256-armv4.pl +index 8bac84b1a8..feb1f26109 100644 +--- a/crypto/sha/asm/sha256-armv4.pl ++++ b/crypto/sha/asm/sha256-armv4.pl +@@ -694,6 +694,7 @@ $code.=<<___; + .align 2 + #if __ARM_MAX_ARCH__>=7 && !defined(__KERNEL__) + .extern OPENSSL_armcap_P ++.hidden OPENSSL_armcap_P + #endif + ___ + +diff --git a/crypto/sha/asm/sha512-armv4.pl b/crypto/sha/asm/sha512-armv4.pl +index c8b8110671..9aa310ffd0 100644 +--- a/crypto/sha/asm/sha512-armv4.pl ++++ b/crypto/sha/asm/sha512-armv4.pl +@@ -661,6 +661,7 @@ $code.=<<___; + .align 2 + #if __ARM_MAX_ARCH__>=7 && !defined(__KERNEL__) + .extern OPENSSL_armcap_P ++.hidden OPENSSL_armcap_P + #endif + ___ + diff --git a/vcpkg/overlay_ports/openssl/portfile.cmake b/vcpkg/overlay_ports/openssl/portfile.cmake index ef59bd9..f282aea 100644 --- a/vcpkg/overlay_ports/openssl/portfile.cmake +++ b/vcpkg/overlay_ports/openssl/portfile.cmake @@ -16,6 +16,7 @@ vcpkg_from_github( cmake-config.patch command-line-length.patch script-prefix.patch + asm-armcap.patch windows/install-layout.patch windows/install-pdbs.patch unix/android-cc.patch diff --git a/vcpkg/overlay_ports/openssl/unix/portfile.cmake b/vcpkg/overlay_ports/openssl/unix/portfile.cmake index 72b04e1..98c5dcb 100644 --- a/vcpkg/overlay_ports/openssl/unix/portfile.cmake +++ b/vcpkg/overlay_ports/openssl/unix/portfile.cmake @@ -45,8 +45,7 @@ vcpkg_list(SET MAKEFILE_OPTIONS) if(VCPKG_TARGET_IS_ANDROID) set(ENV{ANDROID_NDK_ROOT} "${VCPKG_DETECTED_CMAKE_ANDROID_NDK}") set(OPENSSL_ARCH "android-${VCPKG_DETECTED_CMAKE_ANDROID_ARCH}") - # asm on arm32 NEON is broken, https://github.com/openssl/openssl/pull/21583#issuecomment-1727057735 - if(VCPKG_DETECTED_CMAKE_ANDROID_ARCH STREQUAL "arm" #[[AND NOT VCPKG_DETECTED_CMAKE_ANDROID_ARM_NEON]]) + if(VCPKG_DETECTED_CMAKE_ANDROID_ARCH STREQUAL "arm" AND NOT VCPKG_DETECTED_CMAKE_ANDROID_ARM_NEON) vcpkg_list(APPEND CONFIGURE_OPTIONS no-asm) endif() elseif(VCPKG_TARGET_IS_LINUX) diff --git a/vcpkg/overlay_ports/openssl/vcpkg.json b/vcpkg/overlay_ports/openssl/vcpkg.json index b890f02..db5592b 100644 --- a/vcpkg/overlay_ports/openssl/vcpkg.json +++ b/vcpkg/overlay_ports/openssl/vcpkg.json @@ -1,6 +1,7 @@ { "name": "openssl", "version": "3.3.1", + "port-version": 1, "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",