From 27d93b37d358e7f59c58a052e3821f3c5f01345d Mon Sep 17 00:00:00 2001 From: emaste Date: Thu, 19 Apr 2018 20:58:09 +0000 Subject: [PATCH] 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 --- share/mk/bsd.sys.mk | 2 ++ stand/i386/Makefile.inc | 6 +----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 4e13d199e401..11380ecb8d68 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -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) diff --git a/stand/i386/Makefile.inc b/stand/i386/Makefile.inc index 788365bbdf30..3f0ae158ceb6 100644 --- a/stand/i386/Makefile.inc +++ b/stand/i386/Makefile.inc @@ -2,13 +2,9 @@ # # $FreeBSD$ -.sinclude - 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