summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2017-06-22 16:01:49 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2017-06-22 16:01:49 +0000
commitfa18f6ca6b031524008b883b49f74acaa747c181 (patch)
tree501162ac6c02f29a9d3b25c2a06945726961b4d0 /sys/arch/i386
parent2877e53dabcef0c0e1b0d6bd80f594148bd8692c (diff)
Generate a gap.link script, and use that to generate gap.o. On multi-ABI
architectures we must also link against a gapdummy.o to repair the ABI of the resulting .o file. Woe is me. Also repair install: target to update the linkkit & hash when a kernel is installed. ok rpe tb mlarkin and tested by others also
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/conf/Makefile.i38636
1 files changed, 13 insertions, 23 deletions
diff --git a/sys/arch/i386/conf/Makefile.i386 b/sys/arch/i386/conf/Makefile.i386
index 7ec7d6cbaa3..9b2c40e4d42 100644
--- a/sys/arch/i386/conf/Makefile.i386
+++ b/sys/arch/i386/conf/Makefile.i386
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.i386,v 1.110 2017/06/13 16:40:01 deraadt Exp $
+# $OpenBSD: Makefile.i386,v 1.111 2017/06/22 16:01:48 deraadt Exp $
# For instructions on building kernels consult the config(8) and options(4)
# manual pages.
@@ -97,12 +97,6 @@ LINKFLAGS+= -S
%LOAD
-newbsd:
- ${SYSTEM_LD_HEAD}
- ${SYSTEM_LD} swapgeneric.o
- ${SYSTEM_LD_TAIL}
- mv -f newbsd bsd
-
# cc's -MD puts the source and output paths in the dependency file;
# since those are temp files here we need to fix it up. It also
# puts the file in /tmp, so we use -MF to put it in the current
@@ -131,19 +125,19 @@ ioconf.o: ioconf.c
ld.script: ${_machdir}/conf/ld.script
cp ${_machdir}/conf/ld.script $@
+makegap.sh: $S/conf/makegap.sh
+ cp $S/conf/makegap.sh $@
+
+gap.o: Makefile makegap.sh
+ sh makegap.sh 0xcccccccc
+
vers.o: ${SYSTEM_DEP:Ngap.o} ${SYSTEM_SWAP_DEP}
sh $S/conf/newvers.sh
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
-gap.S: ${SYSTEM_SWAP_DEP} Makefile
- umask 007; sh $S/conf/makegap.sh 0xcc > gap.S
-
-gap.o: gap.S
- umask 007; ${CC} ${AFLAGS} ${CPPFLAGS} ${PROF} -c gap.S
-
clean:
rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* ${DB_STRUCTINFO} \
- gap.S lorder param.c
+ gap.link ld.script lorder makegap.sh param.c
cleandir: clean
rm -f Makefile *.h ioconf.c options machine ${_mach} vers.c
@@ -159,16 +153,12 @@ locore0.o: ${_machdir}/${_mach}/locore0.S assym.h
locore.o mutex.o in_cksum.o mptramp.o: assym.h
kvm86call.o acpi_wakecode.o vmm_support.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})