Remove s390x

This commit is contained in:
Andrea Cavalli 2023-05-12 02:29:59 +02:00
parent 8208938b7e
commit 71b12c2025
4 changed files with 0 additions and 202 deletions

View File

@ -19,7 +19,6 @@ jobs:
- { os: ubuntu-22.04, type: "linux_amd64_ssl3" }
- { os: ubuntu-20.04, type: "linux_arm64_ssl1" }
- { os: ubuntu-22.04, type: "linux_arm64_ssl3" }
- { os: ubuntu-22.04, type: "linux_s390x_ssl3" }
- { os: ubuntu-22.04, type: "linux_ppc64le_ssl3" }
- { os: ubuntu-22.04, type: "linux_riscv64_ssl3" }
#- { os: windows-2019, type: "windows_amd64", vcpkgCommitId: "6ca56aeb457f033d344a7106cb3f9f1abf8f4e98", triplet: "x64-windows-static" }
@ -125,14 +124,6 @@ jobs:
with:
packages: make git zlib1g-dev libssl-dev gperf php-cli cmake default-jdk clang-10 lld-10 libc++-10-dev libc++abi-10-dev libgcc-9-dev libunwind-dev libclang-common-10-dev ccache maven
version: 1.0
- name: add updates ppa
if: matrix.os == 'ubuntu-22.04'
uses: myci-actions/add-deb-repo@11
with:
# noinspection HttpUrlsUsage
repo: deb http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse
repo-name: jammy-updates
update: true
- name: Install ubuntu 22.04 dependencies
if: matrix.os == 'ubuntu-22.04'
uses: awalsh128/cache-apt-pkgs-action@latest

View File

@ -1,96 +0,0 @@
#!/bin/bash -ex
# Ubuntu 22.04
REVISION="${REVISION:-1.0.0.0-SNAPSHOT}"
TOOLCHAIN_FILE="$(readlink -e ./.github/workflows/toolchains/toolchain_s390x.cmake)"
# Create missing dirs
rm -rf implementations/tdlight/td_tools_build implementations/tdlight/build api/target-legacy api/target api/.ci-friendly-pom.xml implementations/tdlight/td/generate/auto natives/src/main/java/it/tdlight/jni natives/build natives/tdjni_bin natives/tdjni_docs
mkdir -p implementations/tdlight/build implementations/tdlight/build/td_bin/bin implementations/tdlight/td_tools_build/java/it/tdlight/jni api/src/main/java-legacy/it/tdlight/jni api/src/main/java-sealed/it/tdlight/jni natives/src/main/java/it/tdlight/jni natives/build natives/tdjni_bin natives/tdjni_docs
# machine-specific flags
HOST_CMAKE_C_COMPILER="/usr/bin/clang-15"
HOST_CMAKE_CXX_COMPILER="/usr/bin/clang++-15"
HOST_CMAKE_C_FLAGS="-fuse-ld=lld"
HOST_CMAKE_CXX_FLAGS="${HOST_CMAKE_C_FLAGS} -stdlib=libc++"
HOST_CMAKE_EXE_LINKER_FLAGS="-lc++ -lc++abi -fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind"
# ccache
CCACHE=$(which sccache || true)
if [[ -x "$CCACHE" ]]; then
echo "found sccache: $CCACHE"
else
echo "sccache not found"
CCACHE=$(which ccache)
fi
# Build tdlib tools
cd implementations/tdlight/td_tools_build
CXXFLAGS="-stdlib=libc++" CC="$HOST_CMAKE_C_COMPILER" CXX="$HOST_CMAKE_CXX_COMPILER" cmake \
-DCMAKE_C_COMPILER="${HOST_CMAKE_C_COMPILER}" \
-DCMAKE_CXX_COMPILER="${HOST_CMAKE_CXX_COMPILER}" \
-DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} ${HOST_CMAKE_C_FLAGS}" \
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} ${HOST_CMAKE_CXX_FLAGS}" \
-DCMAKE_EXE_LINKER_FLAGS="${CMAKE_EXE_LINKER_FLAGS} ${HOST_CMAKE_EXE_LINKER_FLAGS}" \
\
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER="$CCACHE" \
-DCMAKE_CXX_COMPILER_LAUNCHER="$CCACHE" \
-DCMAKE_C_FLAGS_RELEASE="" \
-DCMAKE_CXX_FLAGS_RELEASE="-O0 -DNDEBUG" \
-DTD_ENABLE_LTO=OFF \
-DTD_ENABLE_JNI=ON \
..
cmake --build . --target prepare_cross_compiling "-j$(nproc)"
cmake --build . --target td_generate_java_api "-j$(nproc)"
cd ../../../
# Generate TdApi.java
./implementations/tdlight/td_tools_build/td/generate/td_generate_java_api TdApi "./implementations/tdlight/td/generate/auto/tlo/td_api.tlo" "./natives/src/main/java" "it/tdlight/jni"
# Optimization flags
export CMAKE_C_FLAGS="${CMAKE_C_FLAGS}"
export CMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti"
export CMAKE_SHARED_LINKER_FLAGS="${CMAKE_SHARED_LINKER_FLAGS} -Wl,--gc-sections -Wl,--exclude-libs,ALL"
export CMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -flto=thin -O3"
# Build tdlib
cd implementations/tdlight/build
INSTALL_PREFIX="$(readlink -e ./td_bin/)"
INSTALL_BINDIR="$(readlink -e ./td_bin/bin)"
cmake \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER="$CCACHE" \
-DCMAKE_CXX_COMPILER_LAUNCHER="$CCACHE" \
-DTD_SKIP_BENCHMARK=ON -DTD_SKIP_TEST=ON -DTD_SKIP_TG_CLI=ON \
-DTD_ENABLE_LTO=ON \
-DTD_ENABLE_JNI=ON \
-DCMAKE_INSTALL_PREFIX:PATH="$INSTALL_PREFIX" \
-DCMAKE_INSTALL_BINDIR:PATH="$INSTALL_BINDIR" \
-DCMAKE_TOOLCHAIN_FILE="${TOOLCHAIN_FILE}" \
..
cmake --build . --target install --config Release "-j$(nproc)"
cd ../../../
cd natives/build
cmake \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER="$CCACHE" \
-DCMAKE_CXX_COMPILER_LAUNCHER="$CCACHE" \
-DTD_GENERATED_BINARIES_DIR="$(readlink -e ../../implementations/tdlight/td_tools_build/td/generate)" \
-DTD_SRC_DIR="$(readlink -e ../../implementations/tdlight)" \
-DTD_ENABLE_LTO=ON \
-DTDNATIVES_BIN_DIR="$(readlink -e ../tdjni_bin/)" \
-DTDNATIVES_DOCS_BIN_DIR="$(readlink -e ../tdjni_docs/)" \
-DTd_DIR:PATH="$(readlink -e ../../implementations/tdlight/build/td_bin/lib/cmake/Td)" \
-DJAVA_SRC_DIR="$(readlink -e ../src/main/java)" \
-DTDNATIVES_CPP_SRC_DIR="$(readlink -e ../src/main/cpp)" \
-DCMAKE_TOOLCHAIN_FILE="${TOOLCHAIN_FILE}" \
../src/main/cpp
cmake --build . --target install --config Release "-j$(nproc)"
cd ..
mkdir -p src/main/resources/META-INF/tdlightjni/
mv tdjni_bin/libtdjni.so src/main/resources/META-INF/tdlightjni/libtdjni.linux_s390x_ssl3.so
mvn -B -f pom.xml -Drevision="$REVISION" -Dnative.type.classifier=linux_s390x_ssl3 package

