diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9f6e2fe..b37891d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,11 +9,14 @@ 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 + uses: actions/upload-artifact@v7 with: name: ntttcp-x86_64 path: src/ntttcp @@ -23,19 +26,19 @@ jobs: name: build aarch64 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: uraimo/run-on-arch-action@v2 + - uses: actions/checkout@v7 + - 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 - 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 + uses: actions/upload-artifact@v7 with: name: ntttcp-aarch64 path: src/ntttcp 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 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);