Page MenuHomeFreeBSD

kern.mk: quiet bfd executable stack warnings
AbandonedPublic

Authored by rlibby on May 8 2026, 10:50 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 4, 5:51 PM
Unknown Object (File)
Sun, Oct 4, 3:40 PM
Unknown Object (File)
Thu, Oct 1, 10:29 AM
Unknown Object (File)
Thu, Sep 24, 6:13 AM
Unknown Object (File)
Tue, Sep 22, 11:30 PM
Unknown Object (File)
Thu, Sep 10, 8:47 PM
Unknown Object (File)
Thu, Sep 10, 7:25 AM
Unknown Object (File)
Sep 7 2026, 7:44 PM
Subscribers

Details

Reviewers
imp
kib
dchagin
Summary

Also add -Wtrampolines for GCC. Clang already disallows nested
functions, -Wtrampolines just provides an equivalent warning/error for
GCC and documents that we aren't just papering over warnings for code
that really does use executable stacks.

Test Plan

env CROSS_TOOLCHAIN=amd64-gcc14 make buildkernel

Diff Detail

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

Event Timeline

rlibby added reviewers: imp, kib, dchagin.

So what are the sources that cause the warning? It would be better to fix them instead, but I do not object against this somewhat large hammer.

$ curl https://ci.freebsd.org/job/FreeBSD-main-amd64-gcc14_build/3606/consoleText -o /tmp/FreeBSD-main-amd64-gcc14_build.3606.consoleText
$ grep "executable stack" /tmp/FreeBSD-main-amd64-gcc14_build.3606.consoleText > /tmp/grep-executable-stack.log
$ wc -l /tmp/grep-executable-stack.log 
72 /tmp/grep-executable-stack.log

It appears many but not all may be pre-assembled objects or hand-written assembly.

We could try to pick at these individually instead. This is obviously not urgent, I was just trying to clean up some warnings.

Abandoning this for now, though I still think it would be fine to take. I addressed some of the underlying issues with D56894 and D56946.

The warnings that are left here are mostly coming from contrib binary blobs, but also some contrib assembly:

The warning is no longer currently issued for the kernel itself, but for various module builds.