[Sorry for the long post, more an aide memoire for me in case there's a "next time" -- agc]
I ran the testit.sh script in netpgpverfiy/files a number of times to make sure that what I'd done was good, and that worked fine - I've just run it again, and it worked fine.
Bootstrapping, though - this is where it gets complicated - the relevant compilation command line from the bootstrap output (on NetBSD) is:
cc -O2 -D_FORTIFY_SOURCE=2 -I/usr/include -D_LARGEFILE_SOURCE -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 -DDEF_UMASK=0022 -I/d/repo/pkgsrc/bootstrap/work/wrk/pkgtools/pkg_install/work/libfetch -I/d/repo/pkgsrc/bootstrap/work/wrk/pkgtools/pkg_install/work -DHAVE_NBCOMPAT_H=1 -I/d/repo/pkgsrc/bootstrap/work/wrk/pkgtools/pkg_install/work/libnbcompat -I/usr/include -c libverify.c
libverify.c: In function 'read_compressed':
libverify.c:1319:9: warning: implicit declaration of function 'netpgpv_BZ2_bzDecompressInit'; did you mean 'BZ2_bzDecompressInit'? [-Wimplicit-function-declaration]
ok = (netpgpv_BZ2_bzDecompressInit(&bz, 1, 0) == BZ_OK);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
BZ2_bzDecompressInit
libverify.c:1333:9: warning: implicit declaration of function 'netpgpv_BZ2_bzDecompress'; did you mean 'BZ2_bzDecompress'? [-Wimplicit-function-declaration]
ok = (netpgpv_BZ2_bzDecompress(&bz) == BZ_STREAM_END);
^~~~~~~~~~~~~~~~~~~~~~~~~
BZ2_bzDecompress
so it looks like bootstrap scripts are eventually picking up the bzlib.h in /usr/include.
I fixed that locally by renaming files, and am getting a related error, this time during linking.
Turns out libnetpgpverify.a in bootstrap is missing some files in its archive. No bzlib.o or zlib.o
This is caused by the Makefile in work/wrk/pkg_install/work/netpgp/ being incomplete
# $NetBSD:
Makefile.lib.in,v 1.2 2016/06/30 21:10:59 agc Exp $
LIB= libnetpgpverify.a
OBJS= b64.o bignum.o bufgap.o digest.o
OBJS+= libverify.o misc.o
OBJS+= pgpsum.o rsa.o
OBJS+= sha1.o sha2.o md5c.o rmd160.o
PREFIX=/usr/local
MANDIR=/usr/local/man
all: ${LIB}
${LIB}: ${OBJS}
ar crv ${LIB} ${OBJS}
install:
${BSD_INSTALL_LIB} ${LIB} ${DESTDIR}${PREFIX}/lib
${BSD_INSTALL_DATA} verify.h ${DESTDIR}${PREFIX}/include/netpgp
${BSD_INSTALL_DATA} libnetpgpverify.3 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man3
clean:
rm -rf *.core ${OBJS} ${LIB}
cleandist:
rm -rf *.core ${OBJS} ${LIB} Makefile
(i.e. it's missing the line adding bzlib.o and zlib.o to OBJS)
Turns out that happens when bootstrapping pkg_install:
cd /d/repo/pkgsrc/pkgtools/pkg_install/work/netpgp && /usr/bin/sed -e '/zlib/d'
Makefile.lib.in >Makefile.in && /bin/rm -f bzlib.h zlib.h && /bin/sh ./configure && /usr/bin/env USETOOLS=no PKGSRC_MACHINE_ARCH=x86_64 OPSYS=NetBSD CATMAN_SECTION_SUFFIX=no MANINSTALL=maninstall\ htmlinstall FETCH_WITH_INET6=yes FETCH_WITH_OPENSSL=yes CXXCPP=cpp CC=gcc CFLAGS=-O2\ -D_FORTIFY_SOURCE=2\ -I/usr/include CPPFLAGS=-D_LARGEFILE_SOURCE\ -D_LARGE_FILES\ -D_FILE_OFFSET_BITS=64\ -DDEF_UMASK=0022\ -I/d/repo/pkgsrc/pkgtools/pkg_install/work/libfetch\ -I/d/repo/pkgsrc/pkgtools/pkg_install/work\ -DHAVE_NBCOMPAT_H=1\ -I/d/repo/pkgsrc/pkgtools/pkg_install/work/libnbcompat\ -I/usr/include CXX=c++ CXXFLAGS=-O2\ -D_FORTIFY_SOURCE=2\ -I/usr/include COMPILER_RPATH_FLAG=-Wl,-R F77=gfortran FC=gfortran FFLAGS=-O LANG=C LC_ALL=C LC_COLLATE=C LC_CTYPE=C LC_MESSAGES=C LC_MONETARY=C LC_NUMERIC=C LC_TIME=C LDFLAGS=-lssl\ -lcrypto\ -L/d/repo/pkgsrc/pkgtools/pkg_install/work/libfetch\ -L/d/repo/pkgsrc/pkgtools/pkg_install/work/netpgp\ -L/d/repo/pkgsrc/pkgtools/pkg_install/work/libnbcompat\ -L/usr/lib\ -Wl,-R/usr/lib\ -Wl,-R/usr/pkg/lib LINKER_RPATH_FLAG=-R PATH=/d/repo/pkgsrc/pkgtools/pkg_install/work/.cwrapper/bin:/d/repo/pkgsrc/pkgtools/pkg_install/work/.buildlink/bin:/d/repo/pkgsrc/pkgtools/pkg_install/work/.tools/bin:/d/repo/pkgsrc/pkgtools/pkg_install/work/.gcc/bin:/usr/pkg/bin:/home/agc/scripts:/home/agc/bin:/usr/pkg/bin:/usr/pkg/sbin:/usr/pkg/java/openjdk7/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/games:/usr/local/bin:/usr/local/sbin:/usr/X11R7/bin:/usr/pkg/bin:/usr/X11R7/bin PREFIX=/usr/pkg MAKELEVEL=0 CONFIG_SITE= PKG_SYSCONFDIR=/usr/pkg/etc HOME=/d/repo/pkgsrc/pkgtools/pkg_install/work/.home CWRAPPERS_CONFIG_DIR=/d/repo/pkgsrc/pkgtools/pkg_install/work/.cwrapper/config CPP=cpp LOCALBASE=/usr/pkg X11BASE=/usr/X11R7 PKGMANDIR=man PKGINFODIR=info PKGGNUDIR=gnu/ MAKECONF=/dev/null OBJECT_FMT=ELF USETOOLS=no BSD_INSTALL_PROGRAM=/usr/bin/install\ -c\ -s\ -o\ agc\ -g\ agc\ -m\ 755 BSD_INSTALL_SCRIPT=/usr/bin/install\ -c\ -o\ agc\ -g\ agc\ -m\ 755 BSD_INSTALL_LIB=/usr/bin/install\ -c\ -o\ agc\ -g\ agc\ -m\ 755 BSD_INSTALL_DATA=/usr/bin/install\ -c\ -o\ agc\ -g\ agc\ -m\ 644 BSD_INSTALL_MAN=/usr/bin/install\ -c\ -o\ agc\ -g\ agc\ -m\ 644 BSD_INSTALL=/usr/bin/install BSD_INSTALL_PROGRAM_DIR=/usr/bin/install\ -d\ -o\ agc\ -g\ agc\ -m\ 755 BSD_INSTALL_SCRIPT_DIR=/usr/bin/install\ -d\ -o\ agc\ -g\ agc\ -m\ 755 BSD_INSTALL_LIB_DIR=/usr/bin/install\ -d\ -o\ agc\ -g\ agc\ -m\ 755 BSD_INSTALL_DATA_DIR=/usr/bin/install\ -d\ -o\ agc\ -g\ agc\ -m\ 755 BSD_INSTALL_MAN_DIR=/usr/bin/install\ -d\ -o\ agc\ -g\ agc\ -m\ 755 BSD_INSTALL_GAME=/usr/bin/install\ -c\ -s\ -o\ agc\ -g\ agc\ -m\ 2555 BSD_INSTALL_GAME_DATA=/usr/bin/install\ -c\ -o\ agc\ -g\ agc\ -m\ 664 BSD_INSTALL_GAME_DIR=/usr/bin/install\ -d\ -o\ agc\ -g\ agc\ -m\ 775 INSTALL_INFO= MAKEINFO=/d/repo/pkgsrc/pkgtools/pkg_install/work/.tools/bin/makeinfo FLEX= BISON= PKG_CONFIG= PKG_CONFIG_LIBDIR=/d/repo/pkgsrc/pkgtools/pkg_install/work/.buildlink/lib/pkgconfig:/d/repo/pkgsrc/pkgtools/pkg_install/work/.buildlink/share/pkgconfig PKG_CONFIG_LOG=/d/repo/pkgsrc/pkgtools/pkg_install/work/.pkg-config.log PKG_CONFIG_PATH= CWRAPPERS_CONFIG_DIR=/d/repo/pkgsrc/pkgtools/pkg_install/work/.cwrapper/config BINOWN=agc BINGRP=agc GAMEOWN=agc GAMEGRP=agc MANOWN=agc MANGRP=agc SHAREOWN=agc SHAREGRP=agc DOCOWN=agc DOCGRP=agc BINMODE=755 NONBINMODE=644 BINDIR=/usr/pkg/bin INCSDIR=/usr/pkg/include LIBDIR=/usr/pkg/lib MANDIR=/usr/pkg/man STRIPFLAG=-s MANINSTALL=maninstall\ htmlinstall MKCATPAGES=no MKHTML=no /usr/bin/make -f Makefile all
I traced this back to pkg_install's Makefile, and was able to reproduce the problem, deleted the offending lines (with netpgp using its own prefix-symbol-protected functions)
--- Makefile 26 Jan 2020 17:32:00 -0000 1.227
+++ Makefile 4 May 2020 18:45:09 -0000
@@ -211,9 +211,7 @@
${SETENV} ${MAKE_ENV} ${BSD_MAKE_ENV} \
${MAKE_PROGRAM} ${MAKE_FLAGS} ${BUILD_MAKE_FLAGS} \
-f ${MAKE_FILE} depend all
- cd ${WRKDIR}/netpgp && \
- ${SED} -e '/zlib/d'
Makefile.lib.in >Makefile.in && \
- ${RM} -f bzlib.h zlib.h && \
+ cd ${WRKDIR}/netpgp && \
${CONFIG_SHELL} ${CONFIG_SHELL_FLAGS} ./configure && \
${SETENV} ${MAKE_ENV} ${BSD_MAKE_ENV} ${MAKE_PROGRAM} \
${MAKE_FLAGS} ${BUILD_MAKE_FLAGS} -f ${MAKE_FILE} all
which DTRT: