dloader: Build i386 version for the bios bootloader as libdloader32.a.
authorImre Vadász <imre@vdsz.com>
Tue, 8 Mar 2016 23:08:56 +0000 (00:08 +0100)
committerImre Vadász <imre@vdsz.com>
Wed, 9 Mar 2016 20:01:59 +0000 (21:01 +0100)
* sys/boot/pc32/loader and sys/boot/pc32/loader_tftp now link against
  libdloader32.a instead of libdloader.a.

* The libdloader.a from sys/boot/dloader is now built for x86_64.

sys/boot/Makefile
sys/boot/dloader/Makefile
sys/boot/dloader32/Makefile [new file with mode: 0644]
sys/boot/pc32/loader/Makefile
sys/boot/pc32/loader_tftp/Makefile

index 1a0eebd..f54c81f 100644 (file)
@@ -6,6 +6,7 @@ SUBDIR+=                dloader
 .if ${MACHINE_ARCH} == "x86_64"
 # Build i386 version of libstand
 SUBDIR+=               libstand32
+SUBDIR+=               dloader32
 .endif
 
 # Pick the machine-dependant subdir based on the target architecture.
index ba6bb0f..8f0efb2 100644 (file)
@@ -2,17 +2,17 @@
 #
 #
 
-.if ${MACHINE_ARCH} == "x86_64"
-.MAKEFLAGS:  MACHINE_ARCH=i386 MACHINE_PLATFORM=pc32 REALLY_X86_64=true
-.else
-.MAKEFLAGS:  REALLY_X86_64=false
-.endif
+SRCS=  subs.c config.c cmds.c
 
-.if exists(../${MACHINE_PLATFORM}/Makefile.inc)
-.include "../${MACHINE_PLATFORM}/Makefile.inc"
+# For i386, dloader32/Makefile takes care of the extra CFLAGS
+.if ${MACHINE_ARCH} != "i386"
+CFLAGS+=       -fPIC -mno-red-zone
+CFLAGS+=       -ffreestanding
 .endif
 
-SRCS=  subs.c config.c cmds.c
+.if ${MACHINE_ARCH} == "x86_64"
+CFLAGS+=       -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
+.endif
 
 .if HAVE_PNP
 CFLAGS+=       -DHAVE_PNP
@@ -28,7 +28,7 @@ rel_open.o: ../common/rel_open.c
 .include <bsd.prog.mk>
 .else
 OBJS+=         stack_protector.o
-LIB          dloader
+LIB?=          dloader
 INTERNALLIB=   yes
 
 stack_protector.o: ../../libkern/stack_protector.c
diff --git a/sys/boot/dloader32/Makefile b/sys/boot/dloader32/Makefile
new file mode 100644 (file)
index 0000000..9f0c29a
--- /dev/null
@@ -0,0 +1,13 @@
+.MAKEFLAGS:  MACHINE_ARCH=i386 MACHINE_PLATFORM=pc32 REALLY_X86_64=true
+
+.PATH: ${.CURDIR}/../dloader
+
+.if exists(../${MACHINE_PLATFORM}/Makefile.inc)
+.include "../${MACHINE_PLATFORM}/Makefile.inc"
+.endif
+
+LIB=   dloader32
+
+.include "../dloader/Makefile"
+
+CFLAGS+=       -I${.CURDIR}/../dloader
index 40fd734..062acb4 100644 (file)
@@ -27,10 +27,10 @@ HAVE_ISABUS=        yes
 
 BOOT_DLOADER=  yes
 CFLAGS+=       -I${.CURDIR}/../../dloader
-.if exists(${.OBJDIR}/../../dloader/libdloader.a)
-LIBDLOADER=    ${.OBJDIR}/../../dloader/libdloader.a
+.if exists(${.OBJDIR}/../../dloader32/libdloader32.a)
+LIBDLOADER=    ${.OBJDIR}/../../dloader32/libdloader32.a
 .else
-LIBDLOADER=    ${.CURDIR}/../../dloader/libdloader.a
+LIBDLOADER=    ${.CURDIR}/../../dloader32/libdloader32.a
 .endif
 
 .if defined(LOADER_BZIP2_SUPPORT)
index 7fd4c61..d511633 100644 (file)
@@ -27,10 +27,10 @@ HAVE_ISABUS=        yes
 
 BOOT_DLOADER=  yes
 CFLAGS+=       -I${.CURDIR}/../../dloader
-.if exists(${.OBJDIR}/../../dloader/libdloader.a)
-LIBDLOADER=    ${.OBJDIR}/../../dloader/libdloader.a
+.if exists(${.OBJDIR}/../../dloader32/libdloader32.a)
+LIBDLOADER=    ${.OBJDIR}/../../dloader32/libdloader32.a
 .else
-LIBDLOADER=    ${.CURDIR}/../../dloader/libdloader.a
+LIBDLOADER=    ${.CURDIR}/../../dloader32/libdloader32.a
 .endif
 
 .if defined(LOADER_BZIP2_SUPPORT)