Author: kevans
Date: Sat Mar  3 06:37:53 2018
New Revision: 330311
URL: https://svnweb.freebsd.org/changeset/base/330311

Log:
  stand: Make pc98 build
  
  This is a direct commit to stable/11 due to pc98 removal from head.
  
  Several improvements in head that were MFC'd left the pc98 build broken in
  stable/11. Massage the pc98 bits to get it to at least build.

Deleted:
  stable/11/stand/pc98/libpc98/time.c
Modified:
  stable/11/stand/pc98/Makefile
  stable/11/stand/pc98/Makefile.inc
  stable/11/stand/pc98/boot0.5/Makefile
  stable/11/stand/pc98/boot0/Makefile
  stable/11/stand/pc98/boot2/Makefile
  stable/11/stand/pc98/btx/btx/Makefile
  stable/11/stand/pc98/btx/btxldr/Makefile
  stable/11/stand/pc98/btx/lib/Makefile
  stable/11/stand/pc98/cdboot/Makefile
  stable/11/stand/pc98/kgzldr/Makefile
  stable/11/stand/pc98/libpc98/Makefile
  stable/11/stand/pc98/loader/Makefile
  stable/11/stand/pc98/loader/main.c
  stable/11/stand/pc98/pc98boot/Makefile

Modified: stable/11/stand/pc98/Makefile
==============================================================================
--- stable/11/stand/pc98/Makefile       Sat Mar  3 03:12:19 2018        
(r330310)
+++ stable/11/stand/pc98/Makefile       Sat Mar  3 06:37:53 2018        
(r330311)
@@ -1,5 +1,9 @@
 # $FreeBSD$
 
+NO_OBJ=t
+
+.include <bsd.init.mk>
+
 SUBDIR=                boot0 boot0.5 pc98boot btx boot2 cdboot kgzldr libpc98 
loader
 
 .include <bsd.subdir.mk>

Modified: stable/11/stand/pc98/Makefile.inc
==============================================================================
--- stable/11/stand/pc98/Makefile.inc   Sat Mar  3 03:12:19 2018        
(r330310)
+++ stable/11/stand/pc98/Makefile.inc   Sat Mar  3 06:37:53 2018        
(r330311)
@@ -2,28 +2,24 @@
 #
 # $FreeBSD$
 
-BINDIR?=       /boot
-
 LOADER_ADDRESS?=0x200000
-CFLAGS+=       -march=i386 -ffreestanding
-CFLAGS.gcc+=   -mpreferred-stack-boundary=2
-CFLAGS+=       ${CFLAGS_NO_SIMD} -msoft-float
-CFLAGS+=       -Os -DPC98
 LDFLAGS+=      -nostdlib
 
 # BTX components
-.if exists(${.OBJDIR}/../btx)
-BTXDIR=                ${.OBJDIR}/../btx
-.else
-BTXDIR=                ${.CURDIR}/../btx
-.endif
+BTXDIR=                ${BOOTOBJ}/pc98/btx
 BTXLDR=                ${BTXDIR}/btxldr/btxldr
 BTXKERN=       ${BTXDIR}/btx/btx
+
+BTXSRC=                ${BOOTSRC}/pc98/btx
 BTXCRT=                ${BTXDIR}/lib/crt0.o
 
 # compact binary with no padding between text, data, bss
-LDSCRIPT=      ${SRCTOP}/stand/i386/boot.ldscript
-LDFLAGS_BIN=-e start -Ttext ${ORG} -Wl,-T,${LDSCRIPT},-S,--oformat,binary
-LD_FLAGS_BIN=-static -T ${LDSCRIPT} --gc-sections
+LDSCRIPT=      ${BOOTSRC}/i386/boot.ldscript
+#LDFLAGS_BIN=-e start -Ttext ${ORG} -Wl,-T,${LDSCRIPT},-S,--oformat,binary
+LDFLAGS_BIN=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary
+#LD_FLAGS_BIN=-static -T ${LDSCRIPT} --gc-sections
+LD_FLAGS_BIN=-static -N --gc-sections
+
+WARNS?=                0
 
 .include "../Makefile.inc"

