svn commit: r260095 - in head/sys/boot: i386 i386/boot2 i386/gptboot i386/gptzfsboot i386/zfsboot pc98/boot2

Dimitry Andric dim at FreeBSD.org
Mon Dec 30 19:05:52 UTC 2013


Author: dim
Date: Mon Dec 30 19:05:50 2013
New Revision: 260095
URL: http://svnweb.freebsd.org/changeset/base/260095

Log:
  For sys/boot/i386 and sys/boot/pc98, separate flags to be passed
  directly to the linker (LD_FLAGS) from flags passed indirectly, via the
  compiler driver (LDFLAGS).
  
  This is because several Makefiles under sys/boot/i386 and sys/boot/pc98
  use ${LD} directly to link, and the normal LDFLAGS value should not be
  used in these cases.
  
  MFC after:	3 days

Modified:
  head/sys/boot/i386/Makefile.inc
  head/sys/boot/i386/boot2/Makefile
  head/sys/boot/i386/gptboot/Makefile
  head/sys/boot/i386/gptzfsboot/Makefile
  head/sys/boot/i386/zfsboot/Makefile
  head/sys/boot/pc98/boot2/Makefile

Modified: head/sys/boot/i386/Makefile.inc
==============================================================================
--- head/sys/boot/i386/Makefile.inc	Mon Dec 30 18:42:09 2013	(r260094)
+++ head/sys/boot/i386/Makefile.inc	Mon Dec 30 19:05:50 2013	(r260095)
@@ -13,7 +13,8 @@ LDFLAGS+=	-nostdlib
 .if ${MACHINE_CPUARCH} == "amd64"
 CFLAGS+=	-m32
 ACFLAGS+=	-m32
-LDFLAGS+=	-m elf_i386_fbsd
+# LD_FLAGS is passed directly to ${LD}, not via ${CC}:
+LD_FLAGS+=	-m elf_i386_fbsd
 AFLAGS+=	--32
 .endif
 

Modified: head/sys/boot/i386/boot2/Makefile
==============================================================================
--- head/sys/boot/i386/boot2/Makefile	Mon Dec 30 18:42:09 2013	(r260094)
+++ head/sys/boot/i386/boot2/Makefile	Mon Dec 30 19:05:50 2013	(r260095)
@@ -44,7 +44,7 @@ CFLAGS.gcc+=	-fno-guess-branch-probabili
 		-fno-unit-at-a-time \
 		-mno-align-long-strings \
 
-LDFLAGS=-static -N --gc-sections
+LD_FLAGS=-static -N --gc-sections
 
 # Pick up ../Makefile.inc early.
 .include <bsd.init.mk>
@@ -60,7 +60,7 @@ boot1: boot1.out
 	objcopy -S -O binary boot1.out ${.TARGET}
 
 boot1.out: boot1.o
-	${LD} ${LDFLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} boot1.o
+	${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} boot1.o
 
 CLEANFILES+=	boot2 boot2.ld boot2.ldr boot2.bin boot2.out boot2.o \
 		boot2.s boot2.s.tmp boot2.h sio.o
@@ -81,7 +81,7 @@ boot2.bin: boot2.out
 	objcopy -S -O binary boot2.out ${.TARGET}
 
 boot2.out: ${BTXCRT} boot2.o sio.o
-	${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC}
+	${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC}
 
 boot2.o: boot2.s
 	${CC} ${ACFLAGS} -c boot2.s

Modified: head/sys/boot/i386/gptboot/Makefile
==============================================================================
--- head/sys/boot/i386/gptboot/Makefile	Mon Dec 30 18:42:09 2013	(r260094)
+++ head/sys/boot/i386/gptboot/Makefile	Mon Dec 30 19:05:50 2013	(r260095)
@@ -37,7 +37,7 @@ CFLAGS=	-DBOOTPROG=\"gptboot\" \
 	-Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \
 	-Winline --param max-inline-insns-single=100
 
-LDFLAGS=-static -N --gc-sections
+LD_FLAGS=-static -N --gc-sections
 
 # Pick up ../Makefile.inc early.
 .include <bsd.init.mk>
@@ -54,7 +54,7 @@ gptldr.bin: gptldr.out
 	objcopy -S -O binary gptldr.out ${.TARGET}
 
 gptldr.out: gptldr.o