View File

@ -1,30 +0,0 @@
#!/bin/bash -ex
# Ubuntu 22.04
export DEBIAN_FRONTEND=noninteractive
dpkg --add-architecture s390x
sed 's/deb http/deb \[arch=amd64,i386\] http/' -i /etc/apt/sources.list
echo "# tdlight multiarch" > /etc/apt/sources.list.d/tdlight-multiarch.list
echo "deb [arch=arm64,armhf,ppc64el,riscv64,s390x] http://ports.ubuntu.com/ $(lsb_release -cs) main universe restricted multiverse" >> /etc/apt/sources.list.d/tdlight-multiarch.list
echo "deb [arch=arm64,armhf,ppc64el,riscv64,s390x] http://ports.ubuntu.com/ $(lsb_release -cs)-updates main universe restricted multiverse" >> /etc/apt/sources.list.d/tdlight-multiarch.list
echo "deb [arch=arm64,armhf,ppc64el,riscv64,s390x] http://ports.ubuntu.com/ $(lsb_release -cs)-security main universe restricted multiverse" >> /etc/apt/sources.list.d/tdlight-multiarch.list
apt-get --assume-yes update
# Install and bypass a bug in the cross-platform libc++ packages
apt-get --assume-yes autoremove "libc++-15-dev:*" "libc++abi-15-dev:*" "libc++1-15:*" "libc++abi1-15:*" "libunwind-15-dev:*" "libunwind-15:*" || true
apt-get --assume-yes -o Dpkg::Options::="--force-overwrite" install libc++-15-dev:s390x libc++abi-15-dev:s390x libc++1-15:s390x libc++abi1-15:s390x libunwind-15-dev:s390x libunwind-15:s390x
cp --remove-destination \
/usr/lib/llvm-15/lib/{libc++abi.so,libc++abi.so.1.0,libc++.so,libc++.so.1.0,libunwind.so.1.0} \
/usr/lib/aarch64-linux-gnu/ || true
apt-get --assume-yes -o Dpkg::Options::="--force-overwrite" install clang-15 libc++-15-dev libc++abi-15-dev libc++1-15 libc++abi1-15 libunwind-15-dev libunwind-15
# End libc++ packages bugfix
# Add s390x common files
apt-get download libclang-common-15-dev:s390x
dpkg-deb -xv libclang-common-15-dev_*_s390x.deb /
# Install dependencies
apt-get --assume-yes -o Dpkg::Options::="--force-overwrite" install libssl-dev:s390x zlib1g-dev:s390x openjdk-17-jdk-headless:s390x libgcc-12-dev:s390x libc6-dev:s390x

