Page MenuHomeFreeBSD

Use .pieo extension for WITH_PIE bsd.prog.mk output
AbandonedPublic

Authored by dim on Apr 22 2025, 5:33 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sep 5 2025, 2:46 PM
Unknown Object (File)
Aug 10 2025, 10:01 AM
Unknown Object (File)
Aug 5 2025, 4:29 AM
Unknown Object (File)
Aug 2 2025, 4:14 PM
Unknown Object (File)
Aug 2 2025, 5:26 AM
Unknown Object (File)
Jul 21 2025, 6:24 PM
Unknown Object (File)
Jul 20 2025, 11:44 AM
Unknown Object (File)
Jul 4 2025, 11:42 PM

Details

Summary

When object files for programs are built using bsd.prog.mk, and WITH_PIE
is enabled, the extension used is still plain ".o". To be consistent
with bsd.lib.mk, and to allow changes in WITH_PIE settings to propagate
correctly, the extension should be ".pieo" instead.

To avoid duplicating the .SUFFIXES list and suffix-transformation rules
from bsd.lib.mk, move these to bsd.suffixes-extra.mk so they can be
included from both bsd.lib.mk and bsd.prog.mk. (Note that we cannot add
them to bsd.suffixes.mk, since that file also gets included by sys.mk,
which applies to non-source builds. That would require a whole ports
exp-run.)

MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 63643
Build 60527: arc lint + arc unit

Event Timeline

dim requested review of this revision.Apr 22 2025, 5:33 PM

Note this requires D49951 to be committed first, since otherwise tests/sys/fs/fusefs falls over due to it picking sbin/mount.c over tests/sys/fs/fusefs/mount..cc for targeting mount.pieo. This has to do with some internal ordering in make that I haven't been able to fully figure out.

Are you up for splitting bsd.suffixes-extra.mk out first, without any functional changes?

Are you up for splitting bsd.suffixes-extra.mk out first, without any functional changes?

Sure, that should be a very safe NFC operation. :)

Split off the bsd.suffixes-extra.mk part to D49965.

Abandoning, arc diff totally messed this up.