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)
Tue, Jun 9, 5:52 AM
Unknown Object (File)
Thu, Jun 4, 9:31 PM
F158031792: grep-executable-stack.3771.log
Wed, May 27, 5:19 PM
Unknown Object (File)
Wed, May 27, 12:38 PM
Unknown Object (File)
Tue, May 26, 9:33 AM
Unknown Object (File)
Mon, May 25, 3:05 AM
Unknown Object (File)
May 22 2026, 11:39 PM
Unknown Object (File)
May 20 2026, 10:35 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.