View File

@ -1,67 +0,0 @@
set(CMAKE_CROSSCOMPILING TRUE)
SET(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR s390x)
set(TARGET_TRIPLE s390x-linux-gnu)
if(EXISTS "/usr/bin/clang-10")
set(CMAKE_C_COMPILER /usr/bin/clang-10)
set(CMAKE_CXX_COMPILER /usr/bin/clang++-10)
set(CMAKE_ASM_COMPILER /usr/bin/clang-10)
set(CMAKE_AR "/usr/bin/llvm-ar-10" CACHE FILEPATH "" FORCE)
elseif(EXISTS "/usr/bin/clang-15")
set(CMAKE_C_COMPILER /usr/bin/clang-15)
set(CMAKE_CXX_COMPILER /usr/bin/clang++-15)
set(CMAKE_ASM_COMPILER /usr/bin/clang-15)
set(CMAKE_AR "/usr/bin/llvm-ar-15" CACHE FILEPATH "" FORCE)
else()
set(CMAKE_C_COMPILER /usr/bin/clang)
set(CMAKE_CXX_COMPILER /usr/bin/clang++)
set(CMAKE_ASM_COMPILER /usr/bin/clang)
set(CMAKE_AR "/usr/bin/llvm-ar" CACHE FILEPATH "" FORCE)
endif()
set(CMAKE_C_COMPILER_TARGET ${TARGET_TRIPLE})
set(CMAKE_CXX_COMPILER_TARGET ${TARGET_TRIPLE})
set(CMAKE_ASM_COMPILER_TARGET ${TARGET_TRIPLE})
set(CMAKE_FIND_ROOT_PATH /usr/s390x-linux-gnu /usr/lib/s390x-linux-gnu /usr/include/s390x-linux-gnu /usr/bin/s390x-linux-gnu)
set(CMAKE_INCLUDE_PATH /usr/include/s390x-linux-gnu)
set(CMAKE_LIBRARY_PATH /usr/lib/s390x-linux-gnu)
set(CMAKE_PROGRAM_PATH /usr/bin/s390x-linux-gnu)
#set(CMAKE_SYSROOT /usr/lib/s390x-linux-gnu)
#set(OPENSSL_INCLUDE_DIR /usr/include/openssl)
#include_directories("/usr/include/openssl")
# Set various compiler flags
set(CMAKE_EXE_LINKER_FLAGS_INIT "-fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind")
set(CMAKE_MODULE_LINKER_FLAGS_INIT "-fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind")
set(CMAKE_SHARED_LINKER_FLAGS_INIT "-fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind")
set(CMAKE_CXX_FLAGS_INIT "-stdlib=libc++")
# Use our definitions for compiler tools
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# Search for libraries and headers in the target directories only
#SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
#SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
#SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
# This must be set or compiler checks fail when linking
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
#include_directories("${CROSS_OPENJDK_PATH}/include/linux")
SET(JAVA_HOME "/usr/lib/jvm/default-java/")
SET(JAVA_CROSS_HOME "/usr/lib/jvm/java-17-openjdk-s390x")
SET(JAVA_INCLUDE_PATH "${JAVA_HOME}/include")
SET(JAVA_AWT_INCLUDE_PATH "${JAVA_HOME}/include")
SET(JAVA_INCLUDE_PATH2 "${JAVA_HOME}/include/linux")
SET(JAVA_JVM_LIBRARY "${JAVA_CROSS_HOME}/lib/server/libjvm.so")
SET(JAVA_AWT_LIBRARY "${JAVA_CROSS_HOME}/lib/libawt.so")
# Use LLD on linux
#add_link_options("-fuse-ld=lld" "-rtlib=compiler-rt" "-unwindlib=libunwind" "-Wl,--as-needed")
#add_link_options("-fuse-ld=lld")