svn commit: r332794 - in head: share/mk stand/i386

Ed Maste emaste at FreeBSD.org
Thu Apr 19 20:58:10 UTC 2018


Author: emaste
Date: Thu Apr 19 20:58:09 2018
New Revision: 332794
URL: https://svnweb.freebsd.org/changeset/base/332794

Log:
  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

Modified:
  head/share/mk/bsd.sys.mk
  head/stand/i386/Makefile.inc

Modified: head/share/mk/bsd.sys.mk
==============================================================================
--- head/share/mk/bsd.sys.mk	Thu Apr 19 20:47:53 2018	(r332793)
+++ head/share/mk/bsd.sys.mk	Thu Apr 19 20:58:09 2018	(r332794)
@@ -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)

Modified: head/stand/i386/Makefile.inc
==============================================================================
--- head/stand/i386/Makefile.inc	Thu Apr 19 20:47:53 2018	(r332793)
+++ head/stand/i386/Makefile.inc	Thu Apr 19 20:58:09 2018	(r332794)
@@ -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


More information about the svn-src-head mailing list