diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9465406..294975b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,18 +79,30 @@ jobs: with: targets: riscv64gc-unknown-linux-gnu - - name: Install cross-compilation toolchain + - name: Install zig + uses: mlugg/setup-zig@v2 + with: + version: 0.16.0 + + - name: Install cargo-zigbuild + run: cargo install cargo-zigbuild --locked + + # zig may print "ignoring deprecated linker optimization setting" — harmless, build still succeeds + - name: Build for RISC-V (glibc 2.31 floor) + run: cargo zigbuild --release --target riscv64gc-unknown-linux-gnu.2.31 --package riscfetch + + - name: Verify glibc floor run: | + set -euo pipefail sudo apt-get update - sudo apt-get install -y gcc-riscv64-linux-gnu + sudo apt-get install -y binutils-riscv64-linux-gnu + max=$(riscv64-linux-gnu-objdump -T target/riscv64gc-unknown-linux-gnu/release/riscfetch | grep -o 'GLIBC_[0-9.]*' | sort -uV | tail -1) + echo "max glibc symbol: $max" + test "$(printf 'GLIBC_2.31\n%s\n' "$max" | sort -V | tail -1)" = "GLIBC_2.31" - - name: Configure cargo for cross-compilation - run: | - mkdir -p .cargo - cat >> .cargo/config.toml << 'EOF' - [target.riscv64gc-unknown-linux-gnu] - linker = "riscv64-linux-gnu-gcc" - EOF - - - name: Build for RISC-V - run: cargo build --workspace --target riscv64gc-unknown-linux-gnu + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: riscfetch-linux-riscv64 + path: target/riscv64gc-unknown-linux-gnu/release/riscfetch + if-no-files-found: error diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fcdaa3c..5ca2390 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,21 +27,26 @@ jobs: with: targets: riscv64gc-unknown-linux-gnu - - name: Install cross-compilation toolchain - run: | - sudo apt-get update - sudo apt-get install -y gcc-riscv64-linux-gnu + - name: Install zig + uses: mlugg/setup-zig@v2 + with: + version: 0.16.0 - - name: Configure cargo for cross-compilation - run: | - mkdir -p .cargo - cat >> .cargo/config.toml << 'EOF' - [target.riscv64gc-unknown-linux-gnu] - linker = "riscv64-linux-gnu-gcc" - EOF + - name: Install cargo-zigbuild + run: cargo install cargo-zigbuild --locked - - name: Build for RISC-V - run: cargo build --release --target riscv64gc-unknown-linux-gnu --package riscfetch + # zig may print "ignoring deprecated linker optimization setting" — harmless, build still succeeds + - name: Build for RISC-V (glibc 2.31 floor) + run: cargo zigbuild --release --target riscv64gc-unknown-linux-gnu.2.31 --package riscfetch + + - name: Verify glibc floor + run: | + set -euo pipefail + sudo apt-get update + sudo apt-get install -y binutils-riscv64-linux-gnu + max=$(riscv64-linux-gnu-objdump -T target/riscv64gc-unknown-linux-gnu/release/riscfetch | grep -o 'GLIBC_[0-9.]*' | sort -uV | tail -1) + echo "max glibc symbol: $max" + test "$(printf 'GLIBC_2.31\n%s\n' "$max" | sort -V | tail -1)" = "GLIBC_2.31" - name: Package artifact run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d22b90..f1616f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,9 @@ All notable changes to this project will be documented in this file. - Extension count: 147 → 151 (103 Z + 48 S) - Detection keywords reorganized into 3 explicit tiers (SoC identifiers → board names → vendor names) so a board name shipped across multiple SoC generations resolves to the correct SoC vendor instead of a stale one (e.g. DeepComputing DC-ROMA shipped on StarFive JH7110, then SpacemiT K3 silicon; Milk-V/Banana Pi/Sipeed ship both SpacemiT K1 and K3 boards). 5 new SoC-identifier keywords added (`spacemit,k1`, `spacemit,k3`, `sg2044`, `sg2380`, `sun20i`); detection keyword count: 42 → 47 +### Fixed +- Prebuilt riscv64 binary now targets glibc 2.31 (built with cargo-zigbuild); v2.3.1's binary required glibc 2.39 and failed on Ubuntu 22.04 boards (#18) + ## [2.3.1] - 2026-04-27 ### Fixed diff --git a/README.ja.md b/README.ja.md index a256db7..fde7108 100644 --- a/README.ja.md +++ b/README.ja.md @@ -46,6 +46,8 @@ chmod +x riscfetch-linux-riscv64 sudo mv riscfetch-linux-riscv64 /usr/local/bin/riscfetch ``` +glibc 2.31 以上が必要です。 + ## 使い方 ```bash diff --git a/README.md b/README.md index c9a278d..76a3bcd 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,8 @@ chmod +x riscfetch-linux-riscv64 sudo mv riscfetch-linux-riscv64 /usr/local/bin/riscfetch ``` +Requires glibc >= 2.31. + ## Usage ```bash diff --git a/README.zh-CN.md b/README.zh-CN.md index ee8fd88..8b3fb7c 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -46,6 +46,8 @@ chmod +x riscfetch-linux-riscv64 sudo mv riscfetch-linux-riscv64 /usr/local/bin/riscfetch ``` +需要 glibc >= 2.31。 + ## 使用方法 ```bash