Modified: stable/11/stand/pc98/boot0.5/Makefile
==============================================================================
--- stable/11/stand/pc98/boot0.5/Makefile       Sat Mar  3 03:12:19 2018        
(r330310)
+++ stable/11/stand/pc98/boot0.5/Makefile       Sat Mar  3 06:37:53 2018        
(r330311)
@@ -3,10 +3,9 @@
 PROG=  ${BOOT}.out
 INTERNALPROG=
 FILES= ${BOOT}
-MAN=
 SRCS=  start.s boot.s boot0.5.s disk.s selector.s support.s syscons.s \
        putssjis.s
-CLEANFILES= ${BOOT} ${BOOT}.bin
+CLEANFILES+= ${BOOT} ${BOOT}.bin
 
 BOOT=  boot0.5
 
@@ -14,7 +13,7 @@ BOOT= boot0.5
 # unless you are glutton for punishment.
 BOOT_BOOT0_ORG?=       0x0000
 
-LDFLAGS=-e start -Ttext ${BOOT_BOOT0_ORG} -Wl,-N,-T,${.CURDIR}/ldscript
+LDFLAGS+=-e start -Ttext ${BOOT_BOOT0_ORG} -Wl,-N,-T,${.CURDIR}/ldscript
 
 # The size of boot0.5 must be 7168 bytes
 ${BOOT}: ${BOOT}.bin

Modified: stable/11/stand/pc98/boot0/Makefile
==============================================================================
--- stable/11/stand/pc98/boot0/Makefile Sat Mar  3 03:12:19 2018        
(r330310)
+++ stable/11/stand/pc98/boot0/Makefile Sat Mar  3 06:37:53 2018        
(r330311)
@@ -3,9 +3,8 @@
 PROG=  ${BOOT}
 INTERNALPROG=
 FILES= ${BOOT}
-MAN=
 SRCS=  ${BOOT}.s
-CLEANFILES= ${BOOT}
+CLEANFILES+= ${BOOT}
 
 BOOT=  boot0
 
@@ -14,6 +13,6 @@ BOOT= boot0
 BOOT_BOOT0_ORG?=       0x0000
 ORG=${BOOT_BOOT0_ORG}
 
-LDFLAGS=${LDFLAGS_BIN}
+LDFLAGS+=${LDFLAGS_BIN}
 
 .include <bsd.prog.mk>

Modified: stable/11/stand/pc98/boot2/Makefile
==============================================================================
--- stable/11/stand/pc98/boot2/Makefile Sat Mar  3 03:12:19 2018        
(r330310)
+++ stable/11/stand/pc98/boot2/Makefile Sat Mar  3 06:37:53 2018        
(r330311)
@@ -27,10 +27,11 @@ CFLAGS=     -fomit-frame-pointer \
        -DSIOPRT=${BOOT_COMCONSOLE_PORT} \
        -DSIOFMT=${B2SIOFMT} \
        -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \
-       -I${.CURDIR}/../../.. \
-       -I${.CURDIR}/../../i386/boot2 \
-       -I${.CURDIR}/../../common \
-       -I${.CURDIR}/../btx/lib -I. \
+       -I${LDRSRC} \
+       -I${SYSDIR} \
+       -I${BOOTSRC}/i386/boot2 \
+       -I${BOOTSRC}/common \
+       -I${BOOTSRC}/pc98/btx/lib \
        -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \
        -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
        -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \
@@ -52,14 +53,14 @@ CFLAGS.gcc+=   -mno-align-long-strings
 
 CFLAGS.clang+= -Oz ${CLANG_OPT_SMALL}
 
-LD_FLAGS=${LD_FLAGS_BIN}
+LD_FLAGS+=${LD_FLAGS_BIN}
 
 # Pick up ../Makefile.inc early.
 .include <bsd.init.mk>
 
-.PATH: ${.CURDIR}/../../i386/boot2
+.PATH: ${BOOTSRC}/i386/boot2
 
-CLEANFILES=    boot
+CLEANFILES+=   boot
 
 boot: boot1 boot2
        cat boot1 boot2 > boot
