From a02e5dbba85f55e7496b5065d7a6a4419364ac71 Mon Sep 17 00:00:00 2001 From: Andrea Cavalli Date: Tue, 16 Mar 2021 10:37:59 +0100 Subject: [PATCH] Compile 32-bit tdlib builds with gcc --- .github/workflows/platform_natives.yaml | 2 ++ .../github-workflows/install-dependencies.sh | 9 +++++++-- .../github-workflows/setup-variables.sh | 14 +++++++++----- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/platform_natives.yaml b/.github/workflows/platform_natives.yaml index a8f759e..0587a65 100644 --- a/.github/workflows/platform_natives.yaml +++ b/.github/workflows/platform_natives.yaml @@ -12,6 +12,8 @@ jobs: strategy: matrix: include: + - {os: ubuntu-20.04, usedocker: "true", arch: "linux/386", implementation: "tdlight" } + - {os: ubuntu-20.04, usedocker: "true", arch: "linux/386", implementation: "tdlib" } - {os: ubuntu-20.04, usedocker: "false", arch: "linux/amd64", implementation: "tdlight"} - {os: ubuntu-20.04, usedocker: "false", arch: "linux/amd64", implementation: "tdlib"} - {os: ubuntu-20.04, usedocker: "true", arch: "linux/arm/v6", implementation: "tdlight"} diff --git a/scripts/continuous-integration/github-workflows/install-dependencies.sh b/scripts/continuous-integration/github-workflows/install-dependencies.sh index 2a6f678..76d6a1c 100755 --- a/scripts/continuous-integration/github-workflows/install-dependencies.sh +++ b/scripts/continuous-integration/github-workflows/install-dependencies.sh @@ -3,8 +3,13 @@ set -e if [[ "$OPERATING_SYSTEM_NAME" == "linux" ]]; then echo "==Linux====" - sudo apt install -y make git zlib1g-dev libssl-dev gperf cmake clang-11 \ - libc++-11-dev libc++abi-11-dev ccache maven python3 python3-pip php7.4-cli + sudo apt install -y make git zlib1g-dev libssl-dev gperf cmake \ + ccache maven python3 python3-pip php7.4-cli + if { [[ "$IMPLEMENTATION_NAME" = "tdlib" ]]; } && { [[ "$CPU_ARCHITECTURE_NAME" = "386" ]] || [[ "$CPU_ARCHITECTURE_NAME" = "armv6" ]] || [[ "$CPU_ARCHITECTURE_NAME" = "armv7" ]]; }; then + sudo apt install -y build-essential + else + sudo apt install -y clang-11 libc++-11-dev libc++abi-11-dev + fi elif [[ "$OPERATING_SYSTEM_NAME" == "osx" ]]; then echo "==OSX======" export PYTHON=36 diff --git a/scripts/continuous-integration/github-workflows/setup-variables.sh b/scripts/continuous-integration/github-workflows/setup-variables.sh index 24d93fb..e60371a 100644 --- a/scripts/continuous-integration/github-workflows/setup-variables.sh +++ b/scripts/continuous-integration/github-workflows/setup-variables.sh @@ -82,21 +82,25 @@ elif [[ "$OPERATING_SYSTEM_NAME" == "linux" ]]; then export BUILD_TYPE=MinSizeRel if [[ "$CPU_ARCHITECTURE_NAME" = "aarch64" ]]; then export CMAKE_EXTRA_ARGUMENTS="" - export CXXFLAGS="-static-libgcc -static-libstdc++" else export CMAKE_EXTRA_ARGUMENTS="-DOPENSSL_USE_STATIC_LIBS=ON -DCMAKE_FIND_LIBRARY_SUFFIXES=\".a\"" - export CXXFLAGS="-static-libgcc -static-libstdc++" fi if [[ "$CPU_ARCHITECTURE_NAME" = "386" ]] || [[ "$CPU_ARCHITECTURE_NAME" = "armv6" ]] || [[ "$CPU_ARCHITECTURE_NAME" = "armv7" ]]; then - export CXXFLAGS="$CXXFLAGS -latomic" export CMAKE_EXE_LINKER_FLAGS="$CMAKE_EXE_LINKER_FLAGS -latomic" export LDFLAGS="$LDFLAGS -latomic" + export CXXFLAGS="$CXXFLAGS -latomic" + fi + + if { [[ "$IMPLEMENTATION_NAME" = "tdlib" ]]; } && { [[ "$CPU_ARCHITECTURE_NAME" = "386" ]] || [[ "$CPU_ARCHITECTURE_NAME" = "armv6" ]] || [[ "$CPU_ARCHITECTURE_NAME" = "armv7" ]]; }; then + export CXXFLAGS="$CXXFLAGS" + else + export CXXFLAGS="-static-libgcc -static-libstdc++" + export CC="/usr/bin/clang-11" + export CXX="/usr/bin/clang++-11" fi export CPU_CORES=" -- -j${CPU_CORES_NUM}" - export CC="/usr/bin/clang-11" - export CXX="/usr/bin/clang++-11" fi # ====== Print variables