Page MenuHomeFreeBSD

build: add stddef.h to define ptraddr_t as required
ClosedPublic

Authored by brooks on Feb 16 2026, 1:49 PM.
Tags
None
Referenced Files
F153973158: D55308.id171976.diff
Sat, Apr 25, 5:01 AM
Unknown Object (File)
Fri, Apr 24, 3:48 PM
Unknown Object (File)
Fri, Apr 24, 3:47 AM
Unknown Object (File)
Thu, Apr 23, 3:45 AM
Unknown Object (File)
Wed, Apr 22, 5:58 PM
Unknown Object (File)
Tue, Apr 21, 6:36 AM
Unknown Object (File)
Tue, Apr 21, 1:15 AM
Unknown Object (File)
Tue, Apr 21, 1:15 AM
Subscribers

Details

Summary

Effort: CHERI upstreaming
Sponsored by: Innovate UK
Co-authored-by: Alfredo Mazzinghi <am2419@cl.cam.ac.uk>
Co-authored-by: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 70702
Build 67585: arc lint + arc unit

Event Timeline

With this stack of changes it's possible to (cross)build world and kernel with ptraddr_t in a system header.

jrtc27 added inline comments.
tools/build/stddef.h
44

Isn't this wrong for 32-bit? Should we not use PTRADDR_TYPE if available, else fall back on size_t?

Use PTRADDR_TYPE where available

tools/build/stddef.h
44

It should be 32-bit on ILP32 and 64-bit on LP64. It's wrong on LLP64, but I don't think we care. Another alternative would be size_t.

tools/build/stddef.h
44

It's the right size but not the same type, and that affects things like printf format strings. Hence the suggestion to fall back on size_t, which will be unsigned int as expected.

Use size_t as the fall back type

brooks added inline comments.
tools/build/stddef.h
44

Right, I keep forgetting nearly everything is an int in ILP32.

This revision is now accepted and ready to land.Feb 17 2026, 11:24 AM
This revision was automatically updated to reflect the committed changes.
brooks marked an inline comment as done.