Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src for 64 bit mips platforms where we built userland largely as...



details:   https://anonhg.NetBSD.org/src/rev/3e30bed57f44
branches:  trunk
changeset: 819927:3e30bed57f44
user:      mrg <mrg%NetBSD.org@localhost>
date:      Fri Dec 23 10:19:57 2016 +0000

description:
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:

 compat/exec.mk           |  42 ++++++++++++++++++++++++++++++++++++++++++
 sbin/savecore/Makefile   |   4 +++-
 usr.bin/fstat/Makefile   |   4 +++-
 usr.bin/netstat/Makefile |   4 +++-
 usr.bin/pmap/Makefile    |   4 +++-
 usr.bin/systat/Makefile  |   4 +++-
 usr.sbin/crash/Makefile  |   4 +++-
 usr.sbin/kgmon/Makefile  |   4 +++-
 usr.sbin/pstat/Makefile  |   4 +++-
 usr.sbin/trpt/Makefile   |   4 +++-
 10 files changed, 69 insertions(+), 9 deletions(-)

diffs (192 lines):

diff -r ba25e9897a7a -r 3e30bed57f44 compat/exec.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/compat/exec.mk    Fri Dec 23 10:19:57 2016 +0000
@@ -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
diff -r ba25e9897a7a -r 3e30bed57f44 sbin/savecore/Makefile
--- a/sbin/savecore/Makefile    Fri Dec 23 09:36:55 2016 +0000
+++ b/sbin/savecore/Makefile    Fri Dec 23 10:19:57 2016 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.25 2001/06/13 23:16:27 wiz Exp $
+#      $NetBSD: Makefile,v 1.26 2016/12/23 10:19:57 mrg Exp $
 #      @(#)Makefile    8.2 (Berkeley) 4/17/94
 
 PROG=  savecore
@@ -9,4 +9,6 @@
 LDADD= -lkvm -lutil -lz
 DPADD= ${LIBKVM} ${LIBUTIL} ${LIBZ}
 
+.include "../../compat/exec.mk"
+
 .include <bsd.prog.mk>
diff -r ba25e9897a7a -r 3e30bed57f44 usr.bin/fstat/Makefile
--- a/usr.bin/fstat/Makefile    Fri Dec 23 09:36:55 2016 +0000
+++ b/usr.bin/fstat/Makefile    Fri Dec 23 10:19:57 2016 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.24 2016/01/23 16:12:03 christos Exp $
+#      $NetBSD: Makefile,v 1.25 2016/12/23 10:19:57 mrg Exp $
 #      from: @(#)Makefile      8.1 (Berkeley) 6/6/93
 
 .include <bsd.own.mk>
@@ -21,4 +21,6 @@
 LDADD+=-lutil
 DPADD+=${LIBUTIL}
 
+.include "../../compat/exec.mk"
+
 .include <bsd.prog.mk>
diff -r ba25e9897a7a -r 3e30bed57f44 usr.bin/netstat/Makefile
--- a/usr.bin/netstat/Makefile  Fri Dec 23 09:36:55 2016 +0000
+++ b/usr.bin/netstat/Makefile  Fri Dec 23 10:19:57 2016 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.43 2015/06/06 13:48:37 joerg Exp $
+#      $NetBSD: Makefile,v 1.44 2016/12/23 10:19:57 mrg Exp $
 #      from: @(#)Makefile      8.1 (Berkeley) 6/12/93
 
 .include <bsd.own.mk>
@@ -28,4 +28,6 @@
 CPPFLAGS+= -DINET6
 .endif
 
+.include "../../compat/exec.mk"
+
 .include <bsd.prog.mk>
diff -r ba25e9897a7a -r 3e30bed57f44 usr.bin/pmap/Makefile
--- a/usr.bin/pmap/Makefile     Fri Dec 23 09:36:55 2016 +0000
+++ b/usr.bin/pmap/Makefile     Fri Dec 23 10:19:57 2016 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.7 2016/01/23 21:22:49 christos Exp $
+#      $NetBSD: Makefile,v 1.8 2016/12/23 10:19:57 mrg Exp $
 
 USE_FORT?=     yes     # setgid
 PROG=          pmap
