From f831808d48d15db9a37ccf08e1a975c603aa1d09 Mon Sep 17 00:00:00 2001 From: Max Gabrielsson Date: Fri, 28 Apr 2023 14:16:14 +0200 Subject: [PATCH 1/2] build openssl separately --- .github/workflows/Linux.yml | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/.github/workflows/Linux.yml b/.github/workflows/Linux.yml index 5a31761d..e596b436 100644 --- a/.github/workflows/Linux.yml +++ b/.github/workflows/Linux.yml @@ -27,7 +27,7 @@ jobs: arch: ['linux_amd64', 'linux_arm64', 'linux_amd64_gcc4'] include: - arch: 'linux_amd64' - container: 'ubuntu:18.04' + container: 'ubuntu:16.04' - arch: 'linux_arm64' container: 'ubuntu:18.04' - arch: 'linux_amd64_gcc4' @@ -82,13 +82,34 @@ jobs: uses: ./duckdb/.github/actions/ubuntu_16_setup with: aarch64_cross_compile: ${{ matrix.arch == 'linux_arm64' && 1 }} - openssl: 1 + openssl: 0 - - name: Configure OpenSSL path + # Openssl install dir was weirdly configured in main duckdb? + - name: Install OpenSSL 1.1.1 + if: ${{ matrix.arch == 'linux_amd64' || matrix.arch == 'linux_arm64'}} + shell: bash + run: | + wget https://github.com/openssl/openssl/archive/refs/tags/OpenSSL_1_1_1s.tar.gz + tar -xzvf OpenSSL_1_1_1s.tar.gz + mv openssl-OpenSSL_1_1_1s openssl-1.1.1s + cd openssl-1.1.1s + find ./ -type f -exec sed -i -e 's/\#\ define\ OPENSSL\_VERSION\_NUMBER/\#define\ OPENSSL\_VERSION\_NUMBER/g' {} \; + ./config --libdir=lib no-shared zlib-dynamic + make + make install + + - name: Configure OpenSSL path for ARM64 + if: ${{ matrix.arch == 'linux_arm64' }} + shell: bash + run: | + export OPENSSL_ROOT_DIR=`pwd`/build/openssl/build + echo "OPENSSL_ROOT_DIR=$OPENSSL_ROOT_DIR" >> $GITHUB_ENV + + - name: Configure OpenSSL path for AMD64 + if: ${{ matrix.arch == 'linux_amd64' || matrix.arch == 'linux_amd64_gcc4'}} shell: bash run: | - export OPENSSL_ROOT_DIR=`pwd`/build/openssl/build - echo "OPENSSL_ROOT_DIR=$OPENSSL_ROOT_DIR" >> $GITHUB_ENV + echo "OPENSSL_ROOT_DIR=/usr/local/ssl" >> $GITHUB_ENV # Build extension - name: Build extension From 65c5a6ff011450292e89c7c4386b15e8d5dd19e6 Mon Sep 17 00:00:00 2001 From: Max Gabrielsson Date: Fri, 28 Apr 2023 14:54:01 +0200 Subject: [PATCH 2/2] cross compile openssl --- .github/workflows/Linux.yml | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Linux.yml b/.github/workflows/Linux.yml index e596b436..cef79ace 100644 --- a/.github/workflows/Linux.yml +++ b/.github/workflows/Linux.yml @@ -85,8 +85,8 @@ jobs: openssl: 0 # Openssl install dir was weirdly configured in main duckdb? - - name: Install OpenSSL 1.1.1 - if: ${{ matrix.arch == 'linux_amd64' || matrix.arch == 'linux_arm64'}} + - name: Install OpenSSL 1.1.1 (for AMD64) + if: ${{ matrix.arch == 'linux_amd64' }} shell: bash run: | wget https://github.com/openssl/openssl/archive/refs/tags/OpenSSL_1_1_1s.tar.gz @@ -97,6 +97,21 @@ jobs: ./config --libdir=lib no-shared zlib-dynamic make make install + + - name: Install OpenSSL for Cross compiling (for ARM64) + if: ${{ matrix.arch == 'linux_arm64' }} + shell: bash + run: | + mkdir -p build/openssl + cd build/openssl + mkdir sources build + curl https://www.openssl.org/source/openssl-3.0.5.tar.gz | tar zxv -C sources --strip-components 1 + export OPENSSL_ROOT_DIR=`pwd`/build + cd sources + export CC="aarch64-linux-gnu-gcc" + perl ./Configure --prefix=$OPENSSL_ROOT_DIR linux-aarch64 no-asm + make -j + make install_sw - name: Configure OpenSSL path for ARM64 if: ${{ matrix.arch == 'linux_arm64' }} @@ -114,7 +129,9 @@ jobs: # Build extension - name: Build extension env: - GEN: ninja + GEN: ninja + OPENSSL_ROOT_DIR: ${{ env.OPENSSL_ROOT_DIR }} + STATIC_OPENSSL: 1 STATIC_LIBCPP: 1 CC: ${{ matrix.arch == 'linux_arm64' && 'aarch64-linux-gnu-gcc' || '' }} CXX: ${{ matrix.arch == 'linux_arm64' && 'aarch64-linux-gnu-g++' || '' }}