From 647ee11917f908f5ae8f9c31b51b4a2b181521e3 Mon Sep 17 00:00:00 2001 From: spvkgn Date: Tue, 17 Dec 2024 10:02:29 +0500 Subject: [PATCH 1/2] github: optimize --- .github/workflows/build.yml | 39 ++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8a62737..2e97860 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,9 +22,6 @@ jobs: fail-fast: false matrix: include: - - arch: lexra - tool: mips-linux - dir: rsdk-4.6.4-5281-EB-3.10-0.9.33-m32ub-20141001 - arch: arm64 tool: aarch64-unknown-linux-musl - arch: arm @@ -55,6 +52,12 @@ jobs: tool: i586-unknown-linux-musl - arch: x86_64 tool: x86_64-unknown-linux-musl + - arch: lexra + tool: mips-linux + dir: rsdk-4.6.4-5281-EB-3.10-0.9.33-m32ub-20141001 + env: + LDFLAGS: '-lgcc_eh' + repo: 'bol-van/build' steps: - name: Checkout uses: actions/checkout@v4 @@ -63,27 +66,30 @@ jobs: - name: Set up build tools env: - REPO: 'spvkgn/musl-cross' - REPO_LEXRA: 'bol-van/build' + REPO: ${{ matrix.arch == 'lexra' && matrix.repo || 'spvkgn/musl-cross' }} ARCH: ${{ matrix.arch }} TOOL: ${{ matrix.tool }} - DIR: ${{ matrix.dir }} + DIR: ${{ matrix.arch == 'lexra' && matrix.dir || matrix.tool }} run: | - DIR=${DIR:-$TOOL} - [ "$ARCH" = lexra ] && sudo dpkg --add-architecture i386 - sudo apt update -qq - sudo apt install -y libcap-dev - [ "$ARCH" = lexra ] && sudo apt install -y libc6:i386 zlib1g:i386 + if [[ "$ARCH" == lexra ]]; then + sudo dpkg --add-architecture i386 + sudo apt update -qq + sudo apt install -y libcap-dev libc6:i386 zlib1g:i386 + URL=https://github.com/$REPO/raw/refs/heads/master/$DIR.txz + else + sudo apt update -qq + sudo apt install -y libcap-dev + URL=https://github.com/$REPO/releases/download/latest/$TOOL.tar.xz + fi mkdir -p $HOME/tools - URL=https://github.com/$REPO/releases/download/latest/$DIR.tar.xz - [ "$ARCH" = lexra ] && URL=https://github.com/$REPO_LEXRA/raw/refs/heads/master/$DIR.txz wget -qO- $URL | tar -C $HOME/tools -xJ || exit 1 - [ -d "$HOME/tools/$DIR/bin" ] && echo "$HOME/tools/$DIR/bin" >> $GITHUB_PATH + [[ -d "$HOME/tools/$DIR/bin" ]] && echo "$HOME/tools/$DIR/bin" >> $GITHUB_PATH - name: Build env: ARCH: ${{ matrix.arch }} TARGET: ${{ matrix.tool }} + LDFLAGS: ${{ matrix.env.LDFLAGS != '' && matrix.env.LDFLAGS || null }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | DEPS_DIR=$GITHUB_WORKSPACE/deps @@ -93,10 +99,7 @@ jobs: export NM=$TARGET-nm export STRIP=$TARGET-strip export PKG_CONFIG_PATH=$DEPS_DIR/lib/pkgconfig - export STAGING_DIR=/tmp - LDFLAGS= - [ "$ARCH" = lexra ] && LDFLAGS=-lgcc_eh - export LDFLAGS + export STAGING_DIR=$RUNNER_TEMP # netfilter libs wget -qO- https://www.netfilter.org/pub/libnfnetlink/libnfnetlink-1.0.2.tar.bz2 | tar -xj From 202b7224fbb311306dad17dd09220c5cc54eb3c2 Mon Sep 17 00:00:00 2001 From: spvkgn Date: Wed, 18 Dec 2024 09:52:58 +0500 Subject: [PATCH 2/2] github: set target to RX5281 for lexra --- .github/workflows/build.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2e97860..02d38ae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,6 +56,7 @@ jobs: tool: mips-linux dir: rsdk-4.6.4-5281-EB-3.10-0.9.33-m32ub-20141001 env: + CFLAGS: '-march=5281' LDFLAGS: '-lgcc_eh' repo: 'bol-van/build' steps: @@ -66,9 +67,9 @@ jobs: - name: Set up build tools env: - REPO: ${{ matrix.arch == 'lexra' && matrix.repo || 'spvkgn/musl-cross' }} ARCH: ${{ matrix.arch }} TOOL: ${{ matrix.tool }} + REPO: ${{ matrix.arch == 'lexra' && matrix.repo || 'spvkgn/musl-cross' }} DIR: ${{ matrix.arch == 'lexra' && matrix.dir || matrix.tool }} run: | if [[ "$ARCH" == lexra ]]; then @@ -89,6 +90,7 @@ jobs: env: ARCH: ${{ matrix.arch }} TARGET: ${{ matrix.tool }} + CFLAGS: ${{ matrix.env.CFLAGS != '' && matrix.env.CFLAGS || null }} LDFLAGS: ${{ matrix.env.LDFLAGS != '' && matrix.env.LDFLAGS || null }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | @@ -109,7 +111,7 @@ jobs: for i in libmnl libnfnetlink libnetfilter_queue ; do ( cd $i-* - CFLAGS="-Os -flto=auto" \ + CFLAGS="-Os -flto=auto $CFLAGS" \ ./configure --prefix= --host=$TARGET --enable-static --disable-shared --disable-dependency-tracking make install -j$(nproc) DESTDIR=$DEPS_DIR ) @@ -121,7 +123,7 @@ jobs: xargs -I{} wget -qO- https://github.com/madler/zlib/archive/refs/tags/{}.tar.gz | tar -xz ( cd zlib-* - CFLAGS="-Os -flto=auto" \ + CFLAGS="-Os -flto=auto $CFLAGS" \ ./configure --prefix= --static make install -j$(nproc) DESTDIR=$DEPS_DIR ) @@ -132,7 +134,7 @@ jobs: install -Dm644 -t $DEPS_DIR/include/sys /usr/include/x86_64-linux-gnu/sys/queue.h /usr/include/sys/capability.h # zapret - CFLAGS="-DZAPRET_GH_VER=${{ github.ref_name }} -DZAPRET_GH_HASH=${{ github.sha }} -static-libgcc -static -I$DEPS_DIR/include" \ + CFLAGS="-DZAPRET_GH_VER=${{ github.ref_name }} -DZAPRET_GH_HASH=${{ github.sha }} -static-libgcc -static -I$DEPS_DIR/include $CFLAGS" \ LDFLAGS="-L$DEPS_DIR/lib $LDFLAGS" \ make -C zapret -j$(nproc) tar -C zapret/binaries/my -cJf zapret-linux-$ARCH.tar.xz .