Fix PR PR16445 - gdbserver build failure on x86.
authorPedro Alves <palves@redhat.com>
Fri, 17 Jan 2014 13:33:30 +0000 (13:33 +0000)
committerPedro Alves <palves@redhat.com>
Fri, 17 Jan 2014 13:33:30 +0000 (13:33 +0000)
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 (linux-x86-low.c): Don't include elf/common.h if
ELFMAG0 is defined after including gdb_proc_service.h.

gdb/gdbserver/ChangeLog
gdb/gdbserver/linux-x86-low.c

index c387aa64ce6a6a9011a01ae024e0003f1b0fbba6..cbe90c7450ab4e90206195b63cf38cd8fa61b554 100644 (file)
@@ -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.
index 04fa3c9be2d238f78f1b639a78a60085cff025ea..e1daa7da7fe582ca62cd52fa66dcf68607cd9c1c 100644 (file)
 #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"
This page took 0.034107 seconds and 4 git commands to generate.