@@ -98,7 +99,7 @@ boot2.o: boot2.s
 
 SRCS=  boot2.c boot2.h
 
-boot2.s: boot2.c boot2.h ${.CURDIR}/../../common/ufsread.c
+boot2.s: boot2.c boot2.h
        ${CC} ${CFLAGS} -S -o boot2.s.tmp ${.CURDIR}/boot2.c
        sed -e '/align/d' -e '/nop/d' < boot2.s.tmp > boot2.s
        rm -f boot2.s.tmp

Modified: stable/11/stand/pc98/btx/btx/Makefile
==============================================================================
--- stable/11/stand/pc98/btx/btx/Makefile       Sat Mar  3 03:12:19 2018        
(r330310)
+++ stable/11/stand/pc98/btx/btx/Makefile       Sat Mar  3 06:37:53 2018        
(r330311)
@@ -1,8 +1,9 @@
 # $FreeBSD$
 
+.include <bsd.init.mk>
+
 PROG=  btx
 INTERNALPROG=
-MAN=
 SRCS=  btx.S
 
 .if defined(BOOT_BTX_NOHANG)
@@ -12,7 +13,7 @@ BOOT_BTX_FLAGS=0x0
 .endif
 
 CFLAGS+=-DBTX_FLAGS=${BOOT_BTX_FLAGS}
-CFLAGS+=-I${.CURDIR}/../../../i386/common
+CFLAGS+=-I${BOOTSRC}/i386/common
 
 .if defined(BTX_SERIAL)
 BOOT_COMCONSOLE_PORT?= 0x238
@@ -25,7 +26,7 @@ CFLAGS+=-DBTX_SERIAL -DSIOPRT=${BOOT_COMCONSOLE_PORT} 
 
 ORG=   0x9000
 
-LDFLAGS=${LDFLAGS_BIN}
+LDFLAGS+=${LDFLAGS_BIN}
 
 .include <bsd.prog.mk>
 

Modified: stable/11/stand/pc98/btx/btxldr/Makefile
==============================================================================
--- stable/11/stand/pc98/btx/btxldr/Makefile    Sat Mar  3 03:12:19 2018        
(r330310)
+++ stable/11/stand/pc98/btx/btxldr/Makefile    Sat Mar  3 06:37:53 2018        
(r330311)
@@ -1,19 +1,20 @@
 # $FreeBSD$
 
+.include <bsd.init.mk>
+
 PROG=  btxldr
 INTERNALPROG=
-MAN=
 SRCS=  btxldr.S
 
 CFLAGS+=-DLOADER_ADDRESS=${LOADER_ADDRESS}
-CFLAGS+=-I${.CURDIR}/../../../i386/common
+CFLAGS+=-I${BOOTSRC}/i386/common
 
 .if defined(BTXLDR_VERBOSE)
 CFLAGS+=-DBTXLDR_VERBOSE
 .endif
 
 ORG=${LOADER_ADDRESS}
-LDFLAGS=${LDFLAGS_BIN}
+LDFLAGS+=${LDFLAGS_BIN}
 
 .include <bsd.prog.mk>
 

Modified: stable/11/stand/pc98/btx/lib/Makefile
==============================================================================
--- stable/11/stand/pc98/btx/lib/Makefile       Sat Mar  3 03:12:19 2018        
(r330310)
+++ stable/11/stand/pc98/btx/lib/Makefile       Sat Mar  3 06:37:53 2018        
(r330311)
@@ -1,10 +1,11 @@
 # $FreeBSD$
 
+.include <bsd.init.mk>
+
 PROG=  crt0.o
 INTERNALPROG=
-MAN=
 SRCS=  btxcsu.S btxsys.s btxv86.s
-CFLAGS+=-I${.CURDIR}/../../../i386/common
-LDFLAGS=-Wl,-r
+CFLAGS+=-I${BOOTSRC}/i386/common
+LDFLAGS+=-Wl,-r
 
 .include <bsd.prog.mk>

