On Tue, Feb 22, 2022 at 12:02:08AM +0000, Klemens Nanni wrote:
> On Mon, Feb 21, 2022 at 11:27:37PM +0000, Stuart Henderson wrote:
> > On 2022/02/21 22:12, Klemens Nanni wrote:
> > > On Sat, Feb 19, 2022 at 02:40:24AM -0700, Kurt Mosiejczuk wrote:
> > > > http://build-failures.rhaalovely.net/sparc64/2022-02-16/net/pmacct,postgresql.log
> > >
> > > > checking for cdada_get_ver in -lcdada... no
> > > > configure: error: Could not find libcdada
> > >
> > > The dependency is correctly handled, but AC_CHECK_LIB chokes on how
> > > ports-clang arches handle c++ libs.
> > >
> > > COMPILER_LIBCXX has "stdc++" and "estdc++>=17" for base-clang and
> > > ports-gcc, respectively.
> > >
> > > This ends up in configure.ac's libcdada AC_CHECK_LIB check as can be
> > > seen in the hackish diff below.
> > >
> > > ${WRKBUILD}/config.log shows the actual error:
> > >
> > > > configure:20504: checking for cdada_get_ver in -lcdada
> > > > configure:20529: cc -o conftest -O2 -pipe -I/usr/local/include
> > > > -L/usr/local/lib conftest.c -lcdada -lcdada -lestdc++>=17 -lpthread
> > > > -lpcap -lm -lpthread >&5
> > > > /usr/bin/ld: cannot find -lestdc++>=17
> > > > collect2: error: ld returned 1 exit status
> > >
> > > Removing the version spec makes configure work thus fixes the build,
> > > but this hackish attempt doesn't look like a solution.
> > >
> > > Leaving this here for others to chime in.
> >
> > it _ought_ to use $(CXX) to try and link rather than $(CC), but I don't
> > know if that's viable with this autoconf check.
>
> Good point, I missed that.
>
> >
> > > .for i in ${COMPILER_LIBCXX}
> > > -CXXLIB+= -l$i
> > > +CXXLIB+= -l${i:C/[<>=]+[0-9.]+$//}
> > > .endfor
> >
> > I am okay with this with a comment to explain the regex, e.g.
> >
> > # strip off the library-specs(5) version number check
> >
> > the libcdada port itself should have the same change
> >
>
> Like that? Thanks, I'll go with in a few days unless we come up with
> something better.
Better this, also with correct manual section.
Index: devel/libcdada/Makefile
===================================================================
RCS file: /home/cvs/ports/devel/libcdada/Makefile,v
retrieving revision 1.4
diff -u -p -r1.4 Makefile
--- devel/libcdada/Makefile 2 Nov 2021 00:00:24 -0000 1.4
+++ devel/libcdada/Makefile 22 Feb 2022 00:08:05 -0000
@@ -5,7 +5,7 @@ COMMENT= basic data structures in C (lib
GH_ACCOUNT= msune
GH_PROJECT= libcdada
GH_TAGNAME= v0.3.4
-REVISION= 1
+REVISION= 2
SHARED_LIBS += cdada 0.0 # 0.0
@@ -34,6 +34,9 @@ post-patch:
sed -i 's,-lstdc++,${CXXLIB},' ${WRKSRC}/examples/Makefile.am
.include <bsd.port.mk>
-.for i in ${COMPILER_LIBCXX}
+
+# strip library-specs(7) which ld.bfd(1) does not understand
+# to fix configure on non-clang architectures
+.for i in ${COMPILER_LIBCXX:C/[<>=]+[0-9.]+$//}
CXXLIB+= -l$i
.endfor
Index: net/pmacct/Makefile
===================================================================
RCS file: /home/cvs/ports/net/pmacct/Makefile,v
retrieving revision 1.34
diff -u -p -r1.34 Makefile
--- net/pmacct/Makefile 18 Feb 2021 13:24:04 -0000 1.34
+++ net/pmacct/Makefile 22 Feb 2022 00:08:06 -0000
@@ -3,6 +3,7 @@
COMMENT= passive IP network monitoring tools: traffic accounting, etc
DISTNAME= pmacct-1.7.6
+REVISION= 0
CATEGORIES= net
HOMEPAGE= http://www.pmacct.net/
@@ -75,6 +76,9 @@ post-install:
.endif
.include <bsd.port.mk>
-.for i in ${COMPILER_LIBCXX}
+
+# strip library-specs(7) which ld.bfd(1) does not understand
+# to fix configure on non-clang architectures
+.for i in ${COMPILER_LIBCXX:C/[<>=]+[0-9.]+$//}
CXXLIB+= -l$i
.endfor