-	${LD} ${LDFLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o
+	${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o
 
 CLEANFILES+=	gptboot.bin gptboot.out gptboot.o sio.o gpt.o crc32.o drv.o \
 		cons.o util.o
@@ -63,7 +63,7 @@ gptboot.bin: gptboot.out
 	objcopy -S -O binary gptboot.out ${.TARGET}
 
 gptboot.out: ${BTXCRT} gptboot.o sio.o gpt.o crc32.o drv.o cons.o util.o
-	${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND}
+	${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND}
 
 gptboot.o: ${.CURDIR}/../../common/ufsread.c
 

Modified: head/sys/boot/i386/gptzfsboot/Makefile
==============================================================================
--- head/sys/boot/i386/gptzfsboot/Makefile	Mon Dec 30 18:42:09 2013	(r260094)
+++ head/sys/boot/i386/gptzfsboot/Makefile	Mon Dec 30 19:05:50 2013	(r260095)
@@ -34,7 +34,7 @@ CFLAGS=	-DBOOTPROG=\"gptzfsboot\" \
 	-Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \
 	-Winline --param max-inline-insns-single=100
 
-LDFLAGS=-static -N --gc-sections
+LD_FLAGS=-static -N --gc-sections
 
 # Pick up ../Makefile.inc early.
 .include <bsd.init.mk>
@@ -51,7 +51,7 @@ gptldr.bin: gptldr.out
 	objcopy -S -O binary gptldr.out ${.TARGET}
 
 gptldr.out: gptldr.o
-	${LD} ${LDFLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o
+	${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o
 
 CLEANFILES+=	gptzfsboot.bin gptzfsboot.out zfsboot.o sio.o cons.o \
 		drv.o gpt.o util.o
@@ -60,7 +60,7 @@ gptzfsboot.bin: gptzfsboot.out
 	objcopy -S -O binary gptzfsboot.out ${.TARGET}
 
 gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o util.o
-	${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND}
+	${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND}
 
 zfsboot.o: ${.CURDIR}/../../zfs/zfsimpl.c
 

Modified: head/sys/boot/i386/zfsboot/Makefile
==============================================================================
--- head/sys/boot/i386/zfsboot/Makefile	Mon Dec 30 18:42:09 2013	(r260094)
+++ head/sys/boot/i386/zfsboot/Makefile	Mon Dec 30 19:05:50 2013	(r260095)
@@ -31,7 +31,7 @@ CFLAGS=	-DBOOTPROG=\"zfsboot\" \
 	-Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \
 	-Winline --param max-inline-insns-single=100
 
-LDFLAGS=-static -N --gc-sections
+LD_FLAGS=-static -N --gc-sections
 
 # Pick up ../Makefile.inc early.
 .include <bsd.init.mk>
@@ -47,7 +47,7 @@ zfsboot1: zfsldr.out
 	objcopy -S -O binary zfsldr.out ${.TARGET}
 
 zfsldr.out: zfsldr.o
-	${LD} ${LDFLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} zfsldr.o
+	${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} zfsldr.o
 
 CLEANFILES+=	zfsboot2 zfsboot.ld zfsboot.ldr zfsboot.bin zfsboot.out \
 		zfsboot.o zfsboot.s zfsboot.s.tmp sio.o cons.o drv.o util.o
@@ -73,7 +73,7 @@ zfsboot.bin: zfsboot.out
 	objcopy -S -O binary zfsboot.out ${.TARGET}
 
 zfsboot.out: ${BTXCRT} zfsboot.o sio.o drv.o cons.o util.o
-	${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND}
+	${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND}
 
 SRCS=	zfsboot.c
 

Modified: head/sys/boot/pc98/boot2/Makefile
==============================================================================
--- head/sys/boot/pc98/boot2/Makefile	Mon Dec 30 18:42:09 2013	(r260094)
+++ head/sys/boot/pc98/boot2/Makefile	Mon Dec 30 19:05:50 2013	(r260095)
@@ -50,7 +50,7 @@ CFLAGS=	-Os \
 # Initialize the bi_bios_geom using the BIOS geometry
 #CFLAGS+=	-DGET_BIOSGEOM
 
-LDFLAGS=-static -N --gc-sections
+LD_FLAGS=-static -N --gc-sections
 
 # Pick up ../Makefile.inc early.
 .include <bsd.init.mk>
@@ -68,7 +68,7 @@ boot1: boot1.out
 	objcopy -S -O binary boot1.out ${.TARGET}
 
 boot1.out: boot1.o
-	${LD} ${LDFLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} boot1.o
+	${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} boot1.o
 
 CLEANFILES+=	boot2 boot2.ld boot2.ldr boot2.bin boot2.out boot2.o \
 		boot2.s boot2.s.tmp boot2.h sio.o
@@ -89,7 +89,7 @@ boot2.bin: boot2.out
 	objcopy -S -O binary boot2.out ${.TARGET}
 
 boot2.out: ${BTXCRT} boot2.o sio.o
-	${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC}
+	${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC}
 
 boot2.o: boot2.s
 


More information about the svn-src-all mailing list