Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Apr 2026 09:24:42 +0200
From:      Roger Pau =?utf-8?B?TW9ubsOp?= <royger@freebsd.org>
To:        Mark Millard <marklmi@yahoo.com>, Cy Schubert <Cy.Schubert@cschubert.com>
Cc:        dev-commits-ports-all@freebsd.org, dev-commits-ports-main@freebsd.org
Subject:   Re: git: cb0504025c42 - main - bsd.port.mk: also export GNU strip when USE_BINUTILS is set
Message-ID:  <afGyOioOG8FSj7qo@macbook.local>
In-Reply-To: <d54ac903-c0e5-4aa2-a149-14b01270a092@yahoo.com>
References:  <69e0f16a.467d6.1e2f5b84@gitrepo.freebsd.org> <20260428211422.27C71484__33682.9687164695$1777410882$gmane$org@slippy.cwsent.com> <d54ac903-c0e5-4aa2-a149-14b01270a092@yahoo.com>

index | next in thread | previous in thread | raw e-mail

On Tue, Apr 28, 2026 at 02:58:21PM -0700, Mark Millard wrote:
> On 4/28/26 14:14, Cy Schubert wrote:
> > In message <69e0f16a.467d6.1e2f5b84@gitrepo.freebsd.org>, Roger Pau 
> > =?utf-8?Q?M
> > onn=C3=A9?= writes:
> >> The branch main has been updated by royger:
> >>
> >> URL: https://cgit.FreeBSD.org/ports/commit/?id=cb0504025c42fac4b2d1f973651ed3
> >> 1cfea52f5f
> >>
> >> commit cb0504025c42fac4b2d1f973651ed31cfea52f5f
> >> Author:     Roger Pau Monné <royger@FreeBSD.org>
> >> AuthorDate: 2026-02-25 14:10:20 +0000
> >> Commit:     Roger Pau Monné <royger@FreeBSD.org>
> >> CommitDate: 2026-04-16 14:06:18 +0000
> >>
> >>     bsd.port.mk: also export GNU strip when USE_BINUTILS is set
> >>     
> >>     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 environmen
> >> t
> >>     variables.
> >>     
> >>     Reviewed by: dim arrowd
> >>     Approved by: mat (portmgr)
> >>     Sponsored by: Citrix Systems R&D
> >>     Differential revision: https://reviews.freebsd.org/D55509
> >> ---
> >>  Mk/bsd.port.mk | 8 ++++----
> >>  1 file changed, 4 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
> >> index 249b7ce7e40e..4c10b7fff842 100644
> >> --- a/Mk/bsd.port.mk
> >> +++ b/Mk/bsd.port.mk
> >> @@ -1856,15 +1856,15 @@ USE_BINUTILS=	yes
> >>  .    if defined(USE_BINUTILS) && !defined(DISABLE_BINUTILS)
> >>  BUILD_DEPENDS+=	${LOCALBASE}/bin/as:devel/binutils
> >>  BINUTILS?=	ADDR2LINE AR AS CPPFILT GPROF LD NM OBJCOPY OBJDUMP RANLIB \
> >> -	READELF SIZE STRINGS
> >> +	READELF SIZE STRINGS STRIP_CMD
> >>  BINUTILS_NO_MAKE_ENV?=
> >>  .      for b in ${BINUTILS}
> >> -${b}=	${LOCALBASE}/bin/${b:C/PP/++/:tl}
> >> +${b}=	${LOCALBASE}/bin/${b:C/PP/++/:C/_CMD//:tl}
> >>  .        if defined(GNU_CONFIGURE) || defined(BINUTILS_CONFIGURE)
> >> -CONFIGURE_ENV+=	${b}="${${b}}"
> >> +CONFIGURE_ENV+=	${b:C/_CMD//}="${${b}}"
> >>  .        endif
> >>  .        if ${BINUTILS_NO_MAKE_ENV:M${b}} == ""
> >> -MAKE_ENV+=	${b}="${${b}}"
> >> +MAKE_ENV+=	${b:C/_CMD//}="${${b}}"
> >>  .        endif
> >>  .      endfor
> >>  .    endif
> >>
> > 
> > I'm seeing ports, i.e. net-mgmt/ipv6mon fail as below with this patch.
> > 
> > make: /usr/share/mk/bsd.sys.mk:398: warning: LD (/usr/local/bin/ld) is not 
> > the default linker for gcc14 but -fuse-ld= is not supported
> > install  /usr/local/bin/strip -o 65534 -g 65534 -m 555   ipv6mon 
> > /wrkdirs/usr/ports/net-mgmt/ipv6mon/work/stage/usr/local/sbin/ipv6mon
> > install: target directory `/wrkdirs/usr/ports/net-mgmt/ipv6mon/work/stage/us
> > r/local/sbin/ipv6mon' does not exist
> > usage: install [-bCcpSsUv] [-f flags] [-g group] [-m mode] [-o owner]
> >                [-M log] [-D dest] [-h hash] [-T tags]
> >                [-B suffix] [-l linkflags] [-N dbdir]
> >                file1 file2
> >        install [-bCcpSsUv] [-f flags] [-g group] [-m mode] [-o owner]
> >                [-M log] [-D dest] [-h hash] [-T tags]
> >                [-B suffix] [-l linkflags] [-N dbdir]
> >                file1 ... fileN directory
> >        install -dU [-vU] [-g group] [-m mode] [-N dbdir] [-o owner]
> >                [-M log] [-D dest] [-h hash] [-T tags]
> >                directory ...
> > *** Error code 64
> > 
> > Stop.
> > make: stopped making "install" in /wrkdirs/usr/ports/net-mgmt/ipv6mon/work/i
> > pv6mon-454292a393ddd79db7131b6e7a8d005a7f49bd92
> > *** Error code 1
> > 
> > Stop.
> > make: stopped making "stage" in /usr/ports/net-mgmt/ipv6mon
> > =>> Cleaning up wrkdir
> > ===>  Cleaning for ipv6mon-1.0_6
> > build of net-mgmt/ipv6mon | ipv6mon-1.0_6 ended at 2026-04-28T13:50:03-07:00
> > 
> > 
> 
> FYI: Official build logs showing the failures go back to:
> 
> <https://pkg-status.freebsd.org/beefy23/data/150amd64-default/80a2e51ef78a/logs/ipv6mon-1.0_6.log>;
> (2026-04-19 15:50 UTC)

Hello,

Sorry for the breakage.  AFAICT ipv6mon uses a custom Makefile, that
includes bsd.port.mk.  bsd.port.mk uses the STRIP variable to signal
whether install should strip binaries.  Since the port  has
STRIP="/path/to/GNU/strip" in it's make env variables that's now
picked up by the port install target and ends up creating the bogus
install command shown above.

I think the best way forward is to remove setting STRIP in the
environment for configure and make environments, see patch below.
This means that ports that want to explicitly use GNU strip just
setting USE_BINUTILS won't be enough, and they would need to set
STRIP="$STRIP_CMD" manually.

Regards, Roger.
---
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index 4c10b7fff842..47ca138852a1 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -1861,10 +1861,10 @@ BINUTILS_NO_MAKE_ENV?=
 .      for b in ${BINUTILS}
 ${b}=	${LOCALBASE}/bin/${b:C/PP/++/:C/_CMD//:tl}
 .        if defined(GNU_CONFIGURE) || defined(BINUTILS_CONFIGURE)
-CONFIGURE_ENV+=	${b:C/_CMD//}="${${b}}"
+CONFIGURE_ENV+=	${b}="${${b}}"
 .        endif
 .        if ${BINUTILS_NO_MAKE_ENV:M${b}} == ""
-MAKE_ENV+=	${b:C/_CMD//}="${${b}}"
+MAKE_ENV+=	${b}="${${b}}"
 .        endif
 .      endfor
 .    endif



home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?afGyOioOG8FSj7qo>