Add support for linker-type-specific flags

r332090 added a LINKER_TYPE test to add the --no-rosegment flag when
linking the i386 loader components with lld.  Instead, introduce a
general mechanism for setting LDFLAGS for a specific linker type,
and use it for --no-rosegment.

Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D14998
This commit is contained in:
Ed Maste 2018-04-19 20:58:09 +00:00
parent 3b05ffaf6f
commit b25a46f7f7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=332794
2 changed files with 3 additions and 5 deletions

View File

@ -226,6 +226,8 @@ ACFLAGS+= ${ACFLAGS.${.IMPSRC:T}}
CFLAGS+= ${CFLAGS.${.IMPSRC:T}}
CXXFLAGS+= ${CXXFLAGS.${.IMPSRC:T}}
LDFLAGS+= ${LDFLAGS.${LINKER_TYPE}}
.if defined(SRCTOP)
# Prevent rebuilding during install to support read-only objdirs.
.if ${.TARGETS:M*install*} == ${.TARGETS} && empty(.MAKE.MODE:Mmeta)

View File

@ -2,13 +2,9 @@
#
# $FreeBSD$
.sinclude <bsd.linker.mk>
LOADER_ADDRESS?=0x200000
LDFLAGS+= -nostdlib
.if defined(LINKER_TYPE) && ${LINKER_TYPE} == "lld"
LDFLAGS+= -Wl,--no-rosegment
.endif
LDFLAGS.lld+= -Wl,--no-rosegment
# BTX components
BTXDIR= ${BOOTOBJ}/i386/btx