[Midnightbsd-cvs] src [9705] fix build with clang 3.4
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Mon Dec 18 12:09:47 EST 2017
Revision: 9705
http://svnweb.midnightbsd.org/src/?rev=9705
Author: laffer1
Date: 2017-12-18 12:09:46 -0500 (Mon, 18 Dec 2017)
Log Message:
-----------
fix build with clang 3.4
Modified Paths:
--------------
trunk/sys/boot/i386/Makefile.inc
trunk/sys/boot/i386/boot2/Makefile
Property Changed:
----------------
trunk/sys/boot/i386/Makefile.inc
Modified: trunk/sys/boot/i386/Makefile.inc
===================================================================
--- trunk/sys/boot/i386/Makefile.inc 2017-12-18 17:08:10 UTC (rev 9704)
+++ trunk/sys/boot/i386/Makefile.inc 2017-12-18 17:09:46 UTC (rev 9705)
@@ -1,19 +1,21 @@
# Common defines for all of /sys/boot/i386/
#
-# $MidnightBSD: src/sys/boot/i386/Makefile.inc,v 1.6 2012/01/22 16:09:59 laffer1 Exp $
+# $MidnightBSD$
# $FreeBSD: src/sys/boot/i386/Makefile.inc,v 1.10 2005/03/15 18:43:36 obrien Exp $
BINDIR?= /boot
LOADER_ADDRESS?=0x200000
-CFLAGS+= -march=i386 -ffreestanding -mpreferred-stack-boundary=2 \
- -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
+CFLAGS+= -march=i386 -ffreestanding
+CFLAGS.gcc+= -mpreferred-stack-boundary=2
+CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
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
Property changes on: trunk/sys/boot/i386/Makefile.inc
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/sys/boot/i386/boot2/Makefile
===================================================================
--- trunk/sys/boot/i386/boot2/Makefile 2017-12-18 17:08:10 UTC (rev 9704)
+++ trunk/sys/boot/i386/boot2/Makefile 2017-12-18 17:09:46 UTC (rev 9705)
@@ -45,10 +45,10 @@
-fno-unit-at-a-time \
--param max-inline-insns-single=100
.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} <= 40201
-CFLAGS.gcc+= -mno-align-long-strings
+CFLAGS.gcc+= -mno-align-long-strings
.endif
-LDFLAGS=-static -N --gc-sections
+LD_FLAGS=-static -N --gc-sections
# Pick up ../Makefile.inc early.
.include <bsd.init.mk>
@@ -61,18 +61,20 @@
CLEANFILES+= boot1 boot1.out boot1.o
boot1: boot1.out
- objcopy -S -O binary boot1.out ${.TARGET}
+ ${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
+BOOT2SIZE= 7680
+
boot2: boot2.ld
- @set -- `ls -l boot2.ld`; x=$$((7680-$$5)); \
+ @set -- `ls -l ${.ALLSRC}`; x=$$((${BOOT2SIZE}-$$5)); \
echo "$$x bytes available"; test $$x -ge 0
- dd if=boot2.ld of=${.TARGET} obs=7680 conv=osync
+ ${DD} if=${.ALLSRC} of=${.TARGET} obs=${BOOT2SIZE} conv=osync
boot2.ld: boot2.ldr boot2.bin ${BTXKERN}
btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l boot2.ldr \
@@ -79,13 +81,13 @@
-o ${.TARGET} -P 1 boot2.bin
boot2.ldr:
- dd if=/dev/zero of=${.TARGET} bs=512 count=1
+ ${DD} if=/dev/zero of=${.TARGET} bs=512 count=1
boot2.bin: boot2.out
- objcopy -S -O binary boot2.out ${.TARGET}
+ ${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
More information about the Midnightbsd-cvs
mailing list