From 18c7eb7233068798afabb05e0b641cd062789003 Mon Sep 17 00:00:00 2001 From: Ben Lewis Date: Tue, 11 Aug 2026 21:57:20 +0000 Subject: [PATCH 1/5] Build clean with musl-gcc --- src/udpstream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/udpstream.c b/src/udpstream.c index 9612903..2a1c273 100644 --- a/src/udpstream.c +++ b/src/udpstream.c @@ -115,7 +115,7 @@ void *run_ntttcp_sender_udp4_stream(struct ntttcp_stream_client *sc) if (sc->socket_fq_rate_limit_bytes != 0) enable_fq_rate_limit(sc, sockfd); - if (connect(sockfd, &serv_addr, sa_size) == -1) { + if (connect(sockfd, (const struct sockaddr *)&serv_addr, sa_size) == -1) { ASPRINTF(&log,"failed to connect socket[%d] to remote: [%s:%d]. errno = %d.", sockfd, sc->bind_address, sc->server_port, errno); PRINT_ERR_FREE(log); From c131255b464fb1bff1400b708026c1f23187e25a Mon Sep 17 00:00:00 2001 From: Ben Lewis Date: Tue, 11 Aug 2026 23:08:01 +0000 Subject: [PATCH 2/5] Switch the actions to building for musl-gcc --- .github/workflows/ci.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9f6e2fe..afe4d27 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,8 +9,11 @@ jobs: name: build x86-64 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - run: cd src/ && cmake . && make && ls -lh ntttcp && file ntttcp + - uses: gerlero/apt-install@v1 + with: + packages: musl musl-dev musl-tools + - uses: actions/checkout@v7 + - run: cd src/ && CC="musl-gcc" cmake -DCMAKE_C_FLAGS="-static" . && make && ls -lh ntttcp && file ntttcp - name: Uploads binary file for x86-64 uses: actions/upload-artifact@v4 @@ -23,7 +26,7 @@ jobs: name: build aarch64 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - uses: uraimo/run-on-arch-action@v2 name: Build artifact id: build @@ -31,8 +34,8 @@ jobs: arch: aarch64 distro: ubuntu20.04 run: | - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential cmake file - cd src/ && cmake . && make && ls -lh ntttcp && file ntttcp + apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential cmake file musl musl-dev musl-tools + cd src/ && CC="musl-gcc" cmake -DCMAKE_C_FLAGS="-static" . && make && ls -lh ntttcp && file ntttcp - name: Uploads binary file for aarch64 uses: actions/upload-artifact@v4 From 9871c4b2c9f45be8c94c55501bc046e718f61f64 Mon Sep 17 00:00:00 2001 From: Ben Lewis Date: Tue, 11 Aug 2026 23:12:33 +0000 Subject: [PATCH 3/5] Lift and shift actions. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index afe4d27..d44c670 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: - run: cd src/ && CC="musl-gcc" cmake -DCMAKE_C_FLAGS="-static" . && make && ls -lh ntttcp && file ntttcp - name: Uploads binary file for x86-64 - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: ntttcp-x86_64 path: src/ntttcp @@ -38,7 +38,7 @@ jobs: cd src/ && CC="musl-gcc" cmake -DCMAKE_C_FLAGS="-static" . && make && ls -lh ntttcp && file ntttcp - name: Uploads binary file for aarch64 - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: ntttcp-aarch64 path: src/ntttcp From 87911c17979c0ed1c77a4bf2961f1c244d061a21 Mon Sep 17 00:00:00 2001 From: Ben Lewis Date: Tue, 11 Aug 2026 23:21:25 +0000 Subject: [PATCH 4/5] Update run-on-arch as well --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d44c670..b37891d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,12 +27,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - - uses: uraimo/run-on-arch-action@v2 + - uses: uraimo/run-on-arch-action@v3 name: Build artifact id: build with: arch: aarch64 - distro: ubuntu20.04 + distro: ubuntu_latest run: | apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential cmake file musl musl-dev musl-tools cd src/ && CC="musl-gcc" cmake -DCMAKE_C_FLAGS="-static" . && make && ls -lh ntttcp && file ntttcp From c110034fb88b713cd5e0cbb3f0556f1166afa97d Mon Sep 17 00:00:00 2001 From: Ben Lewis Date: Tue, 1 Sep 2026 18:02:29 +0000 Subject: [PATCH 5/5] Updated readme & tool version --- README.md | 1 + src/const.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f04cfbe..0202417 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ A multiple-threaded Linux network throughput benchmark tool. * Support writing log into JSON file ('-j'). +* CI build statically links with [musl libc](https://wiki.musl-libc.org/getting-started.html) for portability across Linux distros & releases. ## Getting Started diff --git a/src/const.h b/src/const.h index 08566ae..5ae0a8d 100644 --- a/src/const.h +++ b/src/const.h @@ -5,7 +5,7 @@ // ---------------------------------------------------------------------------------- #define TOOL_NAME "NTTTCP for Linux" -#define TOOL_VERSION "1.4.7" +#define TOOL_VERSION "1.4.8" #define AUTHOR_NAME "Shihua (Simon) Xiao, sixiao@microsoft.com" #define TCP SOCK_STREAM