This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RFA: Fix build regression on 32-bit hosts [Re: [RFA][PATCH v5 2/2] S/390: Add TDB regset]
- From: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- To: "'Jan Kratochvil'" <jan dot kratochvil at redhat dot com>, "'Ulrich Weigand'" <uweigand at de dot ibm dot com>
- Cc: "'Andreas Arnez'" <arnez at linux dot vnet dot ibm dot com>, <gdb-patches at sourceware dot org>
- Date: Sun, 15 Sep 2013 23:33:08 +0200
- Subject: RFA: Fix build regression on 32-bit hosts [Re: [RFA][PATCH v5 2/2] S/390: Add TDB regset]
- Authentication-results: sourceware.org; auth=none
- References: <87sixbfkb6 dot fsf at br87z6lw dot de dot ibm dot com> <201309131242 dot r8DCg0r9020703 at d06av02 dot portsmouth dot uk dot ibm dot com> <20130915155211 dot GA20499 at host2 dot jankratochvil dot net>
The patch below fixes the two build failure reports
due to last s390-tdep.c commit.
This is done by replacing system elf.h header inclusion
by use of GDB include/elf/common.h.
This fixes my bug report.
For Jan's problem of third parameter type,
I simply change hwcap local variable type to
CORE_ADDR as expected for target_auxv_search function.
As and extra bonus, when looking for AT_HWCAP,
I noticed that arm-linux-tdep.c had it's own definition
instead of using the one from elf/common.h.
(This could be split from that patch and submitted separately if
requested...)
Pierre Muller
It also
2013-09-15 Pierre Muller <muller@sourceware.org>
* arm-linux-tdep.c: Add "elf/common.h" header.
Remove AT_HWCAP macro definintion as it is provided in
added include file.
* s390-tdep.c: Remove system header <elf.h>
Add "elf/common.h" header for AT_HWCAP definition.
(s390_core_read_description): Use correct CORE_ADDR
for hwcap local variable used as third parameter
of function target_auxv_search.
Index: src/gdb/arm-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-linux-tdep.c,v
retrieving revision 1.96
diff -u -p -r1.96 arm-linux-tdep.c
--- src/gdb/arm-linux-tdep.c 22 Aug 2013 20:32:54 -0000 1.96
+++ src/gdb/arm-linux-tdep.c 15 Sep 2013 21:23:40 -0000
@@ -49,12 +49,9 @@
#include "parser-defs.h"
#include "user-regs.h"
#include <ctype.h>
-
+#include "elf/common.h"
#include "gdb_string.h"
-/* This is defined in <elf.h> on ARM GNU/Linux systems. */
-#define AT_HWCAP 16
-
extern int arm_apcs_32;
/* Under ARM GNU/Linux the traditional way of performing a breakpoint
Index: src/gdb/s390-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/s390-tdep.c,v
retrieving revision 1.215
diff -u -p -r1.215 s390-tdep.c
--- src/gdb/s390-tdep.c 13 Sep 2013 14:17:29 -0000 1.215
+++ src/gdb/s390-tdep.c 15 Sep 2013 21:23:43 -0000
@@ -52,7 +52,7 @@
#include "user-regs.h"
#include "cli/cli-utils.h"
#include <ctype.h>
-#include <elf.h>
+#include "elf/common.h"
#include "features/s390-linux32.c"
#include "features/s390-linux32v1.c"
@@ -807,7 +807,7 @@ s390_core_read_description (struct gdbar
asection *v1 = bfd_get_section_by_name (abfd, ".reg-s390-last-break");
asection *v2 = bfd_get_section_by_name (abfd, ".reg-s390-system-call");
asection *section = bfd_get_section_by_name (abfd, ".reg");
- unsigned long hwcap = 0;
+ CORE_ADDR hwcap = 0;
target_auxv_search (target, AT_HWCAP, &hwcap);
if (!section)