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
F142147261: D49966.id154290.diff
Fri, Jan 16, 12:04 PM
F142120307: D49966.id154115.diff
Fri, Jan 16, 5:13 AM
Unknown Object (File)
Mon, Jan 5, 5:14 PM
Unknown Object (File)
Dec 6 2025, 8:47 PM
Unknown Object (File)
Nov 30 2025, 7:25 AM
Unknown Object (File)
Nov 23 2025, 3:48 PM
Unknown Object (File)
Nov 19 2025, 2:42 AM
Unknown Object (File)
Nov 15 2025, 10:33 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.