summaryrefslogtreecommitdiff
path: root/sys/arch/i386/stand
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2012-10-29 14:39:09 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2012-10-29 14:39:09 +0000
commit195977c511b034e35b86bc779437bc0f4a1875ef (patch)
treeedd25b3aebf9e2810b56a4935557ad0a18512153 /sys/arch/i386/stand
parent76daa8ceb7a99abec94703094f7c18ef6c09aefc (diff)
Build i386 cdboot(8) and pxeboot(8) using the same method as the amd64
versions. Compile all required sources directly, rather than linking against uninstalled libraries. Discussed with deraadt@
Diffstat (limited to 'sys/arch/i386/stand')
-rw-r--r--sys/arch/i386/stand/cdboot/Makefile35
-rw-r--r--sys/arch/i386/stand/pxeboot/Makefile43
2 files changed, 60 insertions, 18 deletions
diff --git a/sys/arch/i386/stand/cdboot/Makefile b/sys/arch/i386/stand/cdboot/Makefile
index a15517d16ae..9cccf414b75 100644
--- a/sys/arch/i386/stand/cdboot/Makefile
+++ b/sys/arch/i386/stand/cdboot/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.12 2012/10/09 11:43:22 jsing Exp $
+# $OpenBSD: Makefile,v 1.13 2012/10/29 14:39:08 jsing Exp $
.include "${.CURDIR}/../Makefile.inc"
@@ -9,7 +9,7 @@ S =${.CURDIR}/../../../..
SADIR= ${.CURDIR}/..
PROG= cdboot
-SRCS= srt0.S
+SRCS= srt0.S boot.c conf.c
LD?= ld
SIZE?= size
LDFLAGS+=-nostdlib -Bstatic -Ttext $(LINKADDR) -N -x -nopie
@@ -17,14 +17,31 @@ INSTALL_STRIP=
CLEANFILES+= crt0.o ${PROG}.whole
-SRCS+= boot.c cmd.c vars.c bootarg.c conf.c
-LDADD= ${LIBSA} ${LIBZ}
-DPADD= ${LIBSA} ${LIBZ}
-
-.PATH: ${S}/lib/libkern/arch/i386 ${S}/lib/libkern
-SRCS+= strlcpy.c moddi3.c divdi3.c qdivrem.c
+.PATH: ${SADIR}/libsa
+SRCS+= alloca.S debug_i386.S gidt.S
+SRCS+= cmd_i386.c dev_i386.c exec_i386.c gateA20.c machdep.c
+SRCS+= apmprobe.c bioscons.c biosdev.c debug.c diskprobe.c memprobe.c \
+ pciprobe.c ps2probe.c time.c
.PATH: ${S}/stand/boot
+SRCS+= bootarg.c cmd.c vars.c
+
+.PATH: ${S}/lib/libsa
+SRCS+= alloc.c ctime.c exit.c memcmp.c memcpy.c memset.c printf.c snprintf.c \
+ strcmp.c strerror.c strlen.c strncmp.c strncpy.c strtol.c strtoll.c
+SRCS+= close.c closeall.c cons.c cread.c dev.c disklabel.c dkcksum.c fstat.c \
+ lseek.c open.c read.c readdir.c stat.c
+SRCS+= elf32.c elf64.c loadfile.c
+SRCS+= cd9660.c ufs.c
+
+.PATH: ${S}/lib/libkern/arch/i386
+SRCS+= moddi3.c divdi3.c qdivrem.c
+
+.PATH: ${S}/lib/libkern
+SRCS+= strlcpy.c
+
+.PATH: ${S}/lib/libz
+SRCS+= adler32.c crc32.c inflate.c inftrees.c
${PROG}: $(OBJS) $(DPADD)
$(LD) $(LDFLAGS) -o ${PROG} $(OBJS) $(LDADD)
@@ -44,6 +61,8 @@ NOPROG=
CPPFLAGS+=-DBOOTMAGIC=$(BOOTMAGIC) ${DEBUGFLAGS}
CPPFLAGS+=-DLINKADDR=${LINKADDR}
+CPPFLAGS+=-DSLOW -DSMALL -DNOBYFOUR -DNO_GZIP -DDYNAMIC_CRC_TABLE
+CPPFLAGS+=-I${S}/stand/boot
CFLAGS+=${SACFLAGS} -D__INTERNAL_LIBSA_CREAD
CFLAGS+=-DOSREV=\"${OSREV}\" -DMACHINE=\"${MACHINE}\"
CFLAGS+=-DKERNEL=\"/${OSREV}/${MACHINE}/bsd.rd\"
diff --git a/sys/arch/i386/stand/pxeboot/Makefile b/sys/arch/i386/stand/pxeboot/Makefile
index edf36d24369..0470fed4bcf 100644
--- a/sys/arch/i386/stand/pxeboot/Makefile
+++ b/sys/arch/i386/stand/pxeboot/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.9 2012/10/09 11:43:22 jsing Exp $
+# $OpenBSD: Makefile,v 1.10 2012/10/29 14:39:08 jsing Exp $
.include "${.CURDIR}/../Makefile.inc"
@@ -9,25 +9,45 @@ S =${.CURDIR}/../../../..
SADIR= ${.CURDIR}/..
PROG= pxeboot
+SRCS= srt0.S conf.c devopen.c net.c open.c
LD?= ld
SIZE?= size
LDFLAGS+=-nostdlib -Bstatic -Ttext $(LINKADDR) -N -x -nopie
INSTALL_STRIP=
CLEANFILES+= crt0.o ${PROG}.whole
-SRCS= srt0.S
-SRCS+= boot.c cmd.c vars.c bootarg.c conf.c devopen.c net.c open.c
-LDADD= ${LIBSA} ${LIBZ}
-DPADD= ${LIBSA} ${LIBZ}
-
-.PATH: ${S}/lib/libkern/arch/i386 ${S}/lib/libkern
-SRCS+= strlcpy.c moddi3.c divdi3.c qdivrem.c
+.PATH: ${SADIR}/libsa
+SRCS+= alloca.S debug_i386.S gidt.S
+SRCS+= cmd_i386.c exec_i386.c gateA20.c machdep.c
+SRCS+= apmprobe.c bioscons.c biosdev.c debug.c diskprobe.c memprobe.c \
+ pciprobe.c ps2probe.c time.c
+SRCS+= pxe_call.S pxe.c pxe_net.c
.PATH: ${S}/stand/boot
+SRCS+= boot.c cmd.c vars.c bootarg.c
+
+.PATH: ${S}/lib/libsa
+SRCS+= alloc.c ctime.c exit.c globals.c memcmp.c memcpy.c memset.c printf.c \
+ snprintf.c strcmp.c strerror.c strlen.c strncmp.c strncpy.c strtol.c \
+ strtoll.c
+SRCS+= close.c closeall.c cons.c cread.c dev.c disklabel.c dkcksum.c fstat.c \
+ lseek.c read.c readdir.c stat.c
+SRCS+= elf32.c elf64.c loadfile.c
+SRCS+= nfs.c ufs.c tftp.c
+SRCS+= bootp.c ether.c netif.c rpc.c
+
+.PATH: ${S}/lib/libkern/arch/i386
+SRCS+= moddi3.c divdi3.c qdivrem.c
+
+.PATH: ${S}/lib/libkern
+SRCS+= strlcpy.c
+
+.PATH: ${S}/lib/libz
+SRCS+= adler32.c crc32.c inflate.c inftrees.c
-${PROG}: $(OBJS) $(DPADD)
- $(LD) $(LDFLAGS) -o ${PROG} $(OBJS) $(LDADD)
+${PROG}: $(OBJS)
+ $(LD) $(LDFLAGS) -o ${PROG} $(OBJS)
@$(SIZE) ${PROG}
cp ${PROG} ${PROG}.whole
@if [ -x ${.OBJDIR}/${PROG} ]; then \
@@ -43,6 +63,9 @@ NOPROG=
.include <bsd.prog.mk>
CPPFLAGS+=-DBOOTMAGIC=$(BOOTMAGIC) ${DEBUGFLAGS} -DLINKADDR=${LINKADDR}
+CPPFLAGS+=-DSLOW -DSMALL -DNOBYFOUR -DNO_GZIP -DDYNAMIC_CRC_TABLE
+CPPFLAGS+=-DHEAP_LIMIT=${HEAP_LIMIT}
+CPPFLAGS+=-I${S}/stand/boot
CFLAGS+=$(SACFLAGS) -D__INTERNAL_LIBSA_CREAD -fno-pie
#AFLAGS+=-Wa,-R
# AFLAGS+=-Wa,-a