Page MenuHomeFreeBSD

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

Authored by dim on Apr 22 2025, 6:40 PM.
Tags
None
Referenced Files
F149981728: D49966.id154290.diff
Sat, Mar 28, 1:37 PM
F149970837: D49966.diff
Sat, Mar 28, 11:55 AM
Unknown Object (File)
Tue, Mar 10, 3:49 PM
Unknown Object (File)
Tue, Mar 10, 12:33 PM
Unknown Object (File)
Tue, Mar 10, 9:57 AM
Unknown Object (File)
Tue, Mar 10, 5:40 AM
Unknown Object (File)
Tue, Mar 10, 5:01 AM
Unknown Object (File)
Wed, Mar 4, 6:54 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.

Requires D49965 to be committed first.

MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dim requested review of this revision.Apr 22 2025, 6:40 PM
share/mk/bsd.prog.mk
55–57

As an aside, I wonder if Makefiles, tools, etc., would work if we made this OBJ_EXT=pie.o

share/mk/bsd.prog.mk
55–57

As an aside, I wonder if Makefiles, tools, etc., would work if we made this OBJ_EXT=pie.o

With other make implementations there is typically a $(suffix ...) function that splits on the rightmost dot, so that wouldn't work for that case.

In bmake I think it will depend on whether it understands the following notation for a suffix-transformation rule:

.c.pie.o:
      <recipe>
This revision was not accepted when it landed; it landed in state Needs Review.Apr 25 2025, 5:53 PM
This revision was automatically updated to reflect the committed changes.