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, Mar 9, 1:38 PM
Unknown Object (File)
Sat, Mar 7, 6:23 PM
Unknown Object (File)
Thu, Mar 5, 6:06 AM
Unknown Object (File)
Thu, Mar 5, 3:16 AM
Unknown Object (File)
Wed, Mar 4, 7:48 PM
Unknown Object (File)
Wed, Mar 4, 2:31 PM
Unknown Object (File)
Wed, Mar 4, 2:30 PM
Unknown Object (File)
Wed, Mar 4, 8:02 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 Not Applicable
Unit
Tests Not Applicable

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.