Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Apr 2012 15:01:23 +0000 (UTC)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r234493 - in head/sys/boot: efi i386/efi
Message-ID:  <201204201501.q3KF1NZW044098@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marcel
Date: Fri Apr 20 15:01:23 2012
New Revision: 234493
URL: http://svn.freebsd.org/changeset/base/234493

Log:
  Build a 32-bit EFI loader on amd64. This to match the rest of the
  code that is used to construct a loader (e.g. libstand, ficl, etc).
  
  There is such a thing as a 64-bit EFI application, but it's not
  as standard as 32-bit is. Let's make the 32-bit functional (as in
  we can load and actualy boot a kernel) before solving the 64-bit
  loader problem.

Modified:
  head/sys/boot/efi/Makefile.inc
  head/sys/boot/i386/efi/Makefile

Modified: head/sys/boot/efi/Makefile.inc
==============================================================================
--- head/sys/boot/efi/Makefile.inc	Fri Apr 20 14:45:57 2012	(r234492)
+++ head/sys/boot/efi/Makefile.inc	Fri Apr 20 15:01:23 2012	(r234493)
@@ -2,6 +2,13 @@
 
 BINDIR?=	/boot
 
+.if ${MACHINE_CPUARCH} == "amd64"
+CFLAGS+=        -m32 -march=i386
+ACFLAGS+=       -m32
+LDFLAGS+=       -m elf_i386_fbsd
+AFLAGS+=        --32
+.endif
+
 # Options used when building app-specific efi components
 CFLAGS+=	-ffreestanding -fshort-wchar -Wformat
 LDFLAGS+=	-nostdlib

Modified: head/sys/boot/i386/efi/Makefile
==============================================================================
--- head/sys/boot/i386/efi/Makefile	Fri Apr 20 14:45:57 2012	(r234492)
+++ head/sys/boot/i386/efi/Makefile	Fri Apr 20 15:01:23 2012	(r234493)
@@ -35,7 +35,7 @@ CFLAGS+=	-I${.CURDIR}/../../common
 FILES=	loader.efi
 FILESMODE_loader.efi=	${BINMODE}
 
-LDSCRIPT=	${.CURDIR}/ldscript.${MACHINE_ARCH}
+LDSCRIPT=	${.CURDIR}/ldscript.i386
 LDFLAGS=	-Wl,-T${LDSCRIPT} -shared -symbolic
 
 ${PROG}:	${LDSCRIPT}
@@ -64,6 +64,13 @@ CFLAGS+=	-I${.CURDIR}/../libi386
 CFLAGS+=	-I${.CURDIR}/../btx/lib
 
 DPADD=		${LIBFICL} ${LIBEFI} ${LIBSTAND}
-LDADD=		${LIBFICL} ${LIBEFI} -lstand
+LDADD=		${LIBFICL} ${LIBEFI} ${LIBSTAND}
 
 .include <bsd.prog.mk>
+
+.if ${MACHINE_CPUARCH} == "amd64"
+CFLAGS+=        -I.
+beforedepend ${OBJS}: machine
+machine:
+	ln -sf ${.CURDIR}/../../../i386/include machine
+.endif



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