summaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authormrg <mrg@NetBSD.org>2016-12-23 10:19:57 +0000
committermrg <mrg@NetBSD.org>2016-12-23 10:19:57 +0000
commit01a36c7d6d2a14fc530864e315a712cc139b8b43 (patch)
tree06be54f15829edd09e67d9a483b9bba521b05eae /compat
parent03fc4f5fc379a825e5969239ad5c6bcae4d671ee (diff)
for 64 bit mips platforms where we built userland largely as n32 by
default, build a handful of tools as n64 so they work properly. unfortunately, they're also static as dynamic n64 has a problem. of these tools pstat is probably the lowest hanging fruit to convert to sysctl. systat would be close were it not for the netstat screen, which includes netstat itself. the rest are difficult to perhaps foolish. the upside is that netstat, pmap and fstat all work properly now.
Diffstat (limited to 'compat')
-rw-r--r--compat/exec.mk42
1 files changed, 42 insertions, 0 deletions
diff --git a/compat/exec.mk b/compat/exec.mk
new file mode 100644
index 00000000000..2abcb3c3035
--- /dev/null
+++ b/compat/exec.mk
@@ -0,0 +1,42 @@
+# $NetBSD: exec.mk,v 1.1 2016/12/23 10:19:57 mrg Exp $
+
+# this makefile fragment can be included to modify the default
+# ABI a program is compiled with. this is designed to be used
+# by tools that must match the kernel image like savecore(8)
+# and kvm(3) using tools.
+
+# currently this file is used by these Makefiles:
+#
+# sbin/savecore/Makefile
+# usr.bin/fstat/Makefile
+# usr.bin/netstat/Makefile
+# usr.bin/pmap/Makefile
+# usr.bin/systat/Makefile
+# usr.sbin/crash/Makefile
+# usr.sbin/kgmon/Makefile
+# usr.sbin/pstat/Makefile
+# usr.sbin/trpt/Makefile
+#
+# of these, savecore, crash and kgmon are the only ones that
+# can be considered "not a bug". all the *stat tools should
+# be converted to use sysctl(3) on the running kernel, and
+# anyone who needs kvm-access on crash dumps can build their
+# own 64 bit version as necessary.
+
+# mips64 defaults to 32 bit userland, but with a 64 bit kernel
+# most kvm-using tools are happier with 64 bit.
+
+.if ${MACHINE_ARCH} == "mips64el" || ${MACHINE_ARCH} == "mips64eb"
+
+# XXX -pie makes n64 crash
+NOPIE=1
+# XXX interesting dynamic binaries crash (hello.c works.)
+LDSTATIC=-static
+
+. include <bsd.own.mk>
+
+. if ${MKCOMPAT} != "no" && !defined(RESCUEDIR)
+. include "${.PARSEDIR}/mips64/64/bsd.64.mk"
+. endif # ${MKCOMPAT} != "no"
+
+.endif # mips64