Skip to content

Commit 46e3bec

Browse files
committed
android openssl instead of boringssl for tls backend
1 parent df61b98 commit 46e3bec

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

.github/workflows/main.yml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
configure:
4141
--host aarch64-linux-android26
4242
--with-openssl=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr
43-
LIBS="-lssl -lcrypto -lc++"
43+
LIBS="-lssl -lcrypto"
4444
AR=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar
4545
AS=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-as
4646
CC=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android26-clang
@@ -57,7 +57,7 @@ jobs:
5757
configure:
5858
--host x86_64-linux-android26
5959
--with-openssl=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr
60-
LIBS="-lssl -lcrypto -lc++"
60+
LIBS="-lssl -lcrypto"
6161
AR=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar
6262
AS=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-as
6363
CC=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android26-clang
@@ -110,30 +110,29 @@ jobs:
110110
extract: true
111111
fileName: curl-*.tar.gz
112112

113-
- name: build boringssl
113+
- name: build openssl
114114
if: matrix.name == 'android'
115115
run: |
116-
git clone https://boringssl.googlesource.com/boringssl
117-
cd boringssl
118-
mkdir build
119-
cd build
120-
cmake \
121-
-DANDROID_ABI=${{ matrix.arch }} \
122-
-DANDROID_PLATFORM=android-26 \
123-
-DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK}/build/cmake/android.toolchain.cmake \
124-
-DOPENSSL_SMALL=1 \
125-
-DCMAKE_BUILD_TYPE=Release \
126-
-DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \
127-
-DBUILD_SHARED_LIBS=OFF \
128-
-DCMAKE_EXE_LINKER_FLAGS="-static" \
129-
..
116+
git clone https://github.com/openssl/openssl.git
117+
cd openssl
118+
export TOOLCHAIN=$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64
119+
export ANDROID_API=26
120+
export ARCH=${{ matrix.arch }}
121+
export PATH=$TOOLCHAIN/bin:$PATH
122+
TARGET=android-${{ matrix.arch == 'arm64-v8a' && 'arm64' || matrix.arch }}
123+
124+
./Configure $TARGET \
125+
--prefix=$PWD/build \
126+
--openssldir=$PWD/build/ssl \
127+
no-shared \
128+
no-unit-test \
129+
-D__ANDROID_API__=$ANDROID_API
130130
make
131+
make install_sw
131132
132-
cd ..
133-
TOOLCHAIN="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64"
134-
cp build/libssl.a $TOOLCHAIN/sysroot/usr/lib/
135-
cp build/libcrypto.a $TOOLCHAIN/sysroot/usr/lib/
136-
cp -r include/openssl $TOOLCHAIN/sysroot/usr/include/
133+
cp build/lib/libssl.a $TOOLCHAIN/sysroot/usr/lib/
134+
cp build/lib/libcrypto.a $TOOLCHAIN/sysroot/usr/lib/
135+
cp -r build/include/openssl $TOOLCHAIN/sysroot/usr/include/
137136
138137
- name: build curl
139138
run: |
@@ -242,7 +241,7 @@ jobs:
242241
export ${{ matrix.make }}
243242
$CC sqlite-amalgamation-*/shell.c sqlite-amalgamation-*/sqlite3.c -o sqlite3 -ldl
244243
# remove unused folders to save up space
245-
rm -rf sqlite-amalgamation-*.zip sqlite-amalgamation-* curl-* boringssl
244+
rm -rf sqlite-amalgamation-*.zip sqlite-amalgamation-* curl-* openssl
246245
echo "::endgroup::"
247246
248247
echo "::group::prepare the test script"
@@ -296,7 +295,8 @@ jobs:
296295
runs-on: ubuntu-latest
297296
name: release
298297
needs: build
299-
#if: github.ref == 'refs/heads/main'
298+
if: always()
299+
#github.ref == 'refs/heads/main'
300300

301301
env:
302302
GH_TOKEN: ${{ github.token }}

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ else ifeq ($(PLATFORM),android)
6666
$(error "CC must be set to the Android NDK's Clang compiler")
6767
endif
6868
TARGET := $(DIST_DIR)/cloudsync.so
69-
LDFLAGS += -shared -lcrypto -lssl -lc++
69+
LDFLAGS += -shared -lcrypto -lssl
7070
else ifeq ($(PLATFORM),ios)
7171
TARGET := $(DIST_DIR)/cloudsync.dylib
7272
SDK := -isysroot $(shell xcrun --sdk iphoneos --show-sdk-path) -miphoneos-version-min=11.0

0 commit comments

Comments
 (0)