HomeFreeBSD

rescue: Stop using LDADD_zstd

Description

rescue: Stop using LDADD_zstd

Ideally we'd be able to use LDADD_foo here for all our various libs and
get the implicit dependencies, but rescue is a bit special. Historically
this was just used to pick up the "private" in the name automatically
(as far as I can tell), but now that _DP_pthread includes c we end up
pulling in a -lc from this (along with -lcompiler_rt and -lsys). This
results in -lc being before -lmd (and after, implictly, from the
compiler driver), which, for the specific situation here, results in
both libc.a's and libmd.a's md5c.o being included, giving duplicate
definitions of _libmd_MD5Init and other symbols. With LLD 16+ we
currently make that not an error for other reasons (which should
probably be fixed), but not for older versions, nor for BFD, and so the
build fails.

Fix all this by just using -lprivatezstd in place of LDADD_zstd, which
results in the exact same clang command line as we used to have prior to
adding c (and sys) to _DP_pthread when linking rescue. Note that bsdbox
already uses -lprivatezstd rather than LDADD_zstd.

This reverts commit 5fead429ebb3800fdd3fc0817d2c330b2a8d640f.

Reviewed by: imp
Fixes: 99ea67573164 ("lib{c,sys}: move auxargs more firmly into libsys")

Details

Provenance
jrtc27Authored on Feb 22 2024, 8:56 PM
Parents
rGd646dca3bc1b: bge(4): Fix some typos in source code comments
Branches
Unknown
Tags
Unknown
Reverts
rG5fead429ebb3: Avoid referencing private lib names directly.