Page MenuHomeFreeBSD

sys: protect the kernel build from accidental _FORTIFY_SOURCE
ClosedPublic

Authored by kevans on Apr 11 2025, 3:33 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Sep 16, 8:37 PM
Unknown Object (File)
Wed, Sep 16, 3:49 PM
Unknown Object (File)
Wed, Sep 16, 8:50 AM
Unknown Object (File)
Fri, Sep 11, 11:19 PM
Unknown Object (File)
Aug 29 2026, 5:33 PM
Unknown Object (File)
Aug 28 2026, 1:50 PM
Unknown Object (File)
Aug 12 2026, 8:10 PM
Unknown Object (File)
Aug 10 2026, 9:23 AM

Details

Summary

Fortification is a userland feature, thus the flag makes no sense in a
kernel context at the moment. Move the relevant includes that aren't
already in a !_KERNEL block under a !_KERNEL condition to avoid breaking
kernel/kmod builds that are catching a stray -D_FORTIFY_SOURCE in their
CFLAGS.

PR: 286010

Diff Detail

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

Event Timeline

markj added inline comments.
sys/sys/poll.h
112

We're already in a ifndef _KERNEL block here.

This revision is now accepted and ready to land.Apr 11 2025, 1:33 PM
sys/sys/poll.h
112

Whoops, missed that; will remove, thanks.

imp added inline comments.
sys/sys/poll.h
112

my approval is conditional on dropping this one change.