This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [Patch] PR16445 - fix build of binutils-gdb
- From: Pedro Alves <palves at redhat dot com>
- To: Tobias Burnus <tobias dot burnus at physik dot fu-berlin dot de>
- Cc: binutils at sourceware dot org, GDB Patches <gdb-patches at sourceware dot org>
- Date: Fri, 17 Jan 2014 15:30:24 +0000
- Subject: Re: [Patch] PR16445 - fix build of binutils-gdb
- Authentication-results: sourceware.org; auth=none
- References: <20140117084701 dot GC7011 at physik dot fu-berlin dot de> <52D93CFF dot 2090006 at redhat dot com> <20140117150135 dot GA14724 at physik dot fu-berlin dot de>
On 01/17/2014 03:01 PM, Tobias Burnus wrote:
> On Fri, Jan 17, 2014 at 02:23:59PM +0000, Pedro Alves wrote:
>> Does this work for you?
>
> Yes - I have successfully built binutils-gdb with your patch
> into an empty directory.
Thanks. I've pushed this.
(and fixed ChangeLog afterwards...)
--------
Fix PR PR16445 - gdbserver build failure on x86.
If gdb_proc_service.h ends up including linux/elf.h, we'll trip on
duplicate definitions:
In file included from ../../../gdb/gdbserver/linux-x86-low.c:29:0:
../../../gdb/gdbserver/../../include/elf/common.h:36:0: error: "ELFMAG0"
redefined [-Werror]
... etc ...
Handle this the same way linux-low.c and linux-arm-low.c handle this.
gdb/gdbserver/
2014-01-17 Pedro Alves <palves@redhat.com>
PR PR16445
* linux-x86-low.c: Don't include elf/common.h if
ELFMAG0 is defined after including gdb_proc_service.h.
---
gdb/gdbserver/ChangeLog | 6 ++++++
gdb/gdbserver/linux-x86-low.c | 7 ++++++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index c387aa6..cbe90c7 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,9 @@
+2014-01-17 Pedro Alves <palves@redhat.com>
+
+ PR PR16445
+ * linux-x86-low.c (linux-x86-low.c): Don't include elf/common.h if
+ ELFMAG0 is defined after including gdb_proc_service.h.
+
2014-01-16 Doug Evans <dje@google.com>
* dll.c (UNSPECIFIED_CORE_ADDR): New macro.
diff --git a/gdb/gdbserver/linux-x86-low.c b/gdb/gdbserver/linux-x86-low.c
index 04fa3c9..e1daa7d 100644
--- a/gdb/gdbserver/linux-x86-low.c
+++ b/gdb/gdbserver/linux-x86-low.c
@@ -26,9 +26,14 @@
#include "i387-fp.h"
#include "i386-low.h"
#include "i386-xstate.h"
-#include "elf/common.h"
#include "gdb_proc_service.h"
+/* Don't include elf/common.h if linux/elf.h got included by
+ gdb_proc_service.h. */
+#ifndef ELFMAG0
+#include "elf/common.h"
+#endif
+
#include "agent.h"
#include "tdesc.h"
#include "tracepoint.h"
--
1.7.11.7