Bootstrap libz when cross-building from non-FreeBSD

This is needed now libdwarf depends on libz.

Fixes:		dbf05458e3 ("libdwarf: Support consumption of compressed ELF sections")
MFC after:	1 week
This commit is contained in:
Jessica Clarke 2021-12-06 18:12:46 +00:00
parent 7ba31d58f0
commit 8d5d329553
3 changed files with 11 additions and 2 deletions

View file

@ -2469,6 +2469,10 @@ _other_bootstrap_tools+=usr.bin/bmake
# Avoid dependency on host bz2 headers:
_other_bootstrap_tools+=lib/libbz2
${_bt}-usr.bin/grep: ${_bt}-lib/libbz2
# libdwarf depends on libz
_other_bootstrap_tools+=lib/libz
${_bt}-lib/libdwarf: ${_bt}-lib/libz
.else
# All tools in _basic_bootstrap_tools have the same name as the subdirectory
# so we can use :T to get the name of the symlinks that we need to create.

View file

@ -38,9 +38,14 @@ SRCS+= inflate.c
SRCS+= inftrees.c
SRCS+= trees.c
SRCS+= uncompr.c
SRCS+= zopen.c
SRCS+= zutil.c
# Wrapper relies on FreeBSD-specific fpos_t representation and non-portable
# funopen. Not needed for bootstrapping, so just disable it.
.if ${.MAKE.OS} == "FreeBSD" || !defined(BOOTSTRAPPING)
SRCS+= zopen.c
.endif
.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
CFLAGS+= -DUNALIGNED_OK
.endif

View file

@ -16,7 +16,6 @@ NM:= /usr/bin/nm
# Avoid stale dependecy warnings:
LIBC:=
LIBZ:=
LIBM:=
LIBUTIL:=
LIBCPLUSPLUS:=
@ -30,6 +29,7 @@ LIBL:=${WORLDTMP}/legacy/usr/lib/libl.a
LIBROKEN:=${WORLDTMP}/legacy/usr/lib/libroken.a
LIBDWARF:=${WORLDTMP}/legacy/usr/lib/libdwarf.a
LIBELF:=${WORLDTMP}/legacy/usr/lib/libelf.a
LIBZ:=${WORLDTMP}/legacy/usr/lib/libz.a
# Add various -Werror flags to catch missing function declarations
CFLAGS+= -Werror=implicit-function-declaration -Werror=implicit-int \