1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-12 09:58:36 +00:00
freebsd/contrib
Mark Johnston 3aa0bc89c6 libdwarf: Add a weak uncompress() symbol
This works around brokenness in buildworld's bootstrapping logic: it
uses the source tree's metadata to collect dependency info (such as,
"libdwarf depends on libz") but links against static host libraries.
If these two are out of sync, as is the case if one builds a commit
prior to the introduction of the libz dependency, then the build fails
when trying to statically link nm(1).

Mitigate the problem by defining a weak uncompress() symbol which simply
returns an error.  This ensures that the build won't fail when
statically linking libdwarf without zlib.  The downside is that any
tools using libdwarf without zlib will now hit a runtime error if they
attempt to decode compressed sections, but at least they'll fail
deterministically, and compressed debug info is only enabled by default
in main.

In particular, this fixes building of branches lacking commit
dbf05458e3, such as releng branches, stable/12 and 13 and old
revisions of main.  Previously the nm(1) build would fail with:

ld: error: undefined symbol: uncompress
>>> referenced by libdwarf_elf_init.c:233
>>> (/usr/src/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c:233)
>>>               libdwarf_elf_init.o:(_dwarf_elf_init) in archive
>>> /usr/lib/libdwarf.a

Reported by:	dim, ler, krion
Reviewed by:	imp, emaste
Fixes:		dbf05458e3 ("libdwarf: Support consumption of compressed ELF sections")
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33419
2021-12-13 18:47:15 -05:00
..
arm-optimized-routines
atf
bc contrib/bc: merge version 5.2.1 from vendor branch 2021-11-30 18:40:32 +01:00
bearssl
blacklist
bmake
bsddialog bsddialog: import version 0.0.1 2021-12-13 09:01:39 +01:00
bsnmp
byacc
bzip2 Remove FREEBSD-vendor files 2021-12-06 16:36:44 -05:00
capsicum-test
com_err
cortex-strings
dialog
diff
dma
ee
elftoolchain libdwarf: Add a weak uncompress() symbol 2021-12-13 18:47:15 -05:00
expat
file
flex
gdtoa
googletest
hyperv/tools
ipfilter ippool: remove set-but-not-unused vars 2021-12-10 21:52:54 -08:00
jemalloc
kyua
ldns
ldns-host
less
lib9p
libarchive
libbegemot
libc-pwcache
libc-vis
libcbor
libcxxrt
libdivsufsort
libedit
libevent
libexecinfo
libfido2
libpcap
libucl
libxo
llvm-project Revert clang change that breaks CTF on aarch64 2021-12-12 21:11:40 +01:00
lua
lutok
mandoc
mknod
mtree
ncurses
netbsd-tests Add tests for posix_spawn_file_actions_add{chdir,fchdir}_np(3) 2021-11-30 03:43:54 +02:00
netcat Remove FREEBSD-vendor files 2021-12-06 16:36:44 -05:00
ngatm
ntp
nvi
ofed
one-true-awk
openbsm
opencsd/decoder
openpam
openresolv
opie
pam_modules/pam_passwdqc
pf
pjdfstest
pnglite
pnpinfo
processor-trace
sendmail
smbfs
sqlite3
tcp_wrappers
tcpdump
tcsh
telnet
terminus
tnftp
traceroute
tzcode
tzdata
unbound unbount: Vendor import 1.14.0rc1 2021-12-02 22:11:04 -08:00
unvis
vis
wpa wpa: Redo import wpa_supplicant/hostapd commit 14ab4a816 2021-12-02 15:08:52 -08:00
xz