Modified: stable/11/stand/pc98/cdboot/Makefile
==============================================================================
--- stable/11/stand/pc98/cdboot/Makefile        Sat Mar  3 03:12:19 2018        
(r330310)
+++ stable/11/stand/pc98/cdboot/Makefile        Sat Mar  3 06:37:53 2018        
(r330311)
@@ -1,16 +1,18 @@
 # $FreeBSD$
 
+.include <bsd.init.mk>
+
 PROG=  cdboot
 STRIP=
 BINMODE=${NOBINMODE}
 MAN=
 SRCS=  ${PROG}.S
 
-CFLAGS+=-I${.CURDIR}/../../i386/common
+CFLAGS+=-I${BOOTSRC}/i386/common
 
 ORG=   0x0000
 
-LDFLAGS=${LDFLAGS_BIN}
+LDFLAGS+=${LDFLAGS_BIN}
 
 .include <bsd.prog.mk>
 

Modified: stable/11/stand/pc98/kgzldr/Makefile
==============================================================================
--- stable/11/stand/pc98/kgzldr/Makefile        Sat Mar  3 03:12:19 2018        
(r330310)
+++ stable/11/stand/pc98/kgzldr/Makefile        Sat Mar  3 06:37:53 2018        
(r330311)
@@ -1,18 +1,19 @@
 # $FreeBSD$
 
+.include <bsd.init.mk>
+
 PROG=  kgzldr.o
 STRIP=
 BINMODE=${LIBMODE}
 BINDIR=        ${LIBDIR}
-MAN=
 
 SRCS=  start.s boot.c inflate.c lib.c crt.s sio.s
 CFLAGS=        -Os
 CFLAGS+=-DKZIP
 NO_SHARED=
-LDFLAGS=-Wl,-r
-.PATH: ${.CURDIR}/../../../kern
-.PATH: ${.CURDIR}/../../i386/kgzldr
+LDFLAGS+=-Wl,-r
+.PATH: ${SYSDIR}/kern
+.PATH: ${BOOTSRC}/i386/kgzldr
 
 BOOT_COMCONSOLE_PORT?= 0x238
 AFLAGS+=--defsym SIO_PRT=${BOOT_COMCONSOLE_PORT}

Modified: stable/11/stand/pc98/libpc98/Makefile
==============================================================================
--- stable/11/stand/pc98/libpc98/Makefile       Sat Mar  3 03:12:19 2018        
(r330310)
+++ stable/11/stand/pc98/libpc98/Makefile       Sat Mar  3 06:37:53 2018        
(r330311)
@@ -1,25 +1,20 @@
 # $FreeBSD$
 #
+
+.include <bsd.init.mk>
+
 LIB=                   pc98
-INTERNALLIB=
 
-.PATH: ${.CURDIR}/../../i386/libi386
+.PATH: ${BOOTSRC}/i386/libi386
 
 SRCS=  bioscd.c biosdisk.c biosmem.c biospnp.c \
        biospci.c biossmap.c bootinfo.c bootinfo32.c \
        comconsole.c devicename.c elf32_freebsd.c \
        i386_copy.c i386_module.c nullconsole.c pc98_sys.c pxe.c pxetramp.s \
        time.c vidconsole.c
-.PATH: ${.CURDIR}/../../zfs
+.PATH: ${BOOTSRC}/zfs
 SRCS+= devicename_stubs.c
 
-# Enable PXE TFTP or NFS support, not both.
-.if defined(LOADER_TFTP_SUPPORT)
-CFLAGS+=       -DLOADER_TFTP_SUPPORT
-.else
-CFLAGS+=       -DLOADER_NFS_SUPPORT
-.endif
-
 BOOT_COMCONSOLE_PORT?= 0x238
 CFLAGS+=       -DCOMPORT=${BOOT_COMCONSOLE_PORT}
 
@@ -37,13 +32,11 @@ CFLAGS+= -DTERM_EMU
 # XXX: make alloca() useable
 CFLAGS+= -Dalloca=__builtin_alloca
 
