HomeFreeBSD

stand: Fix inclusion of sys/blake3.h

Description

stand: Fix inclusion of sys/blake3.h

sys/blake3.h is not safe to include in a standalone environment. It
assumes, unwisely, that there's only kernel or userland. The userland
choice is bad due to imperfections in how we handle stdlib.h in this
environment (we wind up including the host's stdlib.h, it expects a
standard FreeBSD setup which the gymnastics we've done to create a
OpenSolaris/Illumos-like environment interfere with). Thankfully, in
this case we can just pretend to be the kernel for a little bit by
defining _KERNEL and the undefing it after we exit.

Sponsored by: Netflix
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D35750

Details

Provenance
impAuthored on Jul 8 2022, 11:34 PM
Reviewer
kevans
Differential Revision
D35750: Make blake3 work
Parents
rGfaf25f48d601: stand: Work around upstream issues in the standalone environment
Branches
Unknown
Tags
Unknown