mirror of
https://github.com/masonr/yet-another-bench-script.git
synced 2026-11-07 08:22:53 +08:00
add riscv64 to fio/iperf3 binary build workflows (#97)
This commit is contained in:
@@ -7,8 +7,8 @@ repository** - they are built automatically by GitHub Actions workflows
|
||||
[build-iperf3.yml](../.github/workflows/build-iperf3.yml)) on GitHub-hosted
|
||||
runners and published as release assets on this repository:
|
||||
|
||||
* `fio-*` releases (e.g. `fio-3.42`) - contain `fio_x64`, `fio_x86`, `fio_aarch64`, `fio_arm`
|
||||
* `iperf3-*` releases (e.g. `iperf3-3.21`) - contain `iperf3_x64`, `iperf3_x86`, `iperf3_aarch64`, `iperf3_arm`
|
||||
* `fio-*` releases (e.g. `fio-3.42`) - contain `fio_x64`, `fio_x86`, `fio_aarch64`, `fio_arm`, `fio_riscv64`
|
||||
* `iperf3-*` releases (e.g. `iperf3-3.21`) - contain `iperf3_x64`, `iperf3_x86`, `iperf3_aarch64`, `iperf3_arm`, `iperf3_riscv64`
|
||||
* `toolchains` release - musl cross-compilation toolchains mirrored from
|
||||
[musl.cc](https://musl.cc/) (which blocks GitHub Actions IP ranges); see the
|
||||
NOTICE.txt asset for licensing/source info
|
||||
@@ -33,7 +33,7 @@ issue if the binaries are out of date and lacking any security-related and/or
|
||||
performance updates - the daily scheduled workflows should pick up new upstream
|
||||
releases automatically.
|
||||
|
||||
Note: ARM compatibility is considered experimental.
|
||||
Note: ARM and RISC-V compatibility is considered experimental.
|
||||
|
||||
### Compile Notes (manual builds)
|
||||
|
||||
@@ -57,6 +57,10 @@ Compilation of 32-bit and ARM-compatible binaries requires additional
|
||||
environment variables to identify the proper musl toolchain and architecture to
|
||||
target for cross-compilation.
|
||||
|
||||
The musl.cc riscv64 toolchain is default-PIE, so the scripts pass `-no-pie` to
|
||||
produce classic static executables (a static-PIE fio fails to link, and a
|
||||
static-PIE iperf3 links but segfaults at runtime).
|
||||
|
||||
**Compiling 32-bit x86 binaries**:
|
||||
|
||||
```sh
|
||||
@@ -74,3 +78,9 @@ docker run -t -i --rm -v `pwd`:/io --env ARCH=aarch64 --env CROSS=aarch64-linux-
|
||||
```sh
|
||||
docker run -t -i --rm -v `pwd`:/io --env ARCH=arm --env CROSS=arm-linux-musleabihf --env HOST=arm-linux-gnueabihf phusion/holy-build-box-64:latest bash /io/cross-compile.sh
|
||||
```
|
||||
|
||||
**Compiling RISC-V 64-bit binaries**:
|
||||
|
||||
```sh
|
||||
docker run -t -i --rm -v `pwd`:/io --env ARCH=riscv64 --env CROSS=riscv64-linux-musl --env HOST=riscv64-linux-gnu phusion/holy-build-box-64:latest bash /io/cross-compile.sh
|
||||
```
|
||||
|
||||
@@ -39,8 +39,9 @@ cd fio-fio-*
|
||||
# conflicts under musl; sys/prctl.h alone is sufficient
|
||||
sed -i '/#include <linux\/prctl.h>/d' backend.c
|
||||
CC=/root/${CROSS}-cross/bin/${CROSS}-gcc ./configure --disable-native --build-static
|
||||
# link against libatomic for 32-bit/ARM targets that lack native 64-bit atomics
|
||||
make EXTLIBS+=' -latomic'
|
||||
# link against libatomic for 32-bit/ARM targets that lack native 64-bit atomics; -no-pie forces a
|
||||
# classic static executable on default-PIE toolchains (riscv64), where a static-PIE fails to link
|
||||
make EXTLIBS+=' -latomic -no-pie'
|
||||
|
||||
# verify no external shared library links
|
||||
libcheck fio
|
||||
@@ -52,7 +53,9 @@ cd ~
|
||||
curl -L https://github.com/esnet/iperf/archive/3.21.tar.gz -o "iperf.tar.gz"
|
||||
tar xf iperf.tar.gz
|
||||
cd iperf-*
|
||||
CC=/root/${CROSS}-cross/bin/${CROSS}-gcc ./configure --disable-shared --disable-profiling --build x86_64-pc-linux-gnu --host "${HOST}" --with-openssl=no --enable-static-bin
|
||||
# -no-pie must be set via LDFLAGS at configure time (passing it to make overrides automake's LDFLAGS and
|
||||
# drops --static); on default-PIE toolchains (riscv64) a static-PIE iperf3 links but segfaults at runtime
|
||||
LDFLAGS="${LDFLAGS} -no-pie" CC=/root/${CROSS}-cross/bin/${CROSS}-gcc ./configure --disable-shared --disable-profiling --build x86_64-pc-linux-gnu --host "${HOST}" --with-openssl=no --enable-static-bin
|
||||
# remove libatomic.la so libtool links the static libatomic.a rather than
|
||||
# attempting to link libatomic.so into the static binary (breaks arm32 builds)
|
||||
rm -f "/root/${CROSS}-cross/${CROSS}/lib/libatomic.la"
|
||||
|
||||
Reference in New Issue
Block a user