Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Mar 2012 23:52:22 +0000 (UTC)
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r232706 - in projects/bigbb/sys/boot/pc98: . boot2 boot2ufs1
Message-ID:  <201203082352.q28NqMVj070082@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkim
Date: Thu Mar  8 23:52:22 2012
New Revision: 232706
URL: http://svn.freebsd.org/changeset/base/232706

Log:
  MFi386:		r232698
  
  Split boot2 into UFS1-only and UFS2-only versions.

Added:
  projects/bigbb/sys/boot/pc98/boot2ufs1/
  projects/bigbb/sys/boot/pc98/boot2ufs1/Makefile   (contents, props changed)
Modified:
  projects/bigbb/sys/boot/pc98/Makefile
  projects/bigbb/sys/boot/pc98/boot2/Makefile

Modified: projects/bigbb/sys/boot/pc98/Makefile
==============================================================================
--- projects/bigbb/sys/boot/pc98/Makefile	Thu Mar  8 23:46:42 2012	(r232705)
+++ projects/bigbb/sys/boot/pc98/Makefile	Thu Mar  8 23:52:22 2012	(r232706)
@@ -1,5 +1,6 @@
 # $FreeBSD$
 
-SUBDIR=		boot0 boot0.5 pc98boot btx boot2 cdboot kgzldr libpc98 loader
+SUBDIR=		boot0 boot0.5 pc98boot btx boot2 boot2ufs1 cdboot kgzldr \
+		libpc98 loader
 
 .include <bsd.subdir.mk>

Modified: projects/bigbb/sys/boot/pc98/boot2/Makefile
==============================================================================
--- projects/bigbb/sys/boot/pc98/boot2/Makefile	Thu Mar  8 23:46:42 2012	(r232705)
+++ projects/bigbb/sys/boot/pc98/boot2/Makefile	Thu Mar  8 23:52:22 2012	(r232706)
@@ -2,10 +2,9 @@
 
 .include <bsd.own.mk>
 
-# XXX: clang can compile the boot code just fine, but boot2 gets too big
-CC:=${CC:C/^(.*\/)?clang$/gcc/1}
+FILES=		boot${BOOT_SUFFIX} boot2${BOOT2_SUFFIX}
 
-FILES=		boot boot1 boot2
+SRCDIR=		${.CURDIR}/../boot2
 
 NM?=		nm
 
@@ -18,9 +17,26 @@ ORG1=	0
 ORG2=	0x2000
 
 # Decide level of UFS support.
+# XXX Currently clang overflows UFS1+UFS2 boot2.
+.if ${MK_CLANG} != "no" && \
+    (${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang")
+BOOT2_UFS?=	UFS2_ONLY
+.else
 BOOT2_UFS?=	UFS1_AND_UFS2
-#BOOT2_UFS?=	UFS2_ONLY
-#BOOT2_UFS?=	UFS1_ONLY
+.endif
+
+.if ${BOOT2_UFS} != UFS1_ONLY
+FILES+=		boot1
+.endif
+.if ${BOOT2_UFS} == UFS1_ONLY
+BOOT_SUFFIX=	.ufs1
+BOOT2_SUFFIX=	ufs1
+.elif ${BOOT2_UFS} == UFS2_ONLY
+BOOT_SUFFIX=	.ufs2
+BOOT2_SUFFIX=	ufs2
+LINKS=		${BINDIR}/boot${BOOT_SUFFIX} ${BINDIR}/boot \
+		${BINDIR}/boot2${BOOT2_SUFFIX} ${BINDIR}/boot2
+.endif
 
 CFLAGS=	-Os \
 	-fno-guess-branch-probability \
@@ -41,7 +57,8 @@ CFLAGS=	-Os \
 	-Wall -Waggregate-return -Wbad-function-cast -Wcast-align \
 	-Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
 	-Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \
-	-Winline --param max-inline-insns-single=100
+	-Winline --param max-inline-insns-single=100 \
+	${CLANG_OPT_SMALL}
 
 # Set machine type to PC98_SYSTEM_PARAMETER
 #CFLAGS+=	-DSET_MACHINE_TYPE
@@ -56,10 +73,10 @@ LDFLAGS=-static -N --gc-sections
 
 .PATH:	${.CURDIR}/../../i386/boot2
 
-CLEANFILES=	boot
+CLEANFILES=	boot${BOOT_SUFFIX}
 
-boot: boot1 boot2
-	cat boot1 boot2 > boot
+boot${BOOT_SUFFIX}: boot1 boot2${BOOT2_SUFFIX}
+	cat ${.ALLSRC} > ${.TARGET}
 
 CLEANFILES+=	boot1 boot1.out boot1.o
 
@@ -69,10 +86,10 @@ boot1: boot1.out
 boot1.out: boot1.o
 	${LD} ${LDFLAGS} -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
+CLEANFILES+=	boot2${BOOT2_SUFFIX} boot2.ld boot2.ldr boot2.bin boot2.out \
+		boot2.o boot2.s boot2.s.tmp boot2.h sio.o
 
-boot2: boot2.ld
+boot2${BOOT2_SUFFIX}: boot2.ld
 	@set -- `ls -l boot2.ld`; x=$$((7680-$$5)); \
 	    echo "$$x bytes available"; test $$x -ge 0
 	dd if=boot2.ld of=${.TARGET} obs=7680 conv=osync
@@ -95,7 +112,7 @@ boot2.o: boot2.s
 SRCS=	boot2.c boot2.h
 
 boot2.s: boot2.c boot2.h ${.CURDIR}/../../common/ufsread.c
-	${CC} ${CFLAGS} -S -o boot2.s.tmp ${.CURDIR}/boot2.c
+	${CC} ${CFLAGS} -S -o boot2.s.tmp ${SRCDIR}/boot2.c
 	sed -e '/align/d' -e '/nop/d' < boot2.s.tmp > boot2.s
 	rm -f boot2.s.tmp
 
@@ -107,3 +124,7 @@ boot2.h: boot1.out
 	    REL1=`printf "%d" ${REL1}` > ${.TARGET}
 
 .include <bsd.prog.mk>
+
+# XXX: clang integrated-as doesn't grok .codeNN directives yet
+CFLAGS.boot1.S=		${CLANG_NO_IAS}
+CFLAGS+=		${CFLAGS.${.IMPSRC:T}}

Added: projects/bigbb/sys/boot/pc98/boot2ufs1/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/bigbb/sys/boot/pc98/boot2ufs1/Makefile	Thu Mar  8 23:52:22 2012	(r232706)
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+.PATH: ${.CURDIR}/../boot2
+
+BOOT2_UFS=	UFS1_ONLY
+
+.include "${.CURDIR}/../boot2/Makefile"



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