Fixed some symbols not found error for libc and libresolv wrapping #3392
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Auto build Box64 and release its binary with Github Action | |
name: Build and Release Box64 | |
on: | |
workflow_dispatch: | |
release: | |
push: | |
paths: | |
- "**/*.c" | |
- "**/*.h" | |
- "**/*.S" | |
- "**/*.py" | |
- "CMakeLists.txt" | |
- "**/*.yml" | |
pull_request: | |
types: [assigned, opened, synchronize, reopened] | |
paths: | |
- "**/*.c" | |
- "**/*.h" | |
- "**/*.S" | |
- "**/*.py" | |
- "CMakeLists.txt" | |
- "**/*.yml" | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [X64, OTHER_ARM, RISCV, RPI4ARM64, RPI5ARM64, RK3326, RK3399, RK3588, PHYTIUM, SD845, SD888, ADLINK, ARM64, ANDROID, TERMUX, LARCH64] | |
type: [Release, Trace] | |
os: [ubuntu-latest] | |
include: | |
- platform: TEGRAX1 | |
type: Release | |
os: ubuntu-20.04 | |
- platform: TEGRAX1 | |
type: Trace | |
os: ubuntu-20.04 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: "Checkout Box64 Repository" | |
uses: actions/checkout@v4 | |
- name: "Environment preparation" | |
run: | | |
sudo apt-get update | |
if [[ ${{ matrix.platform }} != 'X64' && ${{ matrix.platform }} != 'OTHER_ARM' && ${{ matrix.platform }} != 'RISCV' && ${{ matrix.platform }} != 'LARCH64' ]]; then | |
sudo apt-get -y install git cmake make python3 | |
if [[ ${{ matrix.platform }} == 'ANDROID' || ${{ matrix.platform }} == 'TERMUX' ]]; then | |
wget https://dl.google.com/android/repository/android-ndk-r26b-linux.zip | |
unzip android-ndk-r26b-linux.zip | |
echo "BOX64_COMPILER=$PWD/android-ndk-r26b/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android31-clang" >> $GITHUB_ENV | |
echo "BOX64_PLATFORM_MARCRO=-DANDROID=1 -DARM_DYNAREC=1 -DBAD_SIGNAL=1" >> $GITHUB_ENV | |
git clone https://github.com/termux/termux-docker.git | |
sudo cp -rf termux-docker/system/arm /system | |
sudo chown -R $(whoami):$(whoami) /system | |
sudo chmod 755 -R /system | |
else | |
sudo apt-get -y install git gcc-aarch64-linux-gnu | |
echo "BOX64_PLATFORM_MARCRO=-D${{ matrix.platform }}=1" >> $GITHUB_ENV | |
echo "BOX64_COMPILER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV | |
fi | |
if [[ ${{ matrix.platform }} == 'TERMUX' ]]; then | |
sudo apt-get -y install p7zip | |
wget https://mirrors.utermux.dev/termux/termux-main/pool/main/liba/libandroid-sysv-semaphore/libandroid-sysv-semaphore_0.1_aarch64.deb | |
7z x libandroid-sysv-semaphore_0.1_aarch64.deb | |
tar -xf data.tar.xz | |
sudo cp -rf data / | |
sudo chmod 755 -R /data | |
sudo chown -R $(whoami):$(whoami) /data | |
echo "CFLAGS=-L/data/data/com.termux/files/usr/lib" >> $GITHUB_ENV | |
echo "IS_TERMUX=1" >> $GITHUB_ENV | |
echo "QEMU_SET_ENV=LD_LIBRARY_PATH=/data/data/com.termux/files/usr/lib" >> $GITHUB_ENV | |
else | |
echo "IS_TERMUX=0" >> $GITHUB_ENV | |
fi | |
else | |
if [[ ${{ matrix.platform }} == 'X64' ]]; then | |
echo "BOX64_PLATFORM_MARCRO=-DLD80BITS=1 -DNOALIGN=1" >> $GITHUB_ENV | |
echo "BOX64_COMPILER=gcc" >> $GITHUB_ENV | |
sudo apt-get -y install git cmake make python3 | |
elif [[ ${{ matrix.platform }} == 'RISCV' ]]; then | |
echo BOX64_PLATFORM_MARCRO="-DRV64=ON" >> $GITHUB_ENV | |
echo "BOX64_COMPILER=riscv64-linux-gnu-gcc" >> $GITHUB_ENV | |
sudo apt-get -y install git gcc-riscv64-linux-gnu cmake make python3 | |
elif [[ ${{ matrix.platform }} == 'LARCH64' ]]; then | |
sudo mkdir /usr/local/larch | |
wget -O- -q https://github.com/loongson/build-tools/releases/download/2023.08.08/CLFS-loongarch64-8.1-x86_64-cross-tools-gcc-glibc.tar.xz | sudo tar -C /usr/local/larch --strip-components=1 --xz -xf - | |
sudo ln -sf /usr/local/larch/target /usr/loongarch64-linux-gnu | |
sudo cp -r /usr/local/larch/loongarch64-unknown-linux-gnu/lib/* /usr/loongarch64-linux-gnu/lib64/ | |
for i in objdump objcopy strip; do | |
sudo ln -sf /usr/local/larch/bin/loongarch64-unknown-linux-gnu-$i /usr/bin/loongarch64-linux-gnu-$i | |
done | |
echo '/usr/local/larch/bin/loongarch64-unknown-linux-gnu-gcc -L/usr/local/larch/loongarch64-unknown-linux-gnu "$@"' | sudo tee /usr/bin/loongarch64-linux-gnu-gcc | |
echo '/usr/local/larch/bin/loongarch64-unknown-linux-gnu-g++ -L/usr/local/larch/loongarch64-unknown-linux-gnu "$@"' | sudo tee /usr/bin/loongarch64-linux-gnu-g++ | |
sudo chmod 755 /usr/bin/loongarch64-linux-gnu-{gcc,g++} | |
echo BOX64_PLATFORM_MARCRO="-DLARCH64=ON" >> $GITHUB_ENV | |
echo "BOX64_COMPILER=loongarch64-linux-gnu-gcc" >> $GITHUB_ENV | |
sudo apt-get -y install git cmake make python3 | |
else | |
echo BOX64_PLATFORM_MARCRO="-DARM_DYNAREC=ON" >> $GITHUB_ENV | |
echo "BOX64_COMPILER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV | |
sudo apt-get -y install git gcc-aarch64-linux-gnu cmake make python3 | |
fi | |
fi | |
if [[ ${{ matrix.type }} == 'Release' ]]; then | |
echo BOX64_BUILD_TYPE=Release >> $GITHUB_ENV | |
echo BOX64_HAVE_TRACE=0 >> $GITHUB_ENV | |
else | |
echo BOX64_BUILD_TYPE=RelWithDebInfo >> $GITHUB_ENV | |
echo BOX64_HAVE_TRACE=1 >> $GITHUB_ENV | |
fi | |
- name: "Display Build info" | |
run: | | |
echo "CMake Platform Macro: ${{ env.BOX64_PLATFORM_MARCRO }}" | |
echo "CMake C Compiler: ${{ env.BOX64_COMPILER }}" | |
echo "Build type: ${{ env.BOX64_BUILD_TYPE }}" | |
echo "Trace Enabled: ${{ env.BOX64_HAVE_TRACE }}" | |
- name: "Build Box64" | |
run: | | |
mkdir build | |
cd build | |
cmake .. -DCMAKE_C_COMPILER=${{ env.BOX64_COMPILER }}\ | |
-DTERMUX=${{ env.IS_TERMUX }}\ | |
${{ env.BOX64_PLATFORM_MARCRO }}\ | |
-DCMAKE_BUILD_TYPE=${{ env.BOX64_BUILD_TYPE }}\ | |
-DHAVE_TRACE=${{ env.BOX64_HAVE_TRACE }}\ | |
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON\ | |
-DCI=${{ matrix.platform != 'ANDROID' }} | |
make -j$(nproc) VERBOSE=1 | |
- name: "Test Box64" | |
if: ${{ matrix.platform != 'TEGRAX1' }} | |
run: | | |
if [[ ${{ matrix.platform }} != 'X64' ]]; then | |
mkdir qemu9.0.0 | |
wget -O- -q https://archive.archlinux.org/packages/q/qemu-user-static/qemu-user-static-9.0.0-1-x86_64.pkg.tar.zst | tar -I zstd -C qemu9.0.0 -xf - | |
sudo cp qemu9.0.0/usr/bin/* /usr/bin/ | |
fi | |
cd build | |
if [[ ${{ matrix.platform }} == 'RISCV' ]]; then | |
INTERPRETER=qemu-riscv64-static QEMU_LD_PREFIX=/usr/riscv64-linux-gnu/ ctest -j$(nproc) --output-on-failure | |
INTERPRETER=qemu-riscv64-static QEMU_LD_PREFIX=/usr/riscv64-linux-gnu/ BOX64_DYNAREC=0 ctest -j$(nproc) --output-on-failure | |
INTERPRETER=qemu-riscv64-static QEMU_LD_PREFIX=/usr/riscv64-linux-gnu/ QEMU_CPU=rv64,zba=true,zbb=true,zbc=true,zbs=true ctest -j$(nproc) --output-on-failure | |
INTERPRETER=qemu-riscv64-static QEMU_LD_PREFIX=/usr/riscv64-linux-gnu/ QEMU_CPU=rv64,xtheadba=true,xtheadba=true,xtheadbb=true,xtheadbs=true,xtheadcondmov=true,xtheadmemidx=true,xtheadmempair=true,xtheadfmemidx=true,xtheadmac=true,xtheadfmv=true ctest -j$(nproc) --output-on-failure | |
elif [[ ${{ matrix.platform }} == 'LARCH64' ]]; then | |
INTERPRETER=qemu-loongarch64-static QEMU_LD_PREFIX=/usr/loongarch64-linux-gnu/ BOX64_DYNAREC_LA64NOEXT=1 ctest -j$(nproc) --repeat until-pass:20 --output-on-failure | |
INTERPRETER=qemu-loongarch64-static QEMU_LD_PREFIX=/usr/loongarch64-linux-gnu/ BOX64_DYNAREC_TEST=2 BOX64_DYNAREC_LA64NOEXT=1 ctest -j$(nproc) --repeat until-pass:20 --output-on-failure | |
INTERPRETER=qemu-loongarch64-static QEMU_LD_PREFIX=/usr/loongarch64-linux-gnu/ BOX64_DYNAREC=0 ctest -j$(nproc) --repeat until-pass:20 --output-on-failure | |
elif [[ ${{ matrix.platform }} == 'ANDROID' ]]; then | |
INTERPRETER=qemu-aarch64-static QEMU_LD_PREFIX=/system/lib64 BOX64_DYNAREC=0 ctest -j$(nproc) --repeat until-pass:20 --output-on-failure | |
INTERPRETER=qemu-aarch64-static QEMU_LD_PREFIX=/system/lib64 ctest -j$(nproc) --repeat until-pass:20 --output-on-failure | |
elif [[ ${{ matrix.platform }} == 'TERMUX' ]]; then | |
INTERPRETER=qemu-aarch64-static QEMU_SET_ENV=LD_LIBRARY_PATH=/data/data/com.termux/files/usr/lib QEMU_LD_PREFIX=/system/lib64:/data/data/com.termux/files/usr/lib BOX64_DYNAREC=0 ctest -j$(nproc) --repeat until-pass:20 --output-on-failure | |
INTERPRETER=qemu-aarch64-static QEMU_SET_ENV=LD_LIBRARY_PATH=/data/data/com.termux/files/usr/lib QEMU_LD_PREFIX=/system/lib64:/data/data/com.termux/files/usr/lib ctest -j$(nproc) --repeat until-pass:20 --output-on-failure | |
elif [[ ${{ matrix.platform }} != 'X64' ]]; then # AArch64 | |
INTERPRETER=qemu-aarch64-static QEMU_LD_PREFIX=/usr/aarch64-linux-gnu/ BOX64_DYNAREC=0 ctest -j$(nproc) --output-on-failure | |
INTERPRETER=qemu-aarch64-static QEMU_LD_PREFIX=/usr/aarch64-linux-gnu/ ctest -j$(nproc) --output-on-failure | |
INTERPRETER=qemu-aarch64-static QEMU_LD_PREFIX=/usr/aarch64-linux-gnu/ BOX64_DYNAREC_TEST=2 ctest -j$(nproc) --output-on-failure | |
else | |
ctest -j$(nproc) --output-on-failure | |
fi | |
- name: "Upload Artifact" | |
uses: actions/upload-artifact@v4 | |
with: | |
name: box64-${{ matrix.platform }}-${{ matrix.type }} | |
path: build/box64 |