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
Unknown Object (File)
Sat, Nov 15, 10:33 AM
Unknown Object (File)
Sat, Nov 15, 3:08 AM
Unknown Object (File)
Sat, Nov 15, 2:44 AM
Unknown Object (File)
Thu, Nov 13, 8:01 PM
Unknown Object (File)
Thu, Nov 13, 12:47 PM
Unknown Object (File)
Thu, Nov 13, 5:21 AM
Unknown Object (File)
Sat, Nov 8, 7:29 PM
Unknown Object (File)
Thu, Oct 30, 1:20 AM

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.