summaryrefslogtreecommitdiff
path: root/sys/arch/sgi
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/sgi
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/sgi')
-rw-r--r--sys/arch/sgi/conf/Makefile.sgi40
1 files changed, 17 insertions, 23 deletions
diff --git a/sys/arch/sgi/conf/Makefile.sgi b/sys/arch/sgi/conf/Makefile.sgi
index 99b390159cd..c077d67d154 100644
--- a/sys/arch/sgi/conf/Makefile.sgi
+++ b/sys/arch/sgi/conf/Makefile.sgi
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.sgi,v 1.84 2017/06/13 16:40:01 deraadt Exp $
+# $OpenBSD: Makefile.sgi,v 1.85 2017/06/22 16:01:48 deraadt Exp $
# For instructions on building kernels consult the config(8) and options(4)
# manual pages.
@@ -98,12 +98,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
@@ -132,19 +126,23 @@ ioconf.o: ioconf.c
ld.script: ${_machdir}/conf/ld.script
cp ${_machdir}/conf/ld.script $@
+gapdummy.o:
+ echo 'const char gapdummy;' > gapdummy.c
+ ${CC} -c ${CFLAGS} ${CPPFLAGS} gapdummy.c -o $@
+
+makegap.sh: $S/conf/makegap.sh
+ cp $S/conf/makegap.sh $@
+
+gap.o: Makefile makegap.sh gapdummy.o
+ sh makegap.sh 0xefefefef gapdummy.o
+
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 $S/conf/makegap.sh
- umask 007; sh $S/conf/makegap.sh 0xef > 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
@@ -166,16 +164,12 @@ lcore_access.o lcore_ddb.o lcore_float.o locore.o: assym.h
tlb_tfp.o tlbhandler.o: assym.h
cache_tfp_subr.o ip30_nmi.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})