This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb/gdb-7.12-branch] [GDB] Fix builds broken by proc-service changes.
- From: Matthew Wahab <mwahab at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 15 Aug 2016 14:04:49 -0000
- Subject: [binutils-gdb/gdb-7.12-branch] [GDB] Fix builds broken by proc-service changes.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=2e9ffae9c70279ba7b226b9bf5f2f9b20968375c
commit 2e9ffae9c70279ba7b226b9bf5f2f9b20968375c
Author: Matthew Wahab <matthew.wahab@arm.com>
Date: Mon Aug 15 13:09:04 2016 +0100
[GDB] Fix builds broken by proc-service changes.
GLIBC BZ#20311 introduced a change to install proc_service.h so that gdb
didn't have to use the version it embeds in gdb_proc_service.h. The
embedded version is guarded by HAVE_PROC_SERVICE_H and
gdb_proc_service.h has a number other of includes and definitions, all
of which are uncondional except for an include for gregset.h. This is
only included if HAVE_PROC_SERIVCE_H is not defined.
This causes a build failure when cross compiling gdb with the latest
glibc because type definitions in gregset are used independently of
HAVE_PROC_SERIVCE_H. In particular, they are used in gdb_proc_service.h
when PRFPREGSET_T_BROKEN is set.
The error messages on the failure are
----
binutils-gdb/gdb/gdb_proc_service.h:173:9: error: â??gdb_fpregset_tâ?? does
not name a type; did you mean â??elf_fpregset_tâ???
typedef gdb_fpregset_t gdb_prfpregset_t;
^~~~~~~~~~~~~~
elf_fpregset_t
binutils-gdb/gdb/gdb_proc_service.h:173:9: error: â??gdb_fpregset_tâ?? does
not name a type; did you mean â??elf_fpregset_tâ???
typedef gdb_fpregset_t gdb_prfpregset_t;
^~~~~~~~~~~~~~
elf_fpregset_t
binutils-gdb/gdb/proc-service.c:218:15: error: â??gdb_prfpregset_tâ?? does
not name a type; did you mean â??gdb_fpregset_tâ???
const gdb_prfpregset_t *fpregset)
^~~~~~~~~~~~~~~~
gdb_fpregset_t
----
This patch moves the include for gregset.h to before the code guarded by
HAVE_PROC_SERIVCE_H, so that it is always included. This is enough to
fix the build.
2016-08-15 Matthew Wahab <matthew.wahab@arm.com>
PR gdb/20457
* gdb_proc_service.h: Add an include of gregset.h
[!HAVE_PROC_SERVICE_H]: Remove the include of gregset.h.
Diff:
---
gdb/ChangeLog | 6 ++++++
gdb/gdb_proc_service.h | 4 ++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d2438c9..ad3e36d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2016-08-15 Matthew Wahab <matthew.wahab@arm.com>
+
+ PR gdb/20457
+ * gdb_proc_service.h: Add an include of gregset.h
+ [!HAVE_PROC_SERVICE_H]: Remove the include of gregset.h.
+
2016-08-15 Yao Qi <yao.qi@linaro.org>
* location.c (explicit_location_lex_one): Compare the return
diff --git a/gdb/gdb_proc_service.h b/gdb/gdb_proc_service.h
index 04d3c03..38b98fc 100644
--- a/gdb/gdb_proc_service.h
+++ b/gdb/gdb_proc_service.h
@@ -21,6 +21,8 @@
#include <sys/types.h>
+#include "gregset.h"
+
#ifdef HAVE_PROC_SERVICE_H
/* glibc's proc_service.h doesn't wrap itself with extern "C". Need
@@ -60,8 +62,6 @@ EXTERN_C_POP
#include <sys/procfs.h>
#endif
-#include "gregset.h"
-
EXTERN_C_PUSH
/* Functions in this interface return one of these status codes. */