From 2be1214e3b1f87478e531c82056a4d9f3c895dc2 Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Wed, 11 Nov 2020 20:37:03 +0100 Subject: [PATCH 01/11] Strip and reorder targets - Adjust target min SDKs to build script - Split opensslconf suffix by platform - Drop old i386 targets --- build-libssl.sh | 191 +++++++++++++++++----------------- config/20-all-platforms.conf | 182 ++++++++++++-------------------- scripts/build-loop-targets.sh | 24 ++--- 3 files changed, 174 insertions(+), 223 deletions(-) diff --git a/build-libssl.sh b/build-libssl.sh index edca774..8b2f84d 100755 --- a/build-libssl.sh +++ b/build-libssl.sh @@ -28,14 +28,20 @@ set -u DEFAULTVERSION="1.1.1h" # Default (=full) set of targets (OpenSSL >= 1.1.1) to build -DEFAULTTARGETS="ios-sim-cross-x86_64 ios64-cross-arm64 ios64-cross-arm64e tvos-sim-cross-x86_64 tvos64-cross-arm64 macos64-x86_64 watchos-cross-armv7k watchos-cross-arm64_32 watchos-sim-cross-i386 watchos-sim-cross-x86_64 mac-catalyst-x86_64" +DEFAULTTARGETS=`cat < { template => 1, cflags => combine('-isysroot $(CROSS_TOP)/SDKs/$(CROSS_SDK) -fno-common', - sub { ((!defined($ENV{'CONFIG_DISABLE_BITCODE'}) || $ENV{'CONFIG_DISABLE_BITCODE'} ne 'true') && defined($ENV{'SDKVERSION'}) && $ENV{'SDKVERSION'} =~ /^(9|[1-9][0-9]+)\./ && $disabled{shared}) - ? '-fembed-bitcode' : (); }, - ), + sub { ((!defined($ENV{'CONFIG_DISABLE_BITCODE'}) || $ENV{'CONFIG_DISABLE_BITCODE'} ne 'true') && defined($ENV{'SDKVERSION'}) && $ENV{'SDKVERSION'} =~ /^(9|[1-9][0-9]+)\./ && $disabled{shared}) + ? '-fembed-bitcode' : (); }, + ), }, - ## Base settings for iOS + ## Base settings "ios-cross-base" => { inherit_from => [ "all-base" ], template => 1, - cflags => add(sub { defined($ENV{'IOS_MIN_SDK_VERSION'}) ? '-mios-version-min=$(IOS_MIN_SDK_VERSION)' : '-mios-version-min=7.0'; }), + cflags => add(sub { defined($ENV{'IOS_MIN_SDK_VERSION'}) ? '-mios-version-min=$(IOS_MIN_SDK_VERSION)' : '-mios-version-min=12.0'; }), }, - - ## Base settings for tvOS - # Defines to skip functionality that uses unsupported functions - "tvos-cross-base" => { - inherit_from => [ "all-base" ], - template => 1, - cflags => add(sub { defined($ENV{'TVOS_MIN_SDK_VERSION'}) ? '-mtvos-version-min=$(TVOS_MIN_SDK_VERSION)' : '-mtvos-version-min=9.0'; }), - defines => [ "HAVE_FORK=0" ], - }, - - ## Base settings for macOS "macos-base" => { inherit_from => [ "all-base" ], template => 1, - cflags => add(sub { defined($ENV{'MACOS_MIN_SDK_VERSION'}) ? '-mmacosx-version-min=$(MACOS_MIN_SDK_VERSION)' : '-mmacosx-version-min=10.11'; }), + cflags => add(sub { defined($ENV{'MACOS_MIN_SDK_VERSION'}) ? '-mmacosx-version-min=$(MACOS_MIN_SDK_VERSION)' : '-mmacosx-version-min=10.15'; }), + }, + "mac-catalyst-base" => { + inherit_from => [ "all-base" ], + template => 1, +# cflags => add(sub { defined($ENV{'CATALYST_MIN_SDK_VERSION'}) ? '-mmacosx-version-min=$(CATALYST_MIN_SDK_VERSION)' : '-mmacosx-version-min=10.15'; }), }, - - ## Apple WatchOS - - ## Base settings for iOS "watchos-cross-base" => { inherit_from => [ "all-base" ], template => 1, cflags => add(sub { defined($ENV{'WATCH_MIN_SDK_VERSION'}) ? '-mwatchos-version-min=$(WATCH_MIN_SDK_VERSION)' : '-mwatchos-version-min=4.0'; }), }, + "tvos-cross-base" => { + inherit_from => [ "all-base" ], + template => 1, + cflags => add(sub { defined($ENV{'TVOS_MIN_SDK_VERSION'}) ? '-mtvos-version-min=$(TVOS_MIN_SDK_VERSION)' : '-mtvos-version-min=12.0'; }), + defines => [ "HAVE_FORK=0" ], + }, + ## Apple iOS + + # Device (arm64) + "ios64-cross-arm64" => { + inherit_from => [ "darwin-common", "ios-cross-base", asm("aarch64_asm") ], + cflags => add("-arch arm64"), + bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR", + perlasm_scheme => "ios64", + sys_id => "iOS", + }, + # Device (arm64e) + "ios64-cross-arm64e" => { + inherit_from => [ "darwin-common", "ios-cross-base", asm("aarch64_asm") ], + cflags => add("-arch arm64e"), + bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR", + perlasm_scheme => "ios64", + sys_id => "iOS", + }, + # Simulator (x86_64) + "ios-sim-cross-x86_64" => { + inherit_from => [ "darwin64-x86_64-cc", "ios-cross-base" ], + sys_id => "iOS", + }, + + ## Apple macOS + + # Device (x86_64) + "macos64-x86_64" => { + inherit_from => [ "darwin64-x86_64-cc", "macos-base" ], + sys_id => "macOS", + }, + # Catalyst (x86_64) + "mac-catalyst-x86_64" => { + inherit_from => [ "darwin64-x86_64-cc", "mac-catalyst-base" ], + cflags => add("-target x86_64-apple-ios13.0-macabi"), + sys_id => "MacOSX", + }, + + ## Apple WatchOS + + # Device "watchos-cross-armv7k" => { inherit_from => [ "darwin-common", "watchos-cross-base", asm("armv7_asm") ], cflags => add("-arch armv7k -fembed-bitcode"), defines => [ "HAVE_FORK=0" ], sys_id => "WatchOS", }, - "watchos-cross-arm64_32" => { inherit_from => [ "darwin-common", "watchos-cross-base"], cflags => add("-arch arm64_32 -fembed-bitcode"), @@ -68,15 +104,7 @@ my %targets = (); defines => [ "HAVE_FORK=0" ], sys_id => "WatchOS", }, - - - "watchos-sim-cross-i386" => { - inherit_from => [ "darwin-common", "watchos-cross-base"], - cflags => add("-arch i386 -fembed-bitcode"), - defines => [ "HAVE_FORK=0" ], - sys_id => "WatchOS", - }, - + # Simulator "watchos-sim-cross-x86_64" => { inherit_from => [ "darwin64-x86_64-cc", "watchos-cross-base"], cflags => add("-fembed-bitcode"), @@ -84,67 +112,9 @@ my %targets = (); sys_id => "WatchOS", }, - ## Apple iOS simulator (x86_64) - # Based on 10-main.conf: iphoneos-cross / darwin64-x86_64-cc - "ios-sim-cross-x86_64" => { - inherit_from => [ "darwin64-x86_64-cc", "ios-cross-base" ], - sys_id => "iOS", - }, + ## Apple TV - ## Apple iOS simulator (i386) - # Based on 10-main.conf: iphoneos-cross / darwin-i386-cc - "ios-sim-cross-i386" => { - inherit_from => [ "darwin-i386-cc", "ios-cross-base" ], - sys_id => "iOS", - }, - - ## Apple iOS (arm64) - # Based on 10-main.conf: ios64-cross - "ios64-cross-arm64" => { - inherit_from => [ "darwin-common", "ios-cross-base", asm("aarch64_asm") ], - cflags => add("-arch arm64"), - bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR", - perlasm_scheme => "ios64", - sys_id => "iOS", - }, - - ## Apple iOS (arm64e) - # Based on 10-main.conf: ios64-cross - "ios64-cross-arm64e" => { - inherit_from => [ "darwin-common", "ios-cross-base", asm("aarch64_asm") ], - cflags => add("-arch arm64e"), - bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR", - perlasm_scheme => "ios64", - sys_id => "iOS", - }, - - ## Apple iOS (armv7s) - # Based on 10-main.conf: ios-cross - "ios-cross-armv7s" => { - inherit_from => [ "darwin-common", "ios-cross-base", asm("armv4_asm") ], - cflags => add("-arch armv7s"), - perlasm_scheme => "ios32", - sys_id => "iOS", - }, - - ## Apple iOS (armv7) - # Based on 10-main.conf: ios-cross - "ios-cross-armv7" => { - inherit_from => [ "darwin-common", "ios-cross-base", asm("armv4_asm") ], - cflags => add("-arch armv7"), - perlasm_scheme => "ios32", - sys_id => "iOS", - }, - - ## Apple tvOS simulator (x86_64) - # Based on 10-main.conf: iphoneos-cross / darwin64-x86_64-cc - "tvos-sim-cross-x86_64" => { - inherit_from => [ "darwin64-x86_64-cc", "tvos-cross-base" ], - sys_id => "tvOS", - }, - - ## Apple tvOS (arm64) - # Based on 10-main.conf: ios64-cross + # Device (arm64) "tvos64-cross-arm64" => { inherit_from => [ "darwin-common", "tvos-cross-base", asm("aarch64_asm") ], cflags => add("-arch arm64"), @@ -152,31 +122,9 @@ my %targets = (); perlasm_scheme => "ios64", sys_id => "tvOS", }, - - ## Apple macOS (x86_64) - "macos64-x86_64" => { - inherit_from => [ "darwin64-x86_64-cc", "macos-base" ], - sys_id => "macOS", - }, - - ## Apple macOS (i386) - "macos-i386" => { - inherit_from => [ "darwin-i386-cc", "macos-base" ], - sys_id => "macOS", - }, - - ## Catalyst - # Based on - "mac-catalyst-base" => { - inherit_from => [ "all-base" ], - template => 1, -# cflags => add(sub { defined($ENV{'CATALYST_MIN_SDK_VERSION'}) ? '-mmacosx-version-min=$(CATALYST_MIN_SDK_VERSION)' : '-mmacosx-version-min=10.15'; }), - }, - - ## Catalyst (armv7s) - "mac-catalyst-x86_64" => { - inherit_from => [ "darwin64-x86_64-cc", "mac-catalyst-base" ], - cflags => add("-target x86_64-apple-ios13.0-macabi"), - sys_id => "MacOSX", + # Simulator (x86_64) + "tvos-sim-cross-x86_64" => { + inherit_from => [ "darwin64-x86_64-cc", "tvos-cross-base" ], + sys_id => "tvOS", }, ); diff --git a/scripts/build-loop-targets.sh b/scripts/build-loop-targets.sh index 5dc6472..36db9d3 100755 --- a/scripts/build-loop-targets.sh +++ b/scripts/build-loop-targets.sh @@ -22,35 +22,29 @@ for TARGET in ${TARGETS} do # Determine relevant SDK version - if [[ "${TARGET}" == tvos* ]]; then - SDKVERSION="${TVOS_SDKVERSION}" - elif [[ "${TARGET}" == macos* ]]; then + if [[ "${TARGET}" == macos* ]]; then SDKVERSION="${MACOS_SDKVERSION}" elif [[ "${TARGET}" == mac-catalyst-* ]]; then SDKVERSION="${CATALYST_SDKVERSION}" elif [[ "${TARGET}" == watchos* ]]; then SDKVERSION="${WATCHOS_SDKVERSION}" + elif [[ "${TARGET}" == tvos* ]]; then + SDKVERSION="${TVOS_SDKVERSION}" else SDKVERSION="${IOS_SDKVERSION}" fi # These variables are used in the configuration file export SDKVERSION + export IOS_MIN_SDK_VERSION export MACOS_MIN_SDK_VERSION export CATALYST_MIN_SDK_VERSION - export IOS_MIN_SDK_VERSION - export TVOS_MIN_SDK_VERSION export WATCHOS_MIN_SDK_VERSION + export TVOS_MIN_SDK_VERSION export CONFIG_DISABLE_BITCODE # Determine platform - if [[ "${TARGET}" == "ios-sim-cross-"* ]]; then - PLATFORM="iPhoneSimulator" - elif [[ "${TARGET}" == "tvos-sim-cross-"* ]]; then - PLATFORM="AppleTVSimulator" - elif [[ "${TARGET}" == "tvos64-cross-"* ]]; then - PLATFORM="AppleTVOS" - elif [[ "${TARGET}" == "macos"* ]]; then + if [[ "${TARGET}" == "macos"* ]]; then PLATFORM="MacOSX" elif [[ "${TARGET}" == "mac-catalyst-"* ]]; then PLATFORM="MacOSX" @@ -58,6 +52,12 @@ do PLATFORM="WatchSimulator" elif [[ "${TARGET}" == "watchos"* ]]; then PLATFORM="WatchOS" + elif [[ "${TARGET}" == "tvos-sim-cross-"* ]]; then + PLATFORM="AppleTVSimulator" + elif [[ "${TARGET}" == "tvos64-cross-"* ]]; then + PLATFORM="AppleTVOS" + elif [[ "${TARGET}" == "ios-sim-cross-"* ]]; then + PLATFORM="iPhoneSimulator" else PLATFORM="iPhoneOS" fi From 2d7d115186e130b5677234795c5ae892c9a0246d Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Wed, 11 Nov 2020 20:37:03 +0100 Subject: [PATCH 02/11] Add arm64 targets - New Macs - Catalyst - iPhone Simulator --- OpenSSL-Apple.podspec | 2 +- OpenSSL-Apple.podspec.template | 2 +- build-libssl.sh | 15 ++++++++++++--- config/20-all-platforms.conf | 27 +++++++++++++++++++++++++++ 4 files changed, 41 insertions(+), 5 deletions(-) diff --git a/OpenSSL-Apple.podspec b/OpenSSL-Apple.podspec index c251057..a9023bd 100755 --- a/OpenSSL-Apple.podspec +++ b/OpenSSL-Apple.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| openssl_version = "1.1.1h" - openssl_targets = "ios-sim-cross-x86_64 ios64-cross-arm64 ios64-cross-arm64e macos64-x86_64" + openssl_targets = "ios-sim-cross-x86_64 ios-sim-cross-arm64 ios64-cross-arm64 ios64-cross-arm64e macos64-x86_64 macos64-arm64 mac-catalyst-arm64" script_version = "6" s.name = "OpenSSL-Apple" diff --git a/OpenSSL-Apple.podspec.template b/OpenSSL-Apple.podspec.template index 4883428..82b1a3d 100755 --- a/OpenSSL-Apple.podspec.template +++ b/OpenSSL-Apple.podspec.template @@ -1,6 +1,6 @@ Pod::Spec.new do |s| openssl_version = "%OPENSSL-VERSION%" - openssl_targets = "ios-sim-cross-x86_64 ios64-cross-arm64 ios64-cross-arm64e macos64-x86_64" + openssl_targets = "ios-sim-cross-x86_64 ios-sim-cross-arm64 ios64-cross-arm64 ios64-cross-arm64e macos64-x86_64 macos64-arm64 mac-catalyst-arm64" script_version = "6" s.name = "OpenSSL-Apple" diff --git a/build-libssl.sh b/build-libssl.sh index 8b2f84d..efce011 100755 --- a/build-libssl.sh +++ b/build-libssl.sh @@ -29,9 +29,9 @@ DEFAULTVERSION="1.1.1h" # Default (=full) set of targets (OpenSSL >= 1.1.1) to build DEFAULTTARGETS=`cat < [ "darwin64-x86_64-cc", "ios-cross-base" ], sys_id => "iOS", }, + # Simulator (arm64) + "ios-sim-cross-arm64" => { + inherit_from => [ "darwin64-arm64-cc", "ios-cross-base" ], + cflags => add("-target arm64-apple-ios13.0-simulator"), + sys_id => "iOS", + }, ## Apple macOS + # Base (arm64) + "darwin64-arm64-cc" => { + inherit_from => [ "darwin-common" ], + CFLAGS => add("-Wall"), + cflags => add("-arch arm64"), + lib_cppflags => add("-DL_ENDIAN"), + bn_ops => "SIXTY_FOUR_BIT_LONG", + perlasm_scheme => "macosx", + }, + # Device (x86_64) "macos64-x86_64" => { inherit_from => [ "darwin64-x86_64-cc", "macos-base" ], sys_id => "macOS", }, + # Device (arm64) + "macos64-arm64" => { + inherit_from => [ "darwin64-arm64-cc", "macos-base" ], + sys_id => "macOS", + }, # Catalyst (x86_64) "mac-catalyst-x86_64" => { inherit_from => [ "darwin64-x86_64-cc", "mac-catalyst-base" ], cflags => add("-target x86_64-apple-ios13.0-macabi"), sys_id => "MacOSX", }, + # Catalyst (arm64) + "mac-catalyst-arm64" => { + inherit_from => [ "darwin64-arm64-cc", "mac-catalyst-base" ], + cflags => add("-target arm64-apple-ios13.0-macabi "), + sys_id => "MacOSX", + }, ## Apple WatchOS From 1cf972d36ff4ff5a39b2a22c80fad3dd955a98aa Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Wed, 11 Nov 2020 22:29:05 +0100 Subject: [PATCH 03/11] Override min SDK for Apple Silicon - iPhoneSimulator ARM64 = 13.0 - macOS ARM64 = 11.0 Would cause compiler warnings otherwise. --- scripts/build-loop-targets.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/build-loop-targets.sh b/scripts/build-loop-targets.sh index 36db9d3..4622df0 100755 --- a/scripts/build-loop-targets.sh +++ b/scripts/build-loop-targets.sh @@ -46,6 +46,9 @@ do # Determine platform if [[ "${TARGET}" == "macos"* ]]; then PLATFORM="MacOSX" + if [[ "${TARGET}" == "macos64-arm64" ]]; then + MACOS_MIN_SDK_VERSION="11.0" + fi elif [[ "${TARGET}" == "mac-catalyst-"* ]]; then PLATFORM="MacOSX" elif [[ "${TARGET}" == "watchos-sim-cross"* ]]; then @@ -58,6 +61,9 @@ do PLATFORM="AppleTVOS" elif [[ "${TARGET}" == "ios-sim-cross-"* ]]; then PLATFORM="iPhoneSimulator" + if [[ "${TARGET}" == "ios-sim-cross-arm64" ]]; then + IOS_MIN_SDK_VERSION="13.0" + fi else PLATFORM="iPhoneOS" fi From 029e8ddeee72ee39faf06a1dc9030890eb104579 Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Wed, 11 Nov 2020 23:16:09 +0100 Subject: [PATCH 04/11] Enable ARM64 assembler on Apple Silicon https://github.com/openssl/openssl/pull/12369 --- config/20-all-platforms.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/20-all-platforms.conf b/config/20-all-platforms.conf index 241aa12..bc30e14 100644 --- a/config/20-all-platforms.conf +++ b/config/20-all-platforms.conf @@ -77,13 +77,13 @@ my %targets = (); # Base (arm64) "darwin64-arm64-cc" => { - inherit_from => [ "darwin-common" ], + inherit_from => [ "darwin-common", asm("aarch64_asm") ], CFLAGS => add("-Wall"), cflags => add("-arch arm64"), lib_cppflags => add("-DL_ENDIAN"), bn_ops => "SIXTY_FOUR_BIT_LONG", - perlasm_scheme => "macosx", - }, + perlasm_scheme => "ios64", + }, # Device (x86_64) "macos64-x86_64" => { From 340537f48eff15050a0ad581815cf9808f603f97 Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Thu, 12 Nov 2020 00:29:54 +0100 Subject: [PATCH 05/11] Bump podspec targets --- OpenSSL-Apple.podspec | 4 ++-- OpenSSL-Apple.podspec.template | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/OpenSSL-Apple.podspec b/OpenSSL-Apple.podspec index a9023bd..208a1e7 100755 --- a/OpenSSL-Apple.podspec +++ b/OpenSSL-Apple.podspec @@ -17,9 +17,9 @@ Pod::Spec.new do |s| ./create-openssl-framework.sh dynamic CMD - s.ios.deployment_target = "11.0" + s.ios.deployment_target = "12.0" s.ios.vendored_frameworks = "frameworks/iPhone/openssl.framework" - s.osx.deployment_target = "10.11" + s.osx.deployment_target = "10.15" s.osx.vendored_frameworks = "frameworks/MacOSX/openssl.framework" s.requires_arc = false end diff --git a/OpenSSL-Apple.podspec.template b/OpenSSL-Apple.podspec.template index 82b1a3d..f332f7d 100755 --- a/OpenSSL-Apple.podspec.template +++ b/OpenSSL-Apple.podspec.template @@ -17,9 +17,9 @@ Pod::Spec.new do |s| ./create-openssl-framework.sh dynamic CMD - s.ios.deployment_target = "11.0" + s.ios.deployment_target = "12.0" s.ios.vendored_frameworks = "frameworks/iPhone/openssl.framework" - s.osx.deployment_target = "10.11" + s.osx.deployment_target = "10.15" s.osx.vendored_frameworks = "frameworks/MacOSX/openssl.framework" s.requires_arc = false end From 2f6f4f5d5787634ca0a4c956b8aaa2566403f618 Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Thu, 12 Nov 2020 19:30:56 +0100 Subject: [PATCH 06/11] Update README --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index fed2656..457be6c 100755 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ # OpenSSL-Apple -![iOS support](https://img.shields.io/badge/iOS-11+-blue.svg) -![tvOS support](https://img.shields.io/badge/tvOS-11+-blue.svg) -![macOS support](https://img.shields.io/badge/macOS-10.11+-blue.svg) +![iOS support](https://img.shields.io/badge/iOS-12+-blue.svg) +![macOS support](https://img.shields.io/badge/macOS-10.15+-blue.svg) ![macOS Catalyst support](https://img.shields.io/badge/macOS%20Catalyst-10.15+-blue.svg) ![watchOS support](https://img.shields.io/badge/watchOS-4.0+-blue.svg) -![OpenSSL version](https://img.shields.io/badge/OpenSSL-1.1.1g-green.svg) +![tvOS support](https://img.shields.io/badge/tvOS-12+-blue.svg) +![OpenSSL version](https://img.shields.io/badge/OpenSSL-1.1.1h-green.svg) [![license](https://img.shields.io/badge/license-Apache%202.0-lightgrey.svg)](LICENSE) This is a fork of the popular work by [Felix Schulze](https://github.com/x2on), that is a set of scripts for using self-compiled builds of the OpenSSL library on the iPhone and the Apple TV. @@ -14,16 +14,16 @@ However, this repository focuses more on framework-based setups and also adds ma # Compile library -Compile OpenSSL 1.1.1g for all targets: +Compile OpenSSL 1.1.1h for all targets: ``` -./build-libssl.sh --version=1.1.1g +./build-libssl.sh --version=1.1.1h ``` -Compile OpenSSL 1.1.1g for specific targets: +Compile OpenSSL 1.1.1h for specific targets: ``` -./build-libssl.sh --version=1.1.1g --targets="ios-cross-armv7 macos64-x86_64" +./build-libssl.sh --version=1.1.1h --targets="ios-cross-armv7 macos64-x86_64" ``` For all options see: From dfbf5a05648c07e1276d119daad17f8f9b01457a Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Thu, 12 Nov 2020 20:13:57 +0100 Subject: [PATCH 07/11] Omit ARM64 simulator until migration to XCFrameworks Can't lipo arm64 slices for different platforms (iPhoneOS and iPhoneSimulator). --- OpenSSL-Apple.podspec | 4 +++- OpenSSL-Apple.podspec.template | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/OpenSSL-Apple.podspec b/OpenSSL-Apple.podspec index 208a1e7..58afa24 100755 --- a/OpenSSL-Apple.podspec +++ b/OpenSSL-Apple.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| openssl_version = "1.1.1h" - openssl_targets = "ios-sim-cross-x86_64 ios-sim-cross-arm64 ios64-cross-arm64 ios64-cross-arm64e macos64-x86_64 macos64-arm64 mac-catalyst-arm64" + openssl_targets = "ios-sim-cross-x86_64 ios64-cross-arm64 ios64-cross-arm64e macos64-x86_64 macos64-arm64 mac-catalyst-arm64" script_version = "6" s.name = "OpenSSL-Apple" @@ -19,6 +19,8 @@ Pod::Spec.new do |s| s.ios.deployment_target = "12.0" s.ios.vendored_frameworks = "frameworks/iPhone/openssl.framework" + s.ios.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' } + s.ios.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' } s.osx.deployment_target = "10.15" s.osx.vendored_frameworks = "frameworks/MacOSX/openssl.framework" s.requires_arc = false diff --git a/OpenSSL-Apple.podspec.template b/OpenSSL-Apple.podspec.template index f332f7d..4b700b3 100755 --- a/OpenSSL-Apple.podspec.template +++ b/OpenSSL-Apple.podspec.template @@ -1,6 +1,6 @@ Pod::Spec.new do |s| openssl_version = "%OPENSSL-VERSION%" - openssl_targets = "ios-sim-cross-x86_64 ios-sim-cross-arm64 ios64-cross-arm64 ios64-cross-arm64e macos64-x86_64 macos64-arm64 mac-catalyst-arm64" + openssl_targets = "ios-sim-cross-x86_64 ios64-cross-arm64 ios64-cross-arm64e macos64-x86_64 macos64-arm64 mac-catalyst-arm64" script_version = "6" s.name = "OpenSSL-Apple" @@ -19,6 +19,8 @@ Pod::Spec.new do |s| s.ios.deployment_target = "12.0" s.ios.vendored_frameworks = "frameworks/iPhone/openssl.framework" + s.ios.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' } + s.ios.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' } s.osx.deployment_target = "10.15" s.osx.vendored_frameworks = "frameworks/MacOSX/openssl.framework" s.requires_arc = false From edeb2965021cefcd06ae233bb93f851aaaf54a60 Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Thu, 12 Nov 2020 21:09:47 +0100 Subject: [PATCH 08/11] Bump podspec --- OpenSSL-Apple.podspec | 2 +- OpenSSL-Apple.podspec.template | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenSSL-Apple.podspec b/OpenSSL-Apple.podspec index 58afa24..40c32b8 100755 --- a/OpenSSL-Apple.podspec +++ b/OpenSSL-Apple.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| openssl_version = "1.1.1h" openssl_targets = "ios-sim-cross-x86_64 ios64-cross-arm64 ios64-cross-arm64e macos64-x86_64 macos64-arm64 mac-catalyst-arm64" - script_version = "6" + script_version = "7" s.name = "OpenSSL-Apple" s.version = "#{openssl_version}.#{script_version}" diff --git a/OpenSSL-Apple.podspec.template b/OpenSSL-Apple.podspec.template index 4b700b3..d4ea145 100755 --- a/OpenSSL-Apple.podspec.template +++ b/OpenSSL-Apple.podspec.template @@ -1,7 +1,7 @@ Pod::Spec.new do |s| openssl_version = "%OPENSSL-VERSION%" openssl_targets = "ios-sim-cross-x86_64 ios64-cross-arm64 ios64-cross-arm64e macos64-x86_64 macos64-arm64 mac-catalyst-arm64" - script_version = "6" + script_version = "7" s.name = "OpenSSL-Apple" s.version = "#{openssl_version}.#{script_version}" From ca05f8c697d52d3c0f7aff270ef7cfaf9f2fba00 Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Fri, 13 Nov 2020 00:56:27 +0100 Subject: [PATCH 09/11] Update README with recent archs Fixes #21 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 457be6c..f388671 100755 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Compile OpenSSL 1.1.1h for all targets: Compile OpenSSL 1.1.1h for specific targets: ``` -./build-libssl.sh --version=1.1.1h --targets="ios-cross-armv7 macos64-x86_64" +./build-libssl.sh --version=1.1.1h --targets="ios64-cross-arm64 macos64-x86_64 macos64-arm64" ``` For all options see: From 8ad22a2b3e470796d2891b9067e4fb85ce25b07b Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Fri, 13 Nov 2020 22:14:25 +0100 Subject: [PATCH 10/11] Update Demo --- Demo.xcodeproj/project.pbxproj | 18 ----------- Gemfile.lock | 57 ++++++++++++++++++---------------- Podfile | 2 +- Podfile.lock | 8 ++--- 4 files changed, 35 insertions(+), 50 deletions(-) diff --git a/Demo.xcodeproj/project.pbxproj b/Demo.xcodeproj/project.pbxproj index beb0d01..63b5ce2 100644 --- a/Demo.xcodeproj/project.pbxproj +++ b/Demo.xcodeproj/project.pbxproj @@ -134,7 +134,6 @@ 0EF4C83B254B2DDE0030F3CE /* Sources */, 0EF4C83C254B2DDE0030F3CE /* Frameworks */, 0EF4C83D254B2DDE0030F3CE /* Resources */, - 3FD7291765A818AED991E6BE /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -221,23 +220,6 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 3FD7291765A818AED991E6BE /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Demo/Pods-Demo-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Demo/Pods-Demo-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Demo/Pods-Demo-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; E779C03A2743FDC34CB79861 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; diff --git a/Gemfile.lock b/Gemfile.lock index 4b2e6f8..3472e9b 100755 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,25 +2,26 @@ GEM remote: https://rubygems.org/ specs: CFPropertyList (3.0.2) - activesupport (4.2.11.1) - i18n (~> 0.7) + activesupport (5.2.4.4) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - algoliasearch (1.27.1) + addressable (2.7.0) + public_suffix (>= 2.0.2, < 5.0) + algoliasearch (1.27.5) httpclient (~> 2.8, >= 2.8.3) json (>= 1.5.1) atomos (0.1.3) claide (1.0.3) - cocoapods (1.9.1) - activesupport (>= 4.0.2, < 5) + cocoapods (1.10.0) + addressable (~> 2.6) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.9.1) + cocoapods-core (= 1.10.0) cocoapods-deintegrate (>= 1.0.3, < 2.0) - cocoapods-downloader (>= 1.2.2, < 2.0) + cocoapods-downloader (>= 1.4.0, < 2.0) cocoapods-plugins (>= 1.0.0, < 2.0) cocoapods-search (>= 1.0.0, < 2.0) - cocoapods-stats (>= 1.0.0, < 2.0) cocoapods-trunk (>= 1.4.0, < 2.0) cocoapods-try (>= 1.1.0, < 2.0) colored2 (~> 3.1) @@ -30,55 +31,57 @@ GEM molinillo (~> 0.6.6) nap (~> 1.0) ruby-macho (~> 1.4) - xcodeproj (>= 1.14.0, < 2.0) - cocoapods-core (1.9.1) - activesupport (>= 4.0.2, < 6) + xcodeproj (>= 1.19.0, < 2.0) + cocoapods-core (1.10.0) + activesupport (> 5.0, < 6) + addressable (~> 2.6) algoliasearch (~> 1.0) concurrent-ruby (~> 1.1) fuzzy_match (~> 2.0.4) nap (~> 1.0) netrc (~> 0.11) + public_suffix typhoeus (~> 1.0) cocoapods-deintegrate (1.0.4) - cocoapods-downloader (1.3.0) + cocoapods-downloader (1.4.0) cocoapods-plugins (1.0.0) nap cocoapods-search (1.0.0) - cocoapods-stats (1.1.0) - cocoapods-trunk (1.4.1) + cocoapods-trunk (1.5.0) nap (>= 0.8, < 2.0) netrc (~> 0.11) - cocoapods-try (1.1.0) + cocoapods-try (1.2.0) colored2 (3.1.2) - concurrent-ruby (1.1.6) + concurrent-ruby (1.1.7) escape (0.0.4) ethon (0.12.0) ffi (>= 1.3.0) - ffi (1.12.2) + ffi (1.13.1) fourflusher (2.3.1) fuzzy_match (2.0.4) gh_inspector (1.1.3) httpclient (2.8.3) - i18n (0.9.5) + i18n (1.8.5) concurrent-ruby (~> 1.0) - json (2.3.0) - minitest (5.14.0) + json (2.3.1) + minitest (5.14.2) molinillo (0.6.6) - nanaimo (0.2.6) + nanaimo (0.3.0) nap (1.1.0) netrc (0.11.0) + public_suffix (4.0.6) ruby-macho (1.4.0) thread_safe (0.3.6) - typhoeus (1.3.1) + typhoeus (1.4.0) ethon (>= 0.9.0) - tzinfo (1.2.7) + tzinfo (1.2.8) thread_safe (~> 0.1) - xcodeproj (1.16.0) + xcodeproj (1.19.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) colored2 (~> 3.1) - nanaimo (~> 0.2.6) + nanaimo (~> 0.3.0) PLATFORMS ruby @@ -87,4 +90,4 @@ DEPENDENCIES cocoapods BUNDLED WITH - 2.0.2 + 2.1.2 diff --git a/Podfile b/Podfile index dc757b0..58ac045 100644 --- a/Podfile +++ b/Podfile @@ -1,6 +1,6 @@ source 'https://github.com/CocoaPods/Specs.git' use_frameworks! -platform :ios, '11.0' +platform :ios, '12.0' target 'Demo' do pod 'OpenSSL-Apple', :path => '.' diff --git a/Podfile.lock b/Podfile.lock index d13441b..2bf0c72 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,5 +1,5 @@ PODS: - - OpenSSL-Apple (1.1.1g.6) + - OpenSSL-Apple (1.1.1h.7) DEPENDENCIES: - OpenSSL-Apple (from `.`) @@ -9,8 +9,8 @@ EXTERNAL SOURCES: :path: "." SPEC CHECKSUMS: - OpenSSL-Apple: c9c1b9c5b2b1fc4e1758fc5f0836b58ae7fd8183 + OpenSSL-Apple: ea3144c521f4d5f620bc911686ddc42f48ae17d8 -PODFILE CHECKSUM: f64ec9f1e52d69d845a54464df43fe38c27d486f +PODFILE CHECKSUM: 46de088b71467a12879d73c36eda858ad56ed167 -COCOAPODS: 1.9.1 +COCOAPODS: 1.10.0 From 2f5cdaf136877c278c3ce4c48ae0d432f6bb2adb Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Fri, 13 Nov 2020 22:49:03 +0100 Subject: [PATCH 11/11] Clean up platforms - Rename WatchOS platform to Watch - Drop Apple Watch armv7k - Use "MacOSX" sys_id in targets .conf --- assets/{WatchOS => Watch}/Info.plist | 0 build-libssl.sh | 4 ++-- config/20-all-platforms.conf | 18 +++++++++--------- create-openssl-framework.sh | 25 ++++++++++--------------- 4 files changed, 21 insertions(+), 26 deletions(-) rename assets/{WatchOS => Watch}/Info.plist (100%) diff --git a/assets/WatchOS/Info.plist b/assets/Watch/Info.plist similarity index 100% rename from assets/WatchOS/Info.plist rename to assets/Watch/Info.plist diff --git a/build-libssl.sh b/build-libssl.sh index efce011..183f9fd 100755 --- a/build-libssl.sh +++ b/build-libssl.sh @@ -549,8 +549,8 @@ fi # Build tvOS library if selected for build if [ ${#LIBSSL_WATCHOS[@]} -gt 0 ]; then echo "Build library for watchOS..." - lipo -create ${LIBSSL_WATCHOS[@]} -output "${CURRENTPATH}/lib/libssl-WatchOS.a" - lipo -create ${LIBCRYPTO_WATCHOS[@]} -output "${CURRENTPATH}/lib/libcrypto-WatchOS.a" + lipo -create ${LIBSSL_WATCHOS[@]} -output "${CURRENTPATH}/lib/libssl-Watch.a" + lipo -create ${LIBCRYPTO_WATCHOS[@]} -output "${CURRENTPATH}/lib/libcrypto-Watch.a" fi # Build tvOS library if selected for build diff --git a/config/20-all-platforms.conf b/config/20-all-platforms.conf index bc30e14..17fe047 100644 --- a/config/20-all-platforms.conf +++ b/config/20-all-platforms.conf @@ -68,9 +68,9 @@ my %targets = (); }, # Simulator (arm64) "ios-sim-cross-arm64" => { - inherit_from => [ "darwin64-arm64-cc", "ios-cross-base" ], - cflags => add("-target arm64-apple-ios13.0-simulator"), - sys_id => "iOS", + inherit_from => [ "darwin64-arm64-cc", "ios-cross-base" ], + cflags => add("-target arm64-apple-ios13.0-simulator"), + sys_id => "iOS", }, ## Apple macOS @@ -88,12 +88,12 @@ my %targets = (); # Device (x86_64) "macos64-x86_64" => { inherit_from => [ "darwin64-x86_64-cc", "macos-base" ], - sys_id => "macOS", + sys_id => "MacOSX", }, # Device (arm64) "macos64-arm64" => { - inherit_from => [ "darwin64-arm64-cc", "macos-base" ], - sys_id => "macOS", + inherit_from => [ "darwin64-arm64-cc", "macos-base" ], + sys_id => "MacOSX", }, # Catalyst (x86_64) "mac-catalyst-x86_64" => { @@ -103,9 +103,9 @@ my %targets = (); }, # Catalyst (arm64) "mac-catalyst-arm64" => { - inherit_from => [ "darwin64-arm64-cc", "mac-catalyst-base" ], - cflags => add("-target arm64-apple-ios13.0-macabi "), - sys_id => "MacOSX", + inherit_from => [ "darwin64-arm64-cc", "mac-catalyst-base" ], + cflags => add("-target arm64-apple-ios13.0-macabi "), + sys_id => "MacOSX", }, ## Apple WatchOS diff --git a/create-openssl-framework.sh b/create-openssl-framework.sh index fd14470..ecdaa82 100755 --- a/create-openssl-framework.sh +++ b/create-openssl-framework.sh @@ -21,22 +21,22 @@ if [ -d $FWROOT ]; then rm -rf $FWROOT fi -ALL_SYSTEMS=("iPhone" "AppleTV" "MacOSX" "Catalyst" "WatchOS") +ALL_SYSTEMS=("iPhone" "AppleTV" "MacOSX" "Catalyst" "Watch") function check_bitcode() { local FWDIR=$1 if [[ $FWTYPE == "dynamic" ]]; then - BITCODE_PATTERN="__LLVM" + BITCODE_PATTERN="__LLVM" else - BITCODE_PATTERN="__bitcode" - fi + BITCODE_PATTERN="__bitcode" + fi - if otool -l "$FWDIR/$FWNAME" | grep "${BITCODE_PATTERN}" >/dev/null; then - echo "INFO: $FWDIR contains Bitcode" - else - echo "INFO: $FWDIR doesn't contain Bitcode" - fi + if otool -l "$FWDIR/$FWNAME" | grep "${BITCODE_PATTERN}" >/dev/null; then + echo "INFO: $FWDIR contains Bitcode" + else + echo "INFO: $FWDIR doesn't contain Bitcode" + fi } # Inspect Mach-O load commands to get minimum SDK version. @@ -187,12 +187,7 @@ if [ $FWTYPE == "dynamic" ]; then for SYS in ${ALL_SYSTEMS[@]}; do SYSDIR="$FWROOT/$SYS" FWDIR="$SYSDIR/$FWNAME.framework" - - if [[ $SYS == "WatchOS" ]]; then - DYLIBS=(bin/Watch*/$FWNAME.dylib) - else - DYLIBS=(bin/${SYS}*/$FWNAME.dylib) - fi + DYLIBS=(bin/${SYS}*/$FWNAME.dylib) if [[ ${#DYLIBS[@]} -gt 0 && -e ${DYLIBS[0]} ]]; then echo "Creating framework for $SYS"