aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Ostapenko <m.ostapenko@partner.samsung.com>2015-02-16 20:24:53 +0400
committerPedro Alves <palves@redhat.com>2015-02-17 09:10:49 +0000
commit9f2e07213aa91f1882112df3e0d227638b7a085b (patch)
tree9015fb4168f473f83d9027152894ad2595d13a05
parent2d9afefe223de983d6e86b5de9da0e5650057ac9 (diff)
downloadgdb-9f2e07213aa91f1882112df3e0d227638b7a085b.zip
gdb-9f2e07213aa91f1882112df3e0d227638b7a085b.tar.gz
gdb-9f2e07213aa91f1882112df3e0d227638b7a085b.tar.bz2
Fix GDB build fail on Aarch64 when -fno-common is enabled
Current trunk GDB (and gdb-7.8.1 too) fails to build on Aarch64 when -fno-common is enabled. It fails during link stage due to multiple definition of `tdesc_aarch64': ... [ 199s] aarch64-linux-nat.o: In function `initialize_tdesc_aarch64': [ 199s] /home/abuild/rpmbuild/BUILD/gdb-7.8.1/gdb/features/aarch64.c:11: multiple definition of `tdesc_aarch64' [ 199s] aarch64-tdep.o:/home/abuild/rpmbuild/BUILD/gdb-7.8.1/gdb/objfiles.h:540: first defined here [ 199s] aarch64-linux-nat.o: In function `initialize_tdesc_aarch64': [ 199s] /home/abuild/rpmbuild/BUILD/gdb-7.8.1/gdb/features/aarch64.c:11: multiple definition of `tdesc_aarch64' [ 199s] aarch64-tdep.o:/home/abuild/rpmbuild/BUILD/gdb-7.8.1/gdb/objfiles.h:540: first defined here [ 199s] collect2: error: ld returned 1 exit status [ 199s] make[2]: *** [gdb] Error 1 ... This happens because struct target_desc *tdesc_aarch64 is defined in gdb/features/aarch64.c, which is included by two files (gdb/aarch64-linux-nat.c and gdb/aarch64-tdep.c). gdb/Changelog 2015-02-17 Max Ostapenko <m.ostapenko@partner.samsung.com> PR gdb/17984 * aarch64-linux-nat.c: Don't include features/aarch64.c anymore. (aarch64_linux_read_description): Remove initialize_tdesc_aarch64 call. * aarch64-tdep.h (tdesc_aarch64): Declare.
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/aarch64-linux-nat.c3
-rw-r--r--gdb/aarch64-tdep.h2
3 files changed, 10 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 396fbd0..ba19905 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,11 @@
+2015-02-17 Max Ostapenko <m.ostapenko@partner.samsung.com>
+
+ PR gdb/17984
+ * aarch64-linux-nat.c: Don't include features/aarch64.c anymore.
+ (aarch64_linux_read_description): Remove initialize_tdesc_aarch64
+ call.
+ * aarch64-tdep.h (tdesc_aarch64): Declare.
+
2015-02-12 Mark Wielaard <mjw@redhat.com>
* contrib/ari/gdb_ari.sh: Remove checks for "true" and "false".
diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c
index c58f68a..aae4853 100644
--- a/gdb/aarch64-linux-nat.c
+++ b/gdb/aarch64-linux-nat.c
@@ -37,8 +37,6 @@
#include "gregset.h"
-#include "features/aarch64.c"
-
/* Defines ps_err_e, struct ps_prochandle. */
#include "gdb_proc_service.h"
@@ -830,7 +828,6 @@ aarch64_linux_child_post_startup_inferior (struct target_ops *self,
static const struct target_desc *
aarch64_linux_read_description (struct target_ops *ops)
{
- initialize_tdesc_aarch64 ();
return tdesc_aarch64;
}
diff --git a/gdb/aarch64-tdep.h b/gdb/aarch64-tdep.h
index 6a7794d..976ad32 100644
--- a/gdb/aarch64-tdep.h
+++ b/gdb/aarch64-tdep.h
@@ -90,4 +90,6 @@ struct gdbarch_tdep
struct type *vnb_type;
};
+extern struct target_desc *tdesc_aarch64;
+
#endif /* aarch64-tdep.h */