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)
Thu, Mar 5, 7:08 PM
Unknown Object (File)
Mon, Mar 2, 6:57 PM
Unknown Object (File)
Thu, Feb 26, 10:50 AM
Unknown Object (File)
Tue, Feb 24, 11:39 AM
Unknown Object (File)
Mon, Feb 23, 1:11 AM
Unknown Object (File)
Jan 31 2026, 11:38 AM
Unknown Object (File)
Jan 16 2026, 2:44 PM
Unknown Object (File)
Jan 15 2026, 4:49 PM

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.