@@ -11,4 +11,6 @@
 CWARNFLAGS.clang+=     -Wno-format-extra-args
 CPPFLAGS+=     -D_KMEMUSER
 
+.include "../../compat/exec.mk"
+
 .include <bsd.prog.mk>
diff -r ba25e9897a7a -r 3e30bed57f44 usr.bin/systat/Makefile
--- a/usr.bin/systat/Makefile   Fri Dec 23 09:36:55 2016 +0000
+++ b/usr.bin/systat/Makefile   Fri Dec 23 10:19:57 2016 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.39 2016/08/02 15:56:09 scole Exp $
+#      $NetBSD: Makefile,v 1.40 2016/12/23 10:19:57 mrg Exp $
 #      @(#)Makefile    8.1 (Berkeley) 6/6/93
 
 .include <bsd.own.mk>
@@ -27,4 +27,6 @@
 SRCS+= ip6.c
 .endif
 
+.include "../../compat/exec.mk"
+
 .include <bsd.prog.mk>
diff -r ba25e9897a7a -r 3e30bed57f44 usr.sbin/crash/Makefile
--- a/usr.sbin/crash/Makefile   Fri Dec 23 09:36:55 2016 +0000
+++ b/usr.sbin/crash/Makefile   Fri Dec 23 10:19:57 2016 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.32 2016/12/10 10:42:43 mrg Exp $
+#      $NetBSD: Makefile,v 1.33 2016/12/23 10:19:57 mrg Exp $
 
 PROG=          crash
 MAN=           crash.8
@@ -97,5 +97,7 @@
 
 .endif                         # }
 
+.include "../../compat/exec.mk"
+
 .include <bsd.prog.mk>
 .include <bsd.klinks.mk>
diff -r ba25e9897a7a -r 3e30bed57f44 usr.sbin/kgmon/Makefile
--- a/usr.sbin/kgmon/Makefile   Fri Dec 23 09:36:55 2016 +0000
+++ b/usr.sbin/kgmon/Makefile   Fri Dec 23 10:19:57 2016 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.10 2009/04/22 15:23:04 lukem Exp $
+#      $NetBSD: Makefile,v 1.11 2016/12/23 10:19:57 mrg Exp $
 #      from: @(#)Makefile      8.1 (Berkeley) 6/6/93
 
 PROG=  kgmon
@@ -13,4 +13,6 @@
 #BINOWN=root
 #BINMODE=4555
 
+.include "../../compat/exec.mk"
+
 .include <bsd.prog.mk>
diff -r ba25e9897a7a -r 3e30bed57f44 usr.sbin/pstat/Makefile
--- a/usr.sbin/pstat/Makefile   Fri Dec 23 09:36:55 2016 +0000
+++ b/usr.sbin/pstat/Makefile   Fri Dec 23 10:19:57 2016 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.16 2013/01/02 10:43:11 dsl Exp $
+#      $NetBSD: Makefile,v 1.17 2016/12/23 10:19:57 mrg Exp $
 #      from: @(#)Makefile      8.1 (Berkeley) 6/6/93
 
 .include <bsd.own.mk>
@@ -19,4 +19,6 @@
 
 .PATH: ${NETBSDSRCDIR}/sbin/swapctl
 
+.include "../../compat/exec.mk"
+
 .include <bsd.prog.mk>
diff -r ba25e9897a7a -r 3e30bed57f44 usr.sbin/trpt/Makefile
--- a/usr.sbin/trpt/Makefile    Fri Dec 23 09:36:55 2016 +0000
+++ b/usr.sbin/trpt/Makefile    Fri Dec 23 10:19:57 2016 +0000
@@ -1,5 +1,5 @@
 #      @(#)Makefile    8.1 (Berkeley) 6/6/93
-#      $NetBSD: Makefile,v 1.10 2007/05/28 12:06:42 tls Exp $
+#      $NetBSD: Makefile,v 1.11 2016/12/23 10:19:58 mrg Exp $
 
 .include <bsd.own.mk>
 
@@ -15,4 +15,6 @@
 CPPFLAGS+=     -DINET6
 .endif
 
+.include "../../compat/exec.mk"
+
 .include <bsd.prog.mk>



Home | Main Index | Thread Index | Old Index