Page MenuHomeFreeBSD

bsd.port.mk: also export GNU strip when USE_BINUTILS is set
ClosedPublic

Authored by royger on Feb 25 2026, 2:19 PM.
Tags
None
Referenced Files
F161969970: D55509.id175635.diff
Wed, Jul 8, 11:56 AM
Unknown Object (File)
Wed, Jul 8, 3:53 AM
Unknown Object (File)
Tue, Jul 7, 11:25 AM
Unknown Object (File)
Sun, Jul 5, 7:30 AM
Unknown Object (File)
Fri, Jul 3, 9:33 AM
Unknown Object (File)
Fri, Jun 26, 7:33 PM
Unknown Object (File)
Fri, Jun 26, 4:00 PM
Unknown Object (File)
Wed, Jun 24, 8:31 PM
Subscribers

Details

Summary

GNU Binutils packages strip, and should be used in preference to the base
LLVM strip when USE_BINUTILS = yes.

Do not take over the STRIP makefile variable, which is already used in bsd.port.mk to signal whether the install program should strip the binaries. Instead define STRIP_CMD and use STRIP just for the environment variables.

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

royger created this revision.

Sounds reasonable to me, but I'm not a ports committer. :)

This revision is now accepted and ready to land.Feb 25 2026, 3:25 PM

Picked the last couple of people that modified that file, and you happened to be there :). Thanks, will wait a bit for someone from ports to voice an opinion.

Makes sense to me too, but the last word is portmgr 's.

Can I please get an Ack/Nack from portmgr? This is required for SeaBIOS to be functional again when built on FreeBSD >= 15.

I don't think this should break too many things.

Does it need an exp-run? Because I have no idea how to do that.

Well, like everything committer related, it's in the committer's guide https://docs.freebsd.org/en/articles/committers-guide/#ports-exp-run, but I don't see what would break with this change.

There are not too many ports with USE_BINUTILS though, you could test build them :-)

In D55509#1273416, @mat wrote:

Well, like everything committer related, it's in the committer's guide https://docs.freebsd.org/en/articles/committers-guide/#ports-exp-run, but I don't see what would break with this change.

There are not too many ports with USE_BINUTILS though, you could test build them :-)

Right, however my FreeBSD development box died yesterday, and I won't get the replacement parts until Monday to bring it back up. I don't mind waiting, but I also would be very surprised for this to break anything. Ports using USE_BINUTILS must work fine with GNU strip I would think :).

royger edited the summary of this revision. (Show Details)

Do not take over the STRIP makefile variable, which is already used in bsd.port.mk to signal whether the install program should strip the binaries. Instead define STRIP_CMD and use STRIP just for the environment variables.

This revision now requires review to proceed.Mar 10 2026, 11:38 AM

I've tested with this fix and I'm able to build all the USE_BINUTILS ports, except for GCC which I haven't tried because my box runs out of memory when building it.

Ping? I would like to get this done sooner rather than later so the SeaBIOS port is functional again. Without this change the generated SeaBIOS firmware image is non-functional.

LGTM, if there is any ports fallout it is easy to revert.

This revision is now accepted and ready to land.Mar 16 2026, 10:22 AM

This broke all ports using binutils and a BSD style Makefile, as they use the STRIP environment variable to check whether they should strip or not.
I've only noticed now as all of these ports depend on gcc, which failed to build on armv7 for a long time.
Fixing the fallout right now. This should have not landed, as STRIP does not mean the strip binary and has never meant it.

I didn't get it at all. How is this change related to the STRIP env var?

I didn't get it at all. How is this change related to the STRIP env var?

The change makes it so that STRIP=${STRIP_CMD} is added to MAKE_ENV if USE_BINUTILS=yes is set.
So if a port uses a BSD-style Makefile, e.g. with <bsd.lib.mk>, things go wrong on staging.

In D55509#1323281, @fuz wrote:

I didn't get it at all. How is this change related to the STRIP env var?

The change makes it so that STRIP=${STRIP_CMD} is added to MAKE_ENV if USE_BINUTILS=yes is set.
So if a port uses a BSD-style Makefile, e.g. with <bsd.lib.mk>, things go wrong on staging.

OK, I didn't knew that STRIP was a thing outside of the ports makefile, and then the usage of STRIP by bsd.lib.mk looks bogus compared how the other binutils aliases are defined (ie: OBJCOPY and friends). I've created https://reviews.freebsd.org/D57764 to fix it.

In D55509#1323281, @fuz wrote:

I didn't get it at all. How is this change related to the STRIP env var?

The change makes it so that STRIP=${STRIP_CMD} is added to MAKE_ENV if USE_BINUTILS=yes is set.
So if a port uses a BSD-style Makefile, e.g. with <bsd.lib.mk>, things go wrong on staging.

OK, I didn't knew that STRIP was a thing outside of the ports makefile, and then the usage of STRIP by bsd.lib.mk looks bogus compared how the other binutils aliases are defined (ie: OBJCOPY and friends). I've created https://reviews.freebsd.org/D57764 to fix it.

The variable STRIP is probably older than the idea of having macros for all the basic utilities, so STRIP_CMD is used for the strip utility to preserve the historic semantics of the name STRIP. STRIP expands to -s if you want to strip, otherwise to nothing. This allows build scripts to just stick a ${STRIP} into wherever the strip flag would go in.

Thank you for submitting a fix.