From: John Baldwin Date: Tue, 5 Sep 2017 02:34:48 +0000 (-0700) Subject: Define _KMEMUSER before including BSD kernel headers. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c49fbc6c79e0c479371e0ba7be0c8d1137016864;p=binutils-gdb.git Define _KMEMUSER before including BSD kernel headers. Recent versions of NetBSD hide certain kernel structures needed by the KVM target from userland unless this macro is defined. gdb/ChangeLog: * bsd-kvm.o: Define _KMEMUSER. * configure.ac: Define _KMEMUSER when checking for "struct lwp". * configure: Regenerate. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 74b5d8f8da1..0d86e4705e0 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2017-09-04 John Baldwin + + * bsd-kvm.o: Define _KMEMUSER. + * configure.ac: Define _KMEMUSER when checking for "struct lwp". + * configure: Regenerate. + 2017-09-04 John Baldwin * amd64-fbsd-nat.c: Add include of "x86-xstate.h". diff --git a/gdb/bsd-kvm.c b/gdb/bsd-kvm.c index 98e242836d9..8c2139462dc 100644 --- a/gdb/bsd-kvm.c +++ b/gdb/bsd-kvm.c @@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#define _KMEMUSER #include "defs.h" #include "cli/cli-cmds.h" #include "command.h" diff --git a/gdb/configure b/gdb/configure index 755e3dccf18..c7746fc60f6 100755 --- a/gdb/configure +++ b/gdb/configure @@ -13571,6 +13571,7 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include +#define _KMEMUSER #include int main () diff --git a/gdb/configure.ac b/gdb/configure.ac index 10d2d10b128..b4d7a87701f 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -1434,6 +1434,7 @@ AC_CHECK_MEMBERS([struct thread.td_pcb], [], [], # See if defines `struct lwp`. AC_CACHE_CHECK([for struct lwp], gdb_cv_struct_lwp, [AC_TRY_COMPILE([#include +#define _KMEMUSER #include ], [struct lwp l;], gdb_cv_struct_lwp=yes, gdb_cv_struct_lwp=no)]) if test $gdb_cv_struct_lwp = yes; then