summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2012-10-19 11:29:57 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2012-10-19 11:29:57 +0000
commit5f33ca72e5675cd08a24fcb228649c1a3ef7d74f (patch)
tree92cec885262b956597d9261fcf1855fc3ea0c3a1 /sys/arch
parent933743fbcb5b97f296b3b9f5762b551e1db1a7a3 (diff)
Link boot64 twice, first as a self-contained binary, to enforce there are no
unresolved symbols, then as a relocatable image as initially intended. This will prevent the arcbios.c 1.18 breakage from occuring again.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/sgi/stand/boot64/Makefile9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/arch/sgi/stand/boot64/Makefile b/sys/arch/sgi/stand/boot64/Makefile
index a1fe2430a8c..feff68fe4f7 100644
--- a/sys/arch/sgi/stand/boot64/Makefile
+++ b/sys/arch/sgi/stand/boot64/Makefile
@@ -1,6 +1,6 @@
-# $OpenBSD: Makefile,v 1.1 2009/05/14 18:57:43 miod Exp $
+# $OpenBSD: Makefile,v 1.2 2012/10/19 11:29:56 miod Exp $
-LDFLAGS+= ${SALDFLAGS} -r --oformat=elf64-tradbigmips -e __start
+LDFLAGS+= ${SALDFLAGS} --oformat=elf64-tradbigmips -e __start
STRIP= strip
INSTALL_STRIP=
@@ -9,8 +9,13 @@ PROG= boot64
.include "${.CURDIR}/../boot/Makefile"
${PROG}: $(OBJS) $(LDADD)
+ @# Link first as self-contained binary to enforce there are no
+ @# unresolved symbols
$(LD) $(LDFLAGS) -o ${PROG} $(OBJS) -L${LIBSADIR} ${LIBSA} \
-L${LIBZDIR} ${LIBZ}
+ @# then link as a relocatable binary
+ $(LD) $(LDFLAGS) -r -o ${PROG} $(OBJS) -L${LIBSADIR} ${LIBSA} \
+ -L${LIBZDIR} ${LIBZ}
$(STRIP) --strip-unneeded ${PROG}
LINKS= ${BINDIR}/${PROG} ${BINDIR}/boot-IP27