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
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to