summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorKenji Aoyama <aoyama@cvs.openbsd.org>2017-07-20 12:07:55 +0000
committerKenji Aoyama <aoyama@cvs.openbsd.org>2017-07-20 12:07:55 +0000
commita56cb6e42be2dc6da7151923a5e2406ac47b6430 (patch)
treee4016a10040628bc658e4a160523fd8ffba57407 /sys
parentfbd4ac5642a06123b9d1dc599031fca593683edc (diff)
Kernel relinking for luna88k, first step.
Not yet split locore.S to locore.S and locore0.S. ok deraadt@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/luna88k/conf/Makefile.luna88k36
1 files changed, 22 insertions, 14 deletions
diff --git a/sys/arch/luna88k/conf/Makefile.luna88k b/sys/arch/luna88k/conf/Makefile.luna88k
index a4dc9aac14a..f0b776cc7a7 100644
--- a/sys/arch/luna88k/conf/Makefile.luna88k
+++ b/sys/arch/luna88k/conf/Makefile.luna88k
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.luna88k,v 1.72 2017/07/18 16:43:27 tb Exp $
+# $OpenBSD: Makefile.luna88k,v 1.73 2017/07/20 12:07:54 aoyama Exp $
# For instructions on building kernels consult the config(8) and options(4)
# manual pages.
@@ -31,9 +31,13 @@ CMACHFLAGS= -mno-check-zero-division -mmemcpy
CMACHFLAGS+= -fno-builtin-printf -fno-builtin-snprintf \
-fno-builtin-vsnprintf -fno-builtin-log \
-fno-builtin-log2 -fno-builtin-malloc
+SORTR= sort -R
.if ${IDENT:M-DNO_PROPOLICE}
CMACHFLAGS+= -fno-stack-protector
.endif
+.if ${IDENT:M-DSMALL_KERNEL}
+SORTR= cat
+.endif
DEBUG?= -g
COPTS?= -O2
@@ -71,13 +75,14 @@ PROFILE_C= ${CC} -S -c ${CFLAGS} ${CPPFLAGS} $<; \
# ${SYSTEM_LD_HEAD}
# ${SYSTEM_LD} swapxxx.o
# ${SYSTEM_LD_TAIL}
-SYSTEM_HEAD= locore.o param.o ioconf.o
-SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS}
+SYSTEM_HEAD= locore.o gap.o
+SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} param.o ioconf.o
SYSTEM_DEP= Makefile ${SYSTEM_OBJ} ld.script
SYSTEM_LD_HEAD= @rm -f $@
SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_HEAD} vers.o $${OBJS}'; \
umask 007; \
- ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_HEAD} vers.o ${OBJS}
+ echo ${OBJS} param.o ioconf.o vers.o | tr " " "\n" | ${SORTR} > lorder; \
+ ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_HEAD} `cat lorder`
SYSTEM_LD_TAIL= @${SIZE} $@
.if ${DEBUG} == "-g"
@@ -120,12 +125,19 @@ ioconf.o: ioconf.c
ld.script: ${_machdir}/conf/ld.script
cp ${_machdir}/conf/ld.script $@
+makegap.sh:
+ cp $S/conf/makegap.sh $@
+
+gap.o: Makefile makegap.sh
+ LD="${LD}" sh makegap.sh 0x00000000
+
vers.o: ${SYSTEM_DEP:Ngap.o}
sh $S/conf/newvers.sh
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
clean:
- rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* ${DB_STRUCTINFO} param.c
+ rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* ${DB_STRUCTINFO} \
+ gap.link ld.script lorder makegap.sh param.c
cleandir: clean
rm -f Makefile *.h ioconf.c options machine ${_mach} vers.c
@@ -140,16 +152,12 @@ db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.pl
locore.o: ${_machdir}/${_mach}/locore.S assym.h
eh.o mutex.o process.o subr.o: assym.h
-# The install target can be redefined by putting a
-# install-kernel-${MACHINE_NAME} target into /etc/mk.conf
-MACHINE_NAME!= uname -n
-install: install-kernel-${MACHINE_NAME}
-.if !target(install-kernel-${MACHINE_NAME}})
-install-kernel-${MACHINE_NAME}:
+newinstall:
cmp -s bsd /bsd || ln -f /bsd /obsd
- umask 077; cp bsd /nbsd
- mv /nbsd /bsd
-.endif
+ umask 077 && cp bsd /nbsd && mv /nbsd /bsd && \
+ sha256 -h /var/db/kernel.SHA256 /bsd
+
+install: update-link newinstall
# pull in the dependency information
.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO})