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)
Tue, Oct 14, 4:54 PM
Unknown Object (File)
Wed, Sep 24, 3:16 AM
Unknown Object (File)
Mon, Sep 22, 6:22 AM
Unknown Object (File)
Sep 16 2025, 8:30 AM
Unknown Object (File)
Sep 14 2025, 9:01 PM
Unknown Object (File)
Sep 4 2025, 12:50 PM
Unknown Object (File)
Aug 26 2025, 8:24 PM
Unknown Object (File)
Aug 18 2025, 8:59 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.