-CFLAGS+=       -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/i386 \
-               -I${.CURDIR}/../../common \
-               -I${.CURDIR}/../btx/lib \
-               -I${.CURDIR}/../../i386/libi386 \
-               -I${.CURDIR}/../../.. -I.
-# the location of libstand
-CFLAGS+=       -I${.CURDIR}/../../../../lib/libstand/
+CFLAGS+=       -I${BOOTSRC}/ficl -I${BOOTSRC}/ficl/i386 \
+               -I${LDRSRC} -I${BOOTSRC}/common \
+               -I${BOOTSRC}/pc98/btx/lib \
+               -I${BOOTSRC}/i386/libi386 \
+               -I${SYSDIR}
 
 # Handle FreeBSD specific %b and %D printf format specifiers
 CFLAGS+= ${FORMAT_EXTENSIONS}

Modified: stable/11/stand/pc98/loader/Makefile
==============================================================================
--- stable/11/stand/pc98/loader/Makefile        Sat Mar  3 03:12:19 2018        
(r330310)
+++ stable/11/stand/pc98/loader/Makefile        Sat Mar  3 06:37:53 2018        
(r330311)
@@ -1,26 +1,18 @@
 # $FreeBSD$
 
-.include <src.opts.mk>
-MK_SSP=                no
-MAN=
-
 LOADER?=       loader
 PROG=          ${LOADER}.sym
-INTERNALPROG=
 NEWVERSWHAT=   "bootstrap loader" pc98
-VERSION_FILE=  ${.CURDIR}/../../i386/loader/version
+VERSION_FILE=  ${BOOTSRC}/i386/loader/version
 
+LOADER_NET_SUPPORT=    yes
+
+.include <bsd.init.mk>
+
 # architecture-specific loader code
 SRCS=          main.c conf.c vers.c
-.PATH:         ${.CURDIR}/../../i386/loader
+.PATH:         ${BOOTSRC}/i386/loader
 
-# Enable PXE TFTP or NFS support, not both.
-.if defined(LOADER_TFTP_SUPPORT)
-CFLAGS+=       -DLOADER_TFTP_SUPPORT
-.else
-CFLAGS+=       -DLOADER_NFS_SUPPORT
-.endif
-
 # Include bcache code.
 HAVE_BCACHE=   yes
 
@@ -28,38 +20,19 @@ HAVE_BCACHE=        yes
 HAVE_PNP=      yes
 HAVE_ISABUS=   yes
 
-.if ${MK_FORTH} != "no"
-# Enable BootForth
-BOOT_FORTH=    yes
-CFLAGS+=       -DBOOT_FORTH -I${.CURDIR}/../../ficl 
-I${.CURDIR}/../../ficl/i386
-LIBFICL=       ${.OBJDIR}/../../ficl/libficl.a
-.endif
-
-.if defined(LOADER_BZIP2_SUPPORT)
-CFLAGS+=       -DLOADER_BZIP2_SUPPORT
-.endif
-.if !defined(LOADER_NO_GZIP_SUPPORT)
-CFLAGS+=       -DLOADER_GZIP_SUPPORT
-.endif
-
 # Always add MI sources
-.PATH:         ${.CURDIR}/../../common
-.include       "${.CURDIR}/../../common/Makefile.inc"
-CFLAGS+=       -I${.CURDIR}/../../common
-CFLAGS+=       -I${.CURDIR}/../../i386
-CFLAGS+=       -I.
+.include       "${BOOTSRC}/loader.mk"
 
-CLEANFILES=    ${LOADER} ${LOADER}.bin loader.help
+CLEANFILES+=   ${LOADER} ${LOADER}.bin loader.help
 
 CFLAGS+=       -Wall
-LDFLAGS=       -static -Ttext 0x0
+LDFLAGS+=      -static -Ttext 0x0
+CFLAGS+=       -I${BOOTSRC} -I${BOOTSRC}/i386
 
 # pc98 standalone support library
-LIBPC98=       ${.OBJDIR}/../libpc98/libpc98.a
-CFLAGS+=       -I${.CURDIR}/..
+LIBPC98=       ${BOOTOBJ}/pc98/libpc98/libpc98.a
+CFLAGS+=       -I${BOOTSRC}/pc98
 
-LIBSTAND=      ${.OBJDIR}/../../libstand32/libstand.a
-
 # BTX components
 CFLAGS+=       -I${.CURDIR}/../btx/lib
 
