From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22645 invoked by alias); 16 Feb 2015 17:25:06 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 22636 invoked by uid 89); 16 Feb 2015 17:25:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,T_MANY_HDRS_LCASE,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mailout3.w1.samsung.com Received: from mailout3.w1.samsung.com (HELO mailout3.w1.samsung.com) (210.118.77.13) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (DES-CBC3-SHA encrypted) ESMTPS; Mon, 16 Feb 2015 17:25:04 +0000 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NJV00FT4KKGRM90@mailout3.w1.samsung.com> for gdb-patches@sourceware.org; Mon, 16 Feb 2015 17:29:04 +0000 (GMT) Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id F6.D1.07834.B5722E45; Mon, 16 Feb 2015 17:22:35 +0000 (GMT) Received: from [106.109.130.26] by eusync2.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0NJV00CD0KDNIL50@eusync2.samsung.com>; Mon, 16 Feb 2015 17:25:00 +0000 (GMT) Message-id: <54E219D5.1080702@partner.samsung.com> Date: Mon, 16 Feb 2015 17:25:00 -0000 From: Maxim Ostapenko User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-version: 1.0 To: gdb-patches@sourceware.org Cc: palves@redhat.com, Slava Garbuzov , Yury Gribov Subject: [PATCH][PR gdb/17984] Fix GDB build fail on Aarch64 when -fno-common is enabled. Content-type: multipart/mixed; boundary=------------010307070904060000000500 X-SW-Source: 2015-02/txt/msg00364.txt.bz2 This is a multi-part message in MIME format. --------------010307070904060000000500 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 2070 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 --------------010307070904060000000500 Content-Type: text/x-patch; name="gdb_fix-2.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="gdb_fix-2.diff" Content-length: 1143 gdb/Changelog 2015-02-16 Max Ostapenko 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 */ --------------010307070904060000000500--