Page MenuHomeFreeBSD

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

Authored by brooks on Mon, Feb 16, 1:49 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Feb 23, 9:57 PM
Unknown Object (File)
Mon, Feb 23, 9:57 PM
Unknown Object (File)
Mon, Feb 23, 3:34 PM
Unknown Object (File)
Fri, Feb 20, 8:38 PM
Unknown Object (File)
Fri, Feb 20, 6:44 PM
Unknown Object (File)
Thu, Feb 19, 12:31 AM
Unknown Object (File)
Thu, Feb 19, 12:17 AM
Unknown Object (File)
Thu, Feb 19, 12:16 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.Tue, Feb 17, 11:24 AM
This revision was automatically updated to reflect the committed changes.
brooks marked an inline comment as done.