diff --git a/.github/workflows/buildbsd.yml b/.github/workflows/buildbsd.yml new file mode 100644 index 0000000..4851278 --- /dev/null +++ b/.github/workflows/buildbsd.yml @@ -0,0 +1,64 @@ +name: build and test bsd + +on: + push: + branches: [ master, dev ] + + pull_request: + branches: [ master ] + +# The BSDs use the same sysv_amd64 ABI as Linux, so these jobs build and test +# the existing sources rather than producing an additional library artifact. +# Each job runs in a real VM on the ubuntu-latest runner; GNU make is required +# because the Makefile uses GNU make syntax, while the BSD base system make +# is bmake. + +jobs: + + build-freebsd: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6.0.2 + - name: build and test + uses: vmactions/freebsd-vm@v1 + with: + usesh: true + cache-after-prepare: true + prepare: | + pkg install -y gmake + run: | + set -ex + gmake all + gmake test + + build-openbsd: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6.0.2 + - name: build and test + uses: vmactions/openbsd-vm@v1 + with: + usesh: true + cache-after-prepare: true + prepare: | + pkg_add -I gmake + run: | + set -ex + gmake all + gmake test + + build-netbsd: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6.0.2 + - name: build and test + uses: vmactions/netbsd-vm@v1 + with: + usesh: true + cache-after-prepare: true + prepare: | + /usr/sbin/pkg_add gmake + run: | + set -ex + gmake all + gmake test diff --git a/CHANGELOG.md b/CHANGELOG.md index 80fb048..49f2c42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added +- FreeBSD, OpenBSD and NetBSD (amd64, `sysv_amd64` ABI) are built and tested on every commit by a new `build and test bsd` workflow. + +### Fixed +- ABI detection now works on the BSDs: `tools/abiname.sh` used a `mktemp` template with three `X`s, which BSD `mktemp(1)` rejects. + ## [1.2.5] - 2026-06-23 ### Changed diff --git a/README.md b/README.md index 1b6326d..1e770b8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ [![build test and commit](https://github.com/stackless-dev/stackman/actions/workflows/buildcommit.yml/badge.svg)](https://github.com/stackless-dev/stackman/actions/workflows/buildcommit.yml) +[![build and test bsd](https://github.com/stackless-dev/stackman/actions/workflows/buildbsd.yml/badge.svg)](https://github.com/stackless-dev/stackman/actions/workflows/buildbsd.yml) ``` @@ -101,9 +102,16 @@ calling convention, plus archive format: - win_x86 (32-bit) - win_x64 (64-bit) - win_arm64 (64-bit ARM) + - **FreeBSD, OpenBSD, NetBSD (System V ABI)** + - sysv_amd64 (64-bit x86_64) All platforms are automatically built and tested by GitHub Actions CI on every commit. +The BSDs share the `sysv_amd64` ABI with Linux and therefore need no separate +assembly implementation or pre-built library; they are built and tested from +source by the `build and test bsd` workflow. Note that the Makefile requires +GNU make, which on the BSDs is `gmake` rather than the base system `make`. + ### Supported toolchains: - Gnu C diff --git a/tools/abiname.sh b/tools/abiname.sh index 472c012..d4fd663 100644 --- a/tools/abiname.sh +++ b/tools/abiname.sh @@ -61,7 +61,8 @@ abi_from_target_triple() { mkdir -p "${here}/tmp" # Clean up any stale temp files first rm -f "${here}/tmp"/abiname*.c "${here}/tmp"/abiname*.c.out -tmp=$(mktemp "${here}/tmp/abinameXXX.c") +# BSD mktemp(1) requires at least six trailing Xs; GNU mktemp accepts them too. +tmp=$(mktemp "${here}/tmp/abinameXXXXXX.c") #1 create the preprocessed file CC=${1:-cc}