Page MenuHomeFreeBSD

kern.mk: quiet bfd executable stack warnings
AbandonedPublic

Authored by rlibby on May 8 2026, 10:50 PM.
Tags
None
Referenced Files
F171307121: D56893.id.diff
Thu, Sep 10, 7:25 AM
Unknown Object (File)
Mon, Sep 7, 7:44 PM
Unknown Object (File)
Sat, Sep 5, 7:50 PM
Unknown Object (File)
Sat, Sep 5, 4:09 PM
Unknown Object (File)
Sat, Sep 5, 10:58 AM
Unknown Object (File)
Fri, Sep 4, 10:41 PM
Unknown Object (File)
Fri, Sep 4, 10:35 PM
Unknown Object (File)
Thu, Sep 3, 11:58 AM
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.