From: Maxim Ostapenko <m.ostapenko@partner.samsung.com>
To: gdb-patches@sourceware.org
Cc: palves@redhat.com, Slava Garbuzov <v.garbuzov@samsung.com>,
Yury Gribov <y.gribov@samsung.com>
Subject: [PATCH][PR gdb/17984] Fix GDB build fail on Aarch64 when -fno-common is enabled.
Date: Mon, 16 Feb 2015 17:25:00 -0000 [thread overview]
Message-ID: <54E219D5.1080702@partner.samsung.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 2070 bytes --]
Hi,
current trunk GDB (and gdb-7.8.1 too) fails to build on Aarch64 when
-fno-common is enabled with:
progspace.o skip.o probe.o common-utils.o buffer.o ptid.o gdb-dlfcn.o
common-agent.o format.o registry.o btrace.o record-btrace.o waitstatus.o
print-utils.o rsp-low.o errors.o common-debug.o debug.o
common-exceptions.o btrace-common.o compile.o compile-c-symbols.o
compile-c-types.o compile-object-load.o compile-object-run.o
compile-loc2c.o compile-c-support.o inflow.o init.o \
[ 190s] >------ ../readline/libreadline.a ../opcodes/libopcodes.a
../bfd/libbfd.a ../libiberty/libiberty.a
../libdecnumber/libdecnumber.a -ldl -ldl -lncurses -lm -ldl -lpthread
-ldl -lutil -lm -lpython2.7 -Xlinker -export-dynamic
/usr/lib64/libexpat.so ../libiberty/libiberty.a
build-gnulib/import/libgnu.a -ldl -Wl,--dynamic-list=./proc-service.list
[ 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
[ 199s] make[2]: Leaving directory
`/home/abuild/rpmbuild/BUILD/gdb-7.8.1/gdb'
[ 199s] make[1]: *** [all-gdb] Error 2
[ 199s] make[1]: Leaving directory `/home/abuild/rpmbuild/BUILD/gdb-7.8.1'
[ 199s] make: *** [all] Error 2
This happens because struct target_desc *tdesc_aarch64 is defined in
gdb/features/aarch64.c source file, that is included to some other files
(gdb/aarch64-linux-nat.c, for example). So, we have multiple definition
of `tdesc_aarch64' error during link stage.
This small patch resolves the issue, OK to commit?
-Maxim
[-- Attachment #2: gdb_fix-2.diff --]
[-- Type: text/x-patch, Size: 1143 bytes --]
gdb/Changelog
2015-02-16 Max Ostapenko <m.ostapenko@partner.samsung.com>
PR gdb/17984
* gdb/aarch64-linux-nat.c: Don't include features/aarch64.c anymore.
(aarch64_linux_read_description): Remove initialize_tdesc_aarch64 call.
* gdb/aarch64-tdep.h: Add struct target_desc *tdesc_aarch64
declaration.
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 */
next reply other threads:[~2015-02-16 17:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-16 17:25 Maxim Ostapenko [this message]
2015-02-16 22:50 ` Pedro Alves
2015-02-17 8:01 ` Maxim Ostapenko
2015-02-17 9:46 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54E219D5.1080702@partner.samsung.com \
--to=m.ostapenko@partner.samsung.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
--cc=v.garbuzov@samsung.com \
--cc=y.gribov@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox