Page MenuHomeFreeBSD

rtld: Switch to using <assert.h> for assert
ClosedPublic

Authored by jhb on Wed, Jan 14, 3:30 PM.
Tags
None
Referenced Files
F142976503: D54712.id169720.diff
Sun, Jan 25, 1:22 AM
F142917582: D54712.id169704.diff
Sat, Jan 24, 5:16 PM
Unknown Object (File)
Fri, Jan 23, 7:45 AM
Unknown Object (File)
Wed, Jan 21, 4:17 PM
Unknown Object (File)
Tue, Jan 20, 10:02 AM
Unknown Object (File)
Mon, Jan 19, 6:07 PM
Unknown Object (File)
Mon, Jan 19, 4:11 PM
Unknown Object (File)
Mon, Jan 19, 3:50 AM
Subscribers

Details

Summary

The stock assert() works because rtld-libc includes a custom
implementation of __assert().

Obtained from: CheriBSD
Sponsored by: AFRL, DARPA

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 69878
Build 66761: arc lint + arc unit

Event Timeline

jhb requested review of this revision.Wed, Jan 14, 3:30 PM

One consequence of this change is that NDEBUG will now disable assertions in rtld itself (and not just the bits of libc pulled into rtld-libc.a). Downstream in CheriBSD we #undef'd NDEBUG in debug.h, but I think honoring NDEBUG might be the better approach?

I'm agnostic on the NDEBUG issue, though have 'never disable assert' leanings. But just leanings, since performance is also important and I don't know the lay of the land here to have an informed opinion.

This revision is now accepted and ready to land.Wed, Jan 14, 3:34 PM
In D54712#1249886, @imp wrote:

I'm agnostic on the NDEBUG issue, though have 'never disable assert' leanings. But just leanings, since performance is also important and I don't know the lay of the land here to have an informed opinion.

We don't enable NDEBUG by default when building FreeBSD currently (MK_ASSERT_DEBUG defaults to yes), so you already have to opt into that for world.

No, this is not going to work. This brings stdio + locale into rtld.

In D54712#1249912, @kib wrote:

No, this is not going to work. This brings stdio + locale into rtld.

Even with the custom __assert() implementation in rtld-libc/rtld_libc.c?

This revision was automatically updated to reflect the committed changes.