rtld: fix dependencies for rtld-libc
Previously we (appropriately, but incorrectly) attempted to depend on
LIBC_NOSSP_PIC and LIBSYS_PIC for rtld_libc.a. Unfortunately,
variables in dependency lists are expanded at parse time and those
variables are defined in bsd.libnames.mk which *must* be included by
bsd.{lib,prog}.mk. As such, they were undefined and thus expanded to
the empty string resulting in no dependency with predictable and highly
confusing results.
Move the declaration of these dependencies to after the include of
bsd.prog.mk and add comments on both side in hopes of keeping any future
dependencies in sync.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D51790
This commit is contained in:
@@ -128,3 +128,7 @@ ${PROG_FULL}: ${VERSION_MAP}
|
||||
# and are therefore not identical to the ones from the system headers.
|
||||
CFLAGS+= -Wno-redundant-decls
|
||||
.endif
|
||||
|
||||
# Add dependencies on libc and libsys archives after bsd.prog.mk
|
||||
# includes bsd.libnames.mk so they are defined.
|
||||
rtld_libc.a: ${LIBC_NOSSP_PIC} ${LIBSYS_PIC}
|
||||
|
||||
@@ -96,7 +96,11 @@ CLEANFILES+=${_obj}.pico
|
||||
|
||||
# We insert all the .o files from libc_nossp_pic.a into a new rtld_libc.a file
|
||||
# to ensure that only .o files that are actually used end up being included.
|
||||
rtld_libc.a: ${LIBC_NOSSP_PIC} ${LIBSYS_PIC} ${SRCTOP}/libexec/rtld-elf/rtld-libc/Makefile.inc
|
||||
#
|
||||
# XXX: we add dependencies on the source libraries in ../Makefile after
|
||||
# bsd.prog.mk includes bsd.libnames.mk since variables in dependencies are
|
||||
# expanded when parsed.
|
||||
rtld_libc.a: ${SRCTOP}/libexec/rtld-elf/rtld-libc/Makefile.inc
|
||||
@rm -f ${.TARGET}
|
||||
${AR} x ${LIBC_NOSSP_PIC} ${_rtld_libc_objs}
|
||||
${AR} x ${LIBSYS_PIC} ${_rtld_libsys_objs}
|
||||
|
||||
Reference in New Issue
Block a user