f190c36b5d45 buildworld failure: ld: error: undefined symbol: SSL_get_peer_certificate

From: Graham Perrin <grahamperrin_at_freebsd.org>
Date: Mon, 26 Jun 2023 04:31:51 UTC
On 25/06/2023 20:57, Graham Perrin wrote:
> From <https://reviews.freebsd.org/P590$177>:
>
> clang: error: linker command failed with exit code 1 (use -v to see 
> invocation)
> *** [dma.full] Error code 1
>
> make[5]: stopped in /usr/src/libexec/dma/dmagent
> .ERROR_TARGET='dma.full'
> .ERROR_META_FILE='/usr/obj/usr/src/amd64.amd64/libexec/dma/dmagent/dma.full.meta' 
>
> .MAKE.LEVEL='5'
> MAKEFILE=''
> .MAKE.MODE='meta missing-filemon=yes missing-meta=yes silent=yes verbose'
>
>
> <https://cgit.freebsd.org/src/log/?qt=range&q=f190c36b5d45>
>
Thanks to a hint from David H. Wolfskill:

# Meta data file 
/usr/obj/usr/src/amd64.amd64/libexec/dma/dmagent/dma.full.meta
CMD cc -target x86_64-unknown-freebsd14.0 
--sysroot=/usr/obj/usr/src/amd64.amd64/tmp 
-B/usr/obj/usr/src/amd64.amd64/tmp/usr/bin -O2 -pipe -O3 -pipe 
-march=native -mtune=native -fno-common -DOPENSSL_API_COMPAT=0x10100000L 
-I/usr/src/contrib/dma -DHAVE_REALLOCF -DHAVE_STRLCPY -DHAVE_GETPROGNAME 
-DCONF_PATH='"/etc/dma"' -DLIBEXEC_PATH='"/usr/libexec"' 
-DDMA_VERSION='"v0.13+"' -DDMA_ROOT_USER='"mailnull"' 
-DDMA_GROUP='"mail"' -fPIE -g -gz=zlib -std=gnu99 
-Wno-format-zero-length -fstack-protector-strong -Wsystem-headers 
-Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter 
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type 
-Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter 
-Wcast-align -Wchar-subscripts -Wnested-externs -Wold-style-definition 
-Wno-pointer-sign -Wdate-time -Wformat=2 -Wno-format-extra-args -Werror 
-Wmissing-variable-declarations -Wthread-safety -Wno-empty-body 
-Wno-string-plus-int -Wno-unused-const-variable 
-Wno-error=unused-but-set-variable -Wno-error=unused-but-set-parameter 
-Qunused-arguments -Wl,-zrelro -pie   -o dma.full aliases_parse.o 
aliases_scan.o base64.o conf.o crypto.o dma.o dns.o local.o mail.o net.o 
spool.o util.o   -lssl  -lcrypto
CWD /usr/obj/usr/src/amd64.amd64/libexec/dma/dmagent
TARGET dma.full
OODATE aliases_parse.o aliases_scan.o base64.o conf.o crypto.o dma.o 
dns.o local.o mail.o net.o spool.o util.o
-- command output --
ld: error: undefined symbol: SSL_get_peer_certificate
 >>> referenced by crypto.c:198 (/usr/src/contrib/dma/crypto.c:198)
 >>>               crypto.o:(smtp_init_crypto)
 >>> did you mean: SSL_get0_peer_certificate
 >>> defined in: /usr/obj/usr/src/amd64.amd64/tmp/usr/lib/libssl.so
__cxa_thread_call_dtors: dtr 0xc439c0 from unloaded dso, skipping
__cxa_thread_call_dtors: dtr 0xc440f0 from unloaded dso, skipping
__cxa_thread_call_dtors: dtr 0xc44400 from unloaded dso, skipping
__cxa_thread_call_dtors: dtr 0xbc9870 from unloaded dso, skipping
clang: error: linker command failed with exit code 1 (use -v to see 
invocation)

*** Error code 1

-- filemon acquired metadata --
# filemon version 5
# Target pid 1582
# Start 1687753164.054683
V 5
E 1710 /bin/sh
R 1710 /etc/libmap.conf
R 1710 /usr/local/etc/libmap.d
R 1710 /usr/local/etc/libmap.d/mesa.conf
R 1710 /var/run/ld-elf.so.hints
R 1710 /lib/libedit.so.8
R 1710 /lib/libc.so.7
R 1710 /lib/libtinfow.so.9
R 1710 /usr/share/locale/en_GB.UTF-8/LC_COLLATE
R 1710 /usr/share/locale/en_GB.UTF-8/LC_CTYPE
R 1710 /usr/share/locale/en_GB.UTF-8/LC_MONETARY
R 1710 /usr/share/locale/en_GB.UTF-8/LC_NUMERIC
R 1710 /usr/share/locale/en_GB.UTF-8/LC_TIME
R 1710 /usr/share/locale/en_GB.UTF-8/LC_MESSAGES
F 1710 1713
E 1713 /usr/obj/usr/src/amd64.amd64/tmp/usr/bin/cc
F 1713 1718
E 1718 /usr/obj/usr/src/amd64.amd64/tmp/usr/bin/ld
R 1718 /usr/obj/usr/src/amd64.amd64/tmp/usr/lib/Scrt1.o
R 1718 /usr/obj/usr/src/amd64.amd64/tmp/usr/lib/crti.o
R 1718 /usr/obj/usr/src/amd64.amd64/tmp/usr/lib/crtbeginS.o
R 1718 aliases_parse.o
R 1718 aliases_scan.o
R 1718 base64.o
R 1718 conf.o
R 1718 crypto.o
R 1718 dma.o
R 1718 dns.o
R 1718 local.o
R 1718 mail.o
R 1718 net.o
R 1718 spool.o
R 1718 util.o
R 1718 /usr/obj/usr/src/amd64.amd64/tmp/usr/lib/libssl.so
R 1718 /usr/obj/usr/src/amd64.amd64/tmp/usr/lib/libcrypto.so
R 1718 /usr/obj/usr/src/amd64.amd64/tmp/usr/lib/libgcc.a
R 1718 /usr/obj/usr/src/amd64.amd64/tmp/usr/lib/libgcc_s.so
R 1718 /usr/obj/usr/src/amd64.amd64/tmp/usr/lib/libc.so
R 1718 /usr/obj/usr/src/amd64.amd64/tmp/lib/libc.so.7
R 1718 /usr/obj/usr/src/amd64.amd64/tmp/usr/lib/libc_nonshared.a
R 1718 /usr/obj/usr/src/amd64.amd64/tmp/usr/lib/libgcc.a
R 1718 /usr/obj/usr/src/amd64.amd64/tmp/usr/lib/libgcc_s.so
R 1718 /usr/obj/usr/src/amd64.amd64/tmp/usr/lib/crtendS.o
R 1718 /usr/obj/usr/src/amd64.amd64/tmp/usr/lib/crtn.o
R 1718 dma.full.tmpf410f8d
W 1718 dma.full.tmpf410f8d
D 1718 dma.full.tmpf410f8d
X 1718 1 0
X 1713 1 0
X 1710 1 0
# Stop 1687753166.044683
# Bye bye