Skip to content

0.29.1: FreeBSD, over openkal-freebsd standalone - #89

Merged
Sunrisepeak merged 3 commits into
mainfrom
feat/freebsd
Nov 10, 2026
Merged

Sunrisepeak merged 3 commits into
mainfrom
feat/freebsd

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

Summary

openkal-musl for the rows x86_64-freebsd-musl and aarch64-freebsd-musl: the C library of a program whose kernel layer is openkal-freebsd in its standalone arrangement (mcpp's FreeBSD route B).

  • The FreeBSD condition. openkal-freebsd = { version = "^0.1.0", features = ["standalone"] }, and a static link block. The implementation begins the program.
  • Architecture headers. musl-generated/{x86_64,aarch64}-freebsd give wint_t as int, as FreeBSD's __WINT_TYPE__ states. The type-identity checks gain rows for os=freebsd.
  • elf_aux_info (FreeBSD's <sys/auxv.h>) is answered over musl's own auxiliary vector. compiler-rt's aarch64 cpu_model calls it on FreeBSD (openkal-llvm-runtime). An entry the vector does not hold (AT_HWCAP) answers ENOENT, so compiler-rt keeps its LL/SC atomics.

Verification

This PR is merged after openkal-freebsd 0.1.0 is released and indexed, since the FreeBSD condition names it.

On FreeBSD this C library names openkal-freebsd ^0.1 with the feature
standalone, as Linux's and macOS's implementations are named, and links
a program above it statically, as on Linux: the rows
x86_64-freebsd-musl and aarch64-freebsd-musl.
FreeBSD's ABI states wint_t as int on x86_64 and aarch64 (the compiler's
__WINT_TYPE__), where musl's is unsigned; okm_type_identity.c refused the
build. musl-generated/<arch>-freebsd differ from <arch> in that one line,
and the rows for FreeBSD name them.
A consumer written for FreeBSD reads the auxiliary vector with elf_aux_info (<sys/auxv.h>, FreeBSD 12): compiler-rt's aarch64 cpu_model, built by openkal-llvm-runtime for aarch64-freebsd-musl, stopped at 'call to undeclared function elf_aux_info'. port/include/sys/auxv.h declares it on the FreeBSD rows over musl's header, and port/src/okm_elf_aux_info.c answers over musl's own vector as FreeBSD's does: 0 and the value, ENOENT for an entry the vector does not hold (AT_HWCAP, so compiler-rt keeps its LL/SC atomics), EINVAL otherwise.
@Sunrisepeak
Sunrisepeak merged commit 867307b into main Nov 10, 2026
11 checks passed
@Sunrisepeak
Sunrisepeak deleted the feat/freebsd branch November 10, 2026 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant