svn commit: r264087 - in head/sys/boot: . ficl ficl32 ficl64 i386/efi i386/loader

Ed Maste emaste at FreeBSD.org
Thu Apr 3 21:18:04 UTC 2014


Author: emaste
Date: Thu Apr  3 21:18:03 2014
New Revision: 264087
URL: http://svnweb.freebsd.org/changeset/base/264087

Log:
  Build boot/ficl as 64-bit library on amd64
  
  The 32-bit bootloaders on amd64 now use the 32-bit version in ficl32,
  as is done with libstand32.  The native 64-bit ficl will be used by the
  upcoming UEFI loader.
  
  Sponsored by:	The FreeBSD Foundation

Added:
  head/sys/boot/ficl32/
     - copied from r264086, head/sys/boot/ficl64/
Deleted:
  head/sys/boot/ficl64/
Modified:
  head/sys/boot/Makefile.amd64
  head/sys/boot/ficl/Makefile
  head/sys/boot/ficl32/Makefile
  head/sys/boot/i386/efi/Makefile
  head/sys/boot/i386/loader/Makefile

Modified: head/sys/boot/Makefile.amd64
==============================================================================
--- head/sys/boot/Makefile.amd64	Thu Apr  3 20:18:55 2014	(r264086)
+++ head/sys/boot/Makefile.amd64	Thu Apr  3 21:18:03 2014	(r264087)
@@ -1,7 +1,10 @@
 # $FreeBSD$
 
 SUBDIR+=		efi
-SUBDIR+=		ficl64
 SUBDIR+=		libstand32
 SUBDIR+=		zfs
 SUBDIR+=		userboot
+
+.if ${MK_FORTH} != "no"
+SUBDIR+=		ficl32
+.endif

Modified: head/sys/boot/ficl/Makefile
==============================================================================
--- head/sys/boot/ficl/Makefile	Thu Apr  3 20:18:55 2014	(r264086)
+++ head/sys/boot/ficl/Makefile	Thu Apr  3 21:18:03 2014	(r264087)
@@ -3,7 +3,7 @@
 
 FICLDIR?=	${.CURDIR}
 
-.if !defined(FICL64)
+.if defined(FICL32)
 .PATH: ${FICLDIR}/${MACHINE_CPUARCH:S/amd64/i386/}
 .elif ${MACHINE_ARCH} == "mips64" || ${MACHINE_ARCH} == "mips64el"
 .PATH: ${FICLDIR}/${MACHINE_ARCH}
@@ -16,11 +16,12 @@ BASE_SRCS=	dict.c ficl.c fileaccess.c fl
 SRCS=		${BASE_SRCS} sysdep.c softcore.c
 CLEANFILES=	softcore.c testmain testmain.o
 CFLAGS+=	-ffreestanding
-.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
-.if !defined(FICL64)
+.if ${MACHINE_CPUARCH} == "i386" || \
+    (${MACHINE_CPUARCH} == "amd64" && defined(FICL32))
 CFLAGS+=	-march=i386
 CFLAGS.gcc+=	-mpreferred-stack-boundary=2
 .endif
+.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
 CFLAGS+=	-mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
 .endif
 .if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips"
@@ -53,22 +54,32 @@ SOFTWORDS=	softcore.fr jhlocal.fr marker
 # Optional OO extension softwords
 #SOFTWORDS+=	oo.fr classes.fr
 
-.if ${MACHINE_CPUARCH} == "amd64" && !defined(FICL64)
+.if ${MACHINE_CPUARCH} == "amd64"
+.if defined(FICL32)
 CFLAGS+=	-m32 -I.
+.else
+CFLAGS+=	-fPIC
+.endif
 .endif
 
 .if ${MACHINE_ARCH} == "powerpc64"
 CFLAGS+=	-m32 -mcpu=powerpc -I.
 .endif
 
-CFLAGS+=	-I${FICLDIR} -I${FICLDIR}/${MACHINE_CPUARCH:S/amd64/i386/} \
+.if ${MACHINE_CPUARCH} == "amd64" && defined(FICL32)
+FICL_CPUARCH=	i386
+.else
+FICL_CPUARCH=	${MACHINE_CPUARCH}
+.endif
+
+CFLAGS+=	-I${FICLDIR} -I${FICLDIR}/${FICL_CPUARCH} \
 		-I${FICLDIR}/../common
 
 softcore.c: ${SOFTWORDS} softcore.awk
 	(cd ${FICLDIR}/softwords; cat ${SOFTWORDS} \
 	    | awk -f softcore.awk -v datestamp="`LC_ALL=C date`") > ${.TARGET}
 
-.if ${MACHINE_CPUARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64" && defined(FICL32)
 .if !exists(machine)
 ${SRCS:M*.c:R:S/$/.o/g}: machine
 

Modified: head/sys/boot/ficl32/Makefile
==============================================================================
--- head/sys/boot/ficl64/Makefile	Thu Apr  3 20:18:55 2014	(r264086)
+++ head/sys/boot/ficl32/Makefile	Thu Apr  3 21:18:03 2014	(r264087)
@@ -1,6 +1,6 @@
 # $FreeBSD$
 
-FICL64=
+FICL32=
 FICLDIR=	${.CURDIR}/../ficl
 
 .PATH:	${FICLDIR}

Modified: head/sys/boot/i386/efi/Makefile
==============================================================================
--- head/sys/boot/i386/efi/Makefile	Thu Apr  3 20:18:55 2014	(r264086)
+++ head/sys/boot/i386/efi/Makefile	Thu Apr  3 21:18:03 2014	(r264087)
@@ -31,8 +31,12 @@ BOOT_FORTH=	yes
 CFLAGS+=	-DBOOT_FORTH
 CFLAGS+=	-I${.CURDIR}/../../ficl
 CFLAGS+=	-I${.CURDIR}/../../ficl/i386
+.if ${MACHINE_CPUARCH} == "amd64"
+LIBFICL=	${.OBJDIR}/../../ficl32/libficl.a
+.else
 LIBFICL=	${.OBJDIR}/../../ficl/libficl.a
 .endif
+.endif
 
 # Include bcache code.
 HAVE_BCACHE=    yes

Modified: head/sys/boot/i386/loader/Makefile
==============================================================================
--- head/sys/boot/i386/loader/Makefile	Thu Apr  3 20:18:55 2014	(r264086)
+++ head/sys/boot/i386/loader/Makefile	Thu Apr  3 21:18:03 2014	(r264087)
@@ -41,8 +41,12 @@ HAVE_ISABUS=	yes
 # Enable BootForth
 BOOT_FORTH=	yes
 CFLAGS+=	-DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/i386
+.if ${MACHINE_CPUARCH} == "amd64"
+LIBFICL=	${.OBJDIR}/../../ficl32/libficl.a
+.else
 LIBFICL=	${.OBJDIR}/../../ficl/libficl.a
 .endif
+.endif
 
 .if defined(LOADER_BZIP2_SUPPORT)
 CFLAGS+=	-DLOADER_BZIP2_SUPPORT


More information about the svn-src-head mailing list