From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 53222 invoked by alias); 1 Jun 2016 10:22:24 -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 53207 invoked by uid 89); 1 Jun 2016 10:22:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=our X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 01 Jun 2016 10:22:12 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 275878113A for ; Wed, 1 Jun 2016 10:22:11 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u51AM9MK011022; Wed, 1 Jun 2016 06:22:10 -0400 Subject: Re: RFA: Add xmalloc_failed() to common-utils.c To: Nick Clifton , gdb-patches@sourceware.org References: <87inxtgtc2.fsf@redhat.com> From: Pedro Alves Message-ID: <8180a7ba-a386-4cc2-aeb3-62aba14da5b1@redhat.com> Date: Wed, 01 Jun 2016 10:22:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <87inxtgtc2.fsf@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-06/txt/msg00012.txt.bz2 On 06/01/2016 10:18 AM, Nick Clifton wrote: > Hi Guys, > > I am finding that GDB currently fails to build because of a problem > with libiberty and multiple definitions of xmalloc. For example: > > % cd arm-eabi > % make all-gdb > [...] > ../libiberty/libiberty.a(xmalloc.o): In function `xmalloc': > libiberty/xmalloc.c:147: multiple definition of `xmalloc' > common-utils.o:/work/sources/gcc/current/gdb/common/common-utils.c:41: first defined here > [...] > > Which is strange because the xmalloc functions provided by > common-utils.c ought to be sufficient. I have traced this down to the > fact that libiberty's cplus-dem.o file includes an unresolved reference > to the xmalloc_failed() function. (I am not sure exactly how this > reference comes about however). Sounds like you're using a combined gcc+binutils-gdb build? Our libiberty copy is behind gcc's -- gcc's has a patch that added a reference to xmalloc_failed to cplus-dem.c: https://gcc.gnu.org/ml/gcc-patches/2016-04/msg00072.html So turns out you're preemptively fixing a problem for whoever merges libiberty next. > The fix for the problem is, I think, quite straightforward - provide a > copy of the xmalloc_failed function in common-utils.c. I have tested > this patch with a variety of different targets (x86, x86_64, arm, > msp430) and not found any problems or regressions. So... > > OK to apply ? OK. Thanks, Pedro Alves