Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH][PR gdb/17984] Fix GDB build fail on Aarch64 when -fno-common is enabled.
@ 2015-02-16 17:25 Maxim Ostapenko
  2015-02-16 22:50 ` Pedro Alves
  0 siblings, 1 reply; 4+ messages in thread
From: Maxim Ostapenko @ 2015-02-16 17:25 UTC (permalink / raw)
  To: gdb-patches; +Cc: palves, Slava Garbuzov, Yury Gribov

[-- 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 */

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH][PR gdb/17984] Fix GDB build fail on Aarch64 when -fno-common is enabled.
  2015-02-16 17:25 [PATCH][PR gdb/17984] Fix GDB build fail on Aarch64 when -fno-common is enabled Maxim Ostapenko
@ 2015-02-16 22:50 ` Pedro Alves
  2015-02-17  8:01   ` Maxim Ostapenko
  0 siblings, 1 reply; 4+ messages in thread
From: Pedro Alves @ 2015-02-16 22:50 UTC (permalink / raw)
  To: Maxim Ostapenko, gdb-patches; +Cc: Slava Garbuzov, Yury Gribov

On 02/16/2015 04:24 PM, Maxim Ostapenko wrote:
> current trunk GDB (and gdb-7.8.1 too) fails to build on Aarch64 when 
> -fno-common is enabled with:
> This small patch resolves the issue, OK to commit?

Thanks.

> 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.

As this entry will be added to the gdb/ChangeLog file, the
"gdb/" path should be removed from the file names above.

Otherwise this is OK.  Thanks for doing this.

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH][PR gdb/17984] Fix GDB build fail on Aarch64 when -fno-common is enabled.
  2015-02-16 22:50 ` Pedro Alves
@ 2015-02-17  8:01   ` Maxim Ostapenko
  2015-02-17  9:46     ` Pedro Alves
  0 siblings, 1 reply; 4+ messages in thread
From: Maxim Ostapenko @ 2015-02-17  8:01 UTC (permalink / raw)
  To: Pedro Alves, gdb-patches; +Cc: Slava Garbuzov, Yury Gribov

[-- Attachment #1: Type: text/plain, Size: 148 bytes --]

Pedro,

thanks for review. I'm sorry, but I'm unable to commit the patch, I have 
no write access to GDB. Could you commit this one for me?

-Maxim

[-- Attachment #2: Fix-GDB-build-fail-on-Aarch64-when-fno-common-is-ena.diff --]
[-- Type: text/x-patch, Size: 1682 bytes --]

Fix GDB build fail on Aarch64 when -fno-common is enabled.

gdb/

	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: Add struct target_desc *tdesc_aarch64
	declaration.

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 0bd0792..d2352c9 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: Add struct target_desc *tdesc_aarch64
+	declaration.
+
 2015-02-13  Doug Evans  <dje@google.com>
 
 	* cp-namespace.c (cp_basic_lookup_symbol): Rename parameter
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 */
-- 
1.8.5.2.2930.gf745acb


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH][PR gdb/17984] Fix GDB build fail on Aarch64 when -fno-common is enabled.
  2015-02-17  8:01   ` Maxim Ostapenko
@ 2015-02-17  9:46     ` Pedro Alves
  0 siblings, 0 replies; 4+ messages in thread
From: Pedro Alves @ 2015-02-17  9:46 UTC (permalink / raw)
  To: Maxim Ostapenko, gdb-patches; +Cc: Slava Garbuzov, Yury Gribov

On 02/17/2015 08:00 AM, Maxim Ostapenko wrote:
> Pedro,
> 
> thanks for review. I'm sorry, but I'm unable to commit the patch, I have 
> no write access to GDB. Could you commit this one for me?

Done.  Thanks again.

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-02-17  9:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-16 17:25 [PATCH][PR gdb/17984] Fix GDB build fail on Aarch64 when -fno-common is enabled Maxim Ostapenko
2015-02-16 22:50 ` Pedro Alves
2015-02-17  8:01   ` Maxim Ostapenko
2015-02-17  9:46     ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox