From 24a8faec9a0931aff6fa38757a73f01e6144ee27 Mon Sep 17 00:00:00 2001 From: Joshua Sing Date: Sat, 12 Apr 2025 22:27:01 +1000 Subject: ci: test on loongarch64 --- .github/workflows/linux.yml | 2 +- scripts/test | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index d57e3bc..bc3c692 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -23,7 +23,7 @@ jobs: fail-fast: false matrix: os: ["ubuntu-22.04", "ubuntu-24.04"] - arch: ["native", "arm32", "arm64", "mingw32", "mingw64", "mips64"] + arch: ["native", "arm32", "arm64", "loong64", "mingw32", "mingw64", "mips64"] compiler: ["gcc"] include: - os: "ubuntu-22.04" diff --git a/scripts/test b/scripts/test index 1fb02eb..473d689 100755 --- a/scripts/test +++ b/scripts/test @@ -132,6 +132,21 @@ elif [ "$ARCH" = "arm32" -o "$ARCH" = "arm64" ]; then file apps/openssl/.libs/openssl +elif [ "$ARCH" = "loong64" ]; then + sudo apt install -y qemu-user-static binfmt-support g++-14-loongarch64-linux-gnu + sudo ln -sf /usr/loongarch64-linux-gnu/lib/ld-linux-loongarch-lp64d.so.1 /lib + + CC=loongarch64-linux-gnu-gcc-14 + CXX=loongarch64-linux-gnu++-14 + AR=loongarch64-linux-gnu-ar + STRIP=loongarch64-linux-gnu-strip-14 + RANLIB=loongarch64-linux-gnu-ranlib + + ./configure --host=loongarch64-linux-gnu + LD_LIBRARY_PATH=/usr/loongarch64-linux-gnu/lib make -j 4 check + + file apps/openssl/openssl + elif [ "$ARCH" = "mips32" -o "$ARCH" = "mips64" ]; then sudo apt-get install -y qemu-user-static binfmt-support -- cgit v1.2.3-55-g6feb From f4cc344689038ef1c5a3280aa5bf9754fe751ba3 Mon Sep 17 00:00:00 2001 From: Joshua Sing Date: Sat, 12 Apr 2025 23:12:57 +1000 Subject: scripts/test: change from g++-14 to g++ --- scripts/test | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/test b/scripts/test index 473d689..e25a57a 100755 --- a/scripts/test +++ b/scripts/test @@ -133,13 +133,13 @@ elif [ "$ARCH" = "arm32" -o "$ARCH" = "arm64" ]; then file apps/openssl/.libs/openssl elif [ "$ARCH" = "loong64" ]; then - sudo apt install -y qemu-user-static binfmt-support g++-14-loongarch64-linux-gnu + sudo apt install -y qemu-user-static binfmt-support g++-loongarch64-linux-gnu sudo ln -sf /usr/loongarch64-linux-gnu/lib/ld-linux-loongarch-lp64d.so.1 /lib - CC=loongarch64-linux-gnu-gcc-14 - CXX=loongarch64-linux-gnu++-14 + CC=loongarch64-linux-gnu-gcc + CXX=loongarch64-linux-gnu++ AR=loongarch64-linux-gnu-ar - STRIP=loongarch64-linux-gnu-strip-14 + STRIP=loongarch64-linux-gnu-strip RANLIB=loongarch64-linux-gnu-ranlib ./configure --host=loongarch64-linux-gnu -- cgit v1.2.3-55-g6feb From a71747c235e1044a6463909a8916a91eaec1b32c Mon Sep 17 00:00:00 2001 From: Joshua Sing Date: Sat, 12 Apr 2025 23:41:15 +1000 Subject: scripts/test: revert to using g++-14 It seems `g++-loongarch64-linux-gnu` does not exist in the Ubuntu universe repositories. It also fails using the ubuntu Docker image locally (with the universe repo added). `g++-14-loongarch-linux-gnu` exists on both Ubuntu 22.04 and 24.04, however ideally we want to use whatever works on the most platforms. --- scripts/test | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/test b/scripts/test index e25a57a..473d689 100755 --- a/scripts/test +++ b/scripts/test @@ -133,13 +133,13 @@ elif [ "$ARCH" = "arm32" -o "$ARCH" = "arm64" ]; then file apps/openssl/.libs/openssl elif [ "$ARCH" = "loong64" ]; then - sudo apt install -y qemu-user-static binfmt-support g++-loongarch64-linux-gnu + sudo apt install -y qemu-user-static binfmt-support g++-14-loongarch64-linux-gnu sudo ln -sf /usr/loongarch64-linux-gnu/lib/ld-linux-loongarch-lp64d.so.1 /lib - CC=loongarch64-linux-gnu-gcc - CXX=loongarch64-linux-gnu++ + CC=loongarch64-linux-gnu-gcc-14 + CXX=loongarch64-linux-gnu++-14 AR=loongarch64-linux-gnu-ar - STRIP=loongarch64-linux-gnu-strip + STRIP=loongarch64-linux-gnu-strip-14 RANLIB=loongarch64-linux-gnu-ranlib ./configure --host=loongarch64-linux-gnu -- cgit v1.2.3-55-g6feb From 736426b53fd6c4bf6b1e1edff90e7dd0835fdfcf Mon Sep 17 00:00:00 2001 From: Joshua Sing Date: Sat, 12 Apr 2025 23:55:48 +1000 Subject: ci: add universe apt repository for loong64 runs --- .github/workflows/linux.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index bc3c692..bce596b 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -36,6 +36,10 @@ jobs: - name: "Checkout repository" uses: actions/checkout@v4 + - name: "Add universe repository" + if: matrix.arch == 'loong64' + run: sudo add-apt-repository universe + - name: "Run tests" run: ./scripts/test env: -- cgit v1.2.3-55-g6feb From 1cee3363decb5c59299e437ebcd400e2f7d8e318 Mon Sep 17 00:00:00 2001 From: Joshua Sing Date: Sun, 13 Apr 2025 00:38:28 +1000 Subject: ci: only test loong64 on ubuntu-24.04 Versions of Ubuntu prior to 24.04 do not have the g++{,-14}-loongarch64-linux-gnu package. --- .github/workflows/linux.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index bce596b..6fa3f53 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -23,7 +23,7 @@ jobs: fail-fast: false matrix: os: ["ubuntu-22.04", "ubuntu-24.04"] - arch: ["native", "arm32", "arm64", "loong64", "mingw32", "mingw64", "mips64"] + arch: ["native", "arm32", "arm64", "mingw32", "mingw64", "mips64"] compiler: ["gcc"] include: - os: "ubuntu-22.04" @@ -32,14 +32,13 @@ jobs: - os: "ubuntu-24.04" arch: "native" compiler: "clang" + - os: "ubuntu-24.04" # loong64 + arch: "loong64" + compiler: "gcc" steps: - name: "Checkout repository" uses: actions/checkout@v4 - - name: "Add universe repository" - if: matrix.arch == 'loong64' - run: sudo add-apt-repository universe - - name: "Run tests" run: ./scripts/test env: -- cgit v1.2.3-55-g6feb From a516251595b6451806372d5f7d08deb581a4824c Mon Sep 17 00:00:00 2001 From: Joshua Sing Date: Sun, 13 Apr 2025 00:59:35 +1000 Subject: ci: print test suite log on failure --- .github/workflows/linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 6fa3f53..fd0650e 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -40,7 +40,7 @@ jobs: uses: actions/checkout@v4 - name: "Run tests" - run: ./scripts/test + run: ./scripts/test || cat tests/test-suite.log env: ARCH: "${{ matrix.arch }}" CC: "${{ matrix.compiler }}" -- cgit v1.2.3-55-g6feb From 090f7892f7f7280f69289dc5e99ab5ed64908269 Mon Sep 17 00:00:00 2001 From: Joshua Sing Date: Sun, 13 Apr 2025 01:09:48 +1000 Subject: scripts/test: use lib64 for loongarch64 --- .github/workflows/linux.yml | 2 +- scripts/test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index fd0650e..88dd15e 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -40,7 +40,7 @@ jobs: uses: actions/checkout@v4 - name: "Run tests" - run: ./scripts/test || cat tests/test-suite.log + run: ./scripts/test || (status=$?; cat tests/test-suite.log; exit $status) env: ARCH: "${{ matrix.arch }}" CC: "${{ matrix.compiler }}" diff --git a/scripts/test b/scripts/test index 473d689..a93fe90 100755 --- a/scripts/test +++ b/scripts/test @@ -134,7 +134,7 @@ elif [ "$ARCH" = "arm32" -o "$ARCH" = "arm64" ]; then elif [ "$ARCH" = "loong64" ]; then sudo apt install -y qemu-user-static binfmt-support g++-14-loongarch64-linux-gnu - sudo ln -sf /usr/loongarch64-linux-gnu/lib/ld-linux-loongarch-lp64d.so.1 /lib + sudo ln -sf /usr/loongarch64-linux-gnu/lib64/ld-linux-loongarch-lp64d.so.1 /lib64 CC=loongarch64-linux-gnu-gcc-14 CXX=loongarch64-linux-gnu++-14 -- cgit v1.2.3-55-g6feb