Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Dec 2019 22:33:48 +0000 (UTC)
From:      Ian Lepore <ian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r356085 - head/sys/conf
Message-ID:  <201912252233.xBPMXmC0005996@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ian
Date: Wed Dec 25 22:33:47 2019
New Revision: 356085
URL: https://svnweb.freebsd.org/changeset/base/356085

Log:
  In kern.pre.mk, split SYSTEM_LD into two variables to avoid duplication in
  other files.
  
  Arm and mips systems need to replace the SYSTEM_LD variable because they
  need to create intermediate files which are post-processed with objcopy to
  create the final .TARGET file. Previously they did so by pasting the full
  expansion of SYSTEM_LD with the output filename replaced. This means
  changing SYSTEM_LD in kern.pre.mk means you need to chase down anything that
  replaces it and figure out how it differs so you can paste your changes in
  there too.
  
  Now there is a SYSTEM_LD_BASECMD variable that holds the entire basic kernel
  linker command without the input and output files. This will allow arm and
  mips makefiles to create their custom versions by refering to
  SYSTEM_LD_BASECMD, which then becomes the one place where you have to make
  changes to the basic linker command args.
  
  Differential Revision:	https://reviews.freebsd.org/D22921

Modified:
  head/sys/conf/kern.pre.mk

Modified: head/sys/conf/kern.pre.mk
==============================================================================
--- head/sys/conf/kern.pre.mk	Wed Dec 25 22:25:30 2019	(r356084)
+++ head/sys/conf/kern.pre.mk	Wed Dec 25 22:33:47 2019	(r356085)
@@ -266,10 +266,11 @@ MD_ROOT_SIZE_CONFIGURED!=	grep MD_ROOT_SIZE opt_md.h |
 SYSTEM_OBJS+= embedfs_${MFS_IMAGE:T:R}.o
 .endif
 .endif
-SYSTEM_LD= @${LD} -m ${LD_EMULATION} -Bdynamic -T ${LDSCRIPT} ${_LDFLAGS} \
+SYSTEM_LD_BASECMD= \
+	${LD} -m ${LD_EMULATION} -Bdynamic -T ${LDSCRIPT} ${_LDFLAGS} \
 	--no-warn-mismatch --warn-common --export-dynamic \
-	--dynamic-linker /red/herring \
-	-o ${.TARGET} -X ${SYSTEM_OBJS} vers.o
+	--dynamic-linker /red/herring -X
+SYSTEM_LD= @${SYSTEM_LD_BASECMD} -o ${.TARGET} ${SYSTEM_OBJS} vers.o
 SYSTEM_LD_TAIL= @${OBJCOPY} --strip-symbol gcc2_compiled. ${.TARGET} ; \
 	${SIZE} ${.TARGET} ; chmod 755 ${.TARGET}
 SYSTEM_DEP+= ${LDSCRIPT}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201912252233.xBPMXmC0005996>