@@ -67,9 +40,6 @@ CFLAGS+=      -I${.CURDIR}/../btx/lib
 #CFLAGS+=      -g
 #LDFLAGS+=     -g
 
-# Pick up ../Makefile.inc early.
-.include <bsd.init.mk>
-
 ${LOADER}: ${LOADER}.bin ${BTXLDR} ${BTXKERN}
        btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \
                -b ${BTXKERN} ${LOADER}.bin
@@ -79,21 +49,16 @@ ${LOADER}.bin: ${LOADER}.sym
        strip -R .comment -R .note ${.TARGET}
 
 loader.help: help.common help.pc98
-       cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > 
${.TARGET}
+       cat ${.ALLSRC} | awk -f ${BOOTSRC}/common/merge_help.awk > ${.TARGET}
 
 FILES= ${LOADER}
 # XXX INSTALLFLAGS_loader= -b
 FILESMODE_${LOADER}= ${BINMODE} -b
 
-.PATH: ${.CURDIR}/../../forth
-.include       "${.CURDIR}/../../forth/Makefile.inc"
-
-FILES+=        ${.CURDIR}/../../i386/loader/loader.rc menu.rc
-
 # XXX crt0.o needs to be first for pxeboot(8) to work
 OBJS=  ${BTXCRT}
 
-DPADD= ${LIBFICL} ${LIBPC98} ${LIBSTAND}
-LDADD= ${LIBFICL} ${LIBPC98} ${LIBSTAND}
+DPADD= ${LDR_INTERP} ${LIBPC98} ${LIBSA}
+LDADD= ${LDR_INTERP} ${LIBPC98} ${LIBSA}
 
 .include <bsd.prog.mk>

Modified: stable/11/stand/pc98/loader/main.c
==============================================================================
--- stable/11/stand/pc98/loader/main.c  Sat Mar  3 03:12:19 2018        
(r330310)
+++ stable/11/stand/pc98/loader/main.c  Sat Mar  3 06:37:53 2018        
(r330311)
@@ -191,7 +191,7 @@ main(void)
     extract_currdev();                         /* set $currdev and $loaddev */
     setenv("LINES", "24", 1);                  /* optional */
 
-    interact(NULL);                    /* doesn't return */
+    interact();                        /* doesn't return */
 
     /* if we ever get here, it is an error */
     return (1);

Modified: stable/11/stand/pc98/pc98boot/Makefile
==============================================================================
--- stable/11/stand/pc98/pc98boot/Makefile      Sat Mar  3 03:12:19 2018        
(r330310)
+++ stable/11/stand/pc98/pc98boot/Makefile      Sat Mar  3 06:37:53 2018        
(r330311)
@@ -1,19 +1,21 @@
 # $FreeBSD$
 
+.include <bsd.init.mk>
+
 FILES= ${BOOT}
-CLEANFILES= ${BOOT} ${BOOT}.part
+CLEANFILES+= ${BOOT} ${BOOT}.part
 
 BOOT=  pc98boot
 
-.if exists(${.OBJDIR}/../boot0)
-BOOT0= ${.OBJDIR}/../boot0/boot0
+.if exists(${BOOTOBJ}/pc98/boot0)
+BOOT0= ${BOOTOBJ}/pc98/boot0/boot0
 .else
-BOOT0= ${.CURDIR}/../boot0/boot0
+BOOT0= ${BOOTSRC}/pc98/boot0/boot0
 .endif
-.if exists(${.OBJDIR}/../boot0.5)
-BOOT05=        ${.OBJDIR}/../boot0.5/boot0.5
+.if exists(${BOOTOBJ}/pc98/boot0.5)
+BOOT05=        ${BOOTOBJ}/pc98/boot0.5/boot0.5
 .else
-BOOT05=        ${.CURDIR}/../boot0.5/boot0.5
+BOOT05=        ${BOOTSRC}/pc98/boot0.5/boot0.5
 .endif
 
 ${BOOT}: ${BOOT0} ${BOOT05} ${BOOT}.part
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to