Index | Thread | Search

From:
Stuart Henderson <stu@spacehopper.org>
Subject:
Re: devel/boost: boost/iostreams zstd linker error
To:
Thomas Dreibholz <dreibh@simula.no>
Cc:
ports@openbsd.org, Brad Smith <brad@comstyle.com>
Date:
Mon, 15 Jun 2026 13:41:07 +0100

Download raw body.

Thread
On 2026/06/15 12:42, Thomas Dreibholz wrote:
> I am trying to build HiPerConTracer (https://www.nntb.no/~dreibh/hipercontracer/) under
> OpenBSD. This fails with linker error for BOOST iostreams and zstd filter. I tracked down the
> issue to the following simple test program:

The OpenBSD port of boost doesn't build the optional zstd support.
This diff would enable it, if we want to do that...

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/boost/Makefile,v
diff -u -p -r1.163 Makefile
--- Makefile	18 May 2026 05:48:17 -0000	1.163
+++ Makefile	15 Jun 2026 12:35:37 -0000
@@ -6,6 +6,7 @@ COMMENT-main=	free peer-reviewed portabl
 COMMENT-md=	machine-dependent libraries for boost
 
 VERSION=	1.91.0
+REVISION-main=	0
 DISTNAME=	boost_${VERSION:S/./_/g}
 PKGNAME=	boost-${VERSION}
 EPOCH=		0
@@ -69,8 +70,9 @@ MAINTAINER=	Brad Smith <brad@comstyle.co
 # Boost
 PERMIT_PACKAGE=	Yes
 
-WANTLIB=	${COMPILER_LIBCXX} bz2 c iconv icudata icui18n icuuc kvm m z
-WANTLIB-md+=	${COMPILER_LIBCXX} boost_filesystem-mt boost_regex-mt 
+WANTLIB=	${COMPILER_LIBCXX} bz2 c iconv icudata icui18n icuuc \
+		kvm m z zstd
+WANTLIB-md+=	${COMPILER_LIBCXX} boost_filesystem-mt boost_regex-mt
 WANTLIB-md+=	icudata icui18n icuuc m
 
 COMPILER=	base-clang ports-gcc
@@ -83,6 +85,7 @@ MODPY_RUNDEP=	No
 BUILD_DEPENDS=	math/py-numpy
 
 LIB_DEPENDS=	archivers/bzip2 \
+		archivers/zstd \
 		converters/libiconv \
 		textproc/icu4c
 
@@ -104,6 +107,8 @@ TOOLSET=	gcc
 BJAM_CONFIG=	-sICU_PATH=${LOCALBASE} \
 		-sBZIP2_INCLUDE=${LOCALBASE}/include \
 		-sBZIP2_LIBPATH=${LOCALBASE}/lib \
+		-sZSTD_INCLUDE=${LOCALBASE}/include \
+		-sZSTD_LIBPATH=${LOCALBASE}/lib \
 		-q \
 		-d+2 \
 		-j${MAKE_JOBS} \

> clang t1.cc -o t1 -I /usr/local/include/ -I /usr/pkg/include/ -L /usr/local/lib -L /usr/pkg/lib
> -lboost_iostreams -lstdc++

You certainly shouldn't be using -lstdc++ with clang on OpenBSD.
(And I'd be pretty surprised if you should be doing that on FreeBSD).