Skip to content

Commit 8095e9b

Browse files
committed
rebuild without bitcode
1 parent b7ff9ed commit 8095e9b

File tree

7 files changed

+37
-36
lines changed

7 files changed

+37
-36
lines changed

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
*.DS_Store
1+
*.DS_Store
2+
openssl-*/*
3+
openssl-*.tar.gz

OpenSSL.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22
s.name = "OpenSSL"
33
s.version = "1.0.1j"
4-
s.summary = "OpenSSL Libraries and CocoaPod with BitCode for iOS and OSX"
4+
s.summary = "OpenSSL Libraries and CocoaPod without Bitcode for iOS and OSX"
55
s.description = "OpenSSL is an SSL/TLS and Crypto toolkit. Deprecated in Mac OS and gone in iOS, this spec gives your project non-deprecated OpenSSL support. Supports OSX and iOS including Simulator (armv7, arm64, i386, x86_64)."
66
s.homepage = "https://github.com/bither/OpenSSL"
77
s.license = { :type => 'OpenSSL (OpenSSL/SSLeay)', :file => 'LICENSE' }

build.sh

+33-34
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
# This script downlaods and builds the iOS and Mac openSSL libraries with Bitcode enabled
3+
# This script downlaods and builds the iOS and Mac openSSL libraries without Bitcode enabled
44

55
# Credits:
66
# https://github.com/st3fan/ios-openssl
@@ -9,7 +9,7 @@
99

1010
set -e
1111

12-
SDK_VERSION="9.0"
12+
SDK_VERSION="18.0"
1313
MIN_SDK_VERSION="7.0"
1414

1515
OPENSSL_VERSION="openssl-1.0.1j"
@@ -19,19 +19,24 @@ buildMac()
1919
{
2020
ARCH=$1
2121

22-
echo "Building ${OPENSSL_VERSION} for ${ARCH}"
22+
echo "Building ${OPENSSL_VERSION} for mac ${ARCH}"
2323

2424
TARGET="darwin-i386-cc"
2525

2626
if [[ $ARCH == "x86_64" ]]; then
2727
TARGET="darwin64-x86_64-cc"
2828
fi
2929

30-
export CC="${BUILD_TOOLS}/usr/bin/clang -fembed-bitcode"
30+
export CROSS_TOP="${DEVELOPER}/Platforms/MacOSX.platform/Developer"
31+
export CROSS_SDK="MacOSX.sdk"
32+
33+
export BUILD_TOOLS="${DEVELOPER}"
34+
export CC="${BUILD_TOOLS}/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
3135

3236
pushd . > /dev/null
3337
cd "${OPENSSL_VERSION}"
3438
./Configure no-asm ${TARGET} --openssldir="/tmp/${OPENSSL_VERSION}-${ARCH}" &> "/tmp/${OPENSSL_VERSION}-${ARCH}.log"
39+
sed -ie "/^CFLAG=/s|$| -isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK}|" "Makefile"
3540
make >> "/tmp/${OPENSSL_VERSION}-${ARCH}.log" 2>&1
3641
make install >> "/tmp/${OPENSSL_VERSION}-${ARCH}.log" 2>&1
3742
make clean >> "/tmp/${OPENSSL_VERSION}-${ARCH}.log" 2>&1
@@ -49,14 +54,14 @@ buildIOS()
4954
PLATFORM="iPhoneSimulator"
5055
else
5156
PLATFORM="iPhoneOS"
52-
sed -ie "s!static volatile sig_atomic_t intr_signal;!static volatile intr_signal;!" "crypto/ui/ui_openssl.c"
57+
# sed -ie "s!static volatile sig_atomic_t intr_signal;!static volatile intr_signal;!" "crypto/ui/ui_openssl.c"
5358
fi
5459

5560
export $PLATFORM
5661
export CROSS_TOP="${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer"
5762
export CROSS_SDK="${PLATFORM}${SDK_VERSION}.sdk"
5863
export BUILD_TOOLS="${DEVELOPER}"
59-
export CC="${BUILD_TOOLS}/usr/bin/gcc -fembed-bitcode -arch ${ARCH}"
64+
export CC="${BUILD_TOOLS}/usr/bin/gcc -arch ${ARCH}"
6065

6166
echo "Building ${OPENSSL_VERSION} for ${PLATFORM} ${SDK_VERSION} ${ARCH}"
6267

@@ -90,28 +95,16 @@ rm -rf "/tmp/${OPENSSL_VERSION}-*.log"
9095
rm -rf "${OPENSSL_VERSION}"
9196

9297
if [ ! -e ${OPENSSL_VERSION}.tar.gz ]; then
93-
echo "Downloading ${OPENSSL_VERSION}.tar.gz"
94-
curl -O http://www.openssl.org/source/${OPENSSL_VERSION}.tar.gz
98+
url="https://github.com/openssl/openssl/releases/download/$(echo $OPENSSL_VERSION | sed 's/[.-]/_/g' | sed 's/openssl/OpenSSL/g')/${OPENSSL_VERSION}.tar.gz"
99+
echo "Downloading ${OPENSSL_VERSION}.tar.gz from ${url}"
100+
wget $url
95101
else
96102
echo "Using ${OPENSSL_VERSION}.tar.gz"
97103
fi
98104

99105
echo "Unpacking openssl"
100-
tar xfz "${OPENSSL_VERSION}.tar.gz"
101-
102-
buildMac "x86_64"
106+
tar xzf "${OPENSSL_VERSION}.tar.gz"
103107

104-
echo "Copying headers"
105-
cp /tmp/${OPENSSL_VERSION}-x86_64/include/openssl/* include-osx/openssl/
106-
107-
echo "Building Mac libraries"
108-
lipo \
109-
"/tmp/${OPENSSL_VERSION}-x86_64/lib/libcrypto.a" \
110-
-create -output lib-osx/libcrypto.a
111-
112-
lipo \
113-
"/tmp/${OPENSSL_VERSION}-x86_64/lib/libssl.a" \
114-
-create -output lib-osx/libssl.a
115108

116109
buildIOS "armv7"
117110
buildIOS "arm64"
@@ -125,25 +118,31 @@ echo "Building iOS libraries"
125118
lipo \
126119
"/tmp/${OPENSSL_VERSION}-iOS-armv7/lib/libcrypto.a" \
127120
"/tmp/${OPENSSL_VERSION}-iOS-i386/lib/libcrypto.a" \
121+
"/tmp/${OPENSSL_VERSION}-iOS-arm64/lib/libcrypto.a" \
122+
"/tmp/${OPENSSL_VERSION}-iOS-x86_64/lib/libcrypto.a" \
128123
-create -output lib-ios/libcrypto.a
129124

130125
lipo \
131126
"/tmp/${OPENSSL_VERSION}-iOS-armv7/lib/libssl.a" \
132127
"/tmp/${OPENSSL_VERSION}-iOS-i386/lib/libssl.a" \
128+
"/tmp/${OPENSSL_VERSION}-iOS-arm64/lib/libssl.a" \
129+
"/tmp/${OPENSSL_VERSION}-iOS-x86_64/lib/libssl.a" \
133130
-create -output lib-ios/libssl.a
134131

135-
echo "Adding 64-bit libraries"
136-
lipo \
137-
"lib-ios/libcrypto.a" \
138-
"/tmp/${OPENSSL_VERSION}-iOS-arm64/lib/libcrypto.a" \
139-
"/tmp/${OPENSSL_VERSION}-iOS-x86_64/lib/libcrypto.a" \
140-
-create -output lib-ios/libcrypto.a
141-
142-
lipo \
143-
"lib-ios/libssl.a" \
144-
"/tmp/${OPENSSL_VERSION}-iOS-arm64/lib/libssl.a" \
145-
"/tmp/${OPENSSL_VERSION}-iOS-x86_64/lib/libssl.a" \
146-
-create -output lib-ios/libssl.a
132+
133+
buildMac "x86_64"
134+
135+
echo "Copying headers"
136+
cp /tmp/${OPENSSL_VERSION}-x86_64/include/openssl/* include-osx/openssl/
137+
138+
echo "Building Mac libraries"
139+
lipo \
140+
"/tmp/${OPENSSL_VERSION}-x86_64/lib/libcrypto.a" \
141+
-create -output lib-osx/libcrypto.a
142+
143+
lipo \
144+
"/tmp/${OPENSSL_VERSION}-x86_64/lib/libssl.a" \
145+
-create -output lib-osx/libssl.a
147146

148147
echo "Cleaning up"
149148
rm -rf /tmp/${OPENSSL_VERSION}-*

lib-ios/libcrypto.a

-16.5 MB
Binary file not shown.

lib-ios/libssl.a

-3.5 MB
Binary file not shown.

lib-osx/libcrypto.a

-4.23 MB
Binary file not shown.

lib-osx/libssl.a

-908 KB
Binary file not shown.

0 commit comments

Comments
 (0)