From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 118642 invoked by alias); 24 Nov 2016 12:12:49 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 118631 invoked by uid 89); 24 Nov 2016 12:12:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=baldwin, Baldwin, Johns, johns 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 ESMTP; Thu, 24 Nov 2016 12:12:48 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (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 1365731B336; Thu, 24 Nov 2016 12:12:47 +0000 (UTC) Received: from [127.0.0.1] (ovpn03.gateway.prod.ext.phx2.redhat.com [10.5.9.3]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uAOCCjYC018648; Thu, 24 Nov 2016 07:12:45 -0500 Subject: Re: gdb-7.12 powerpc-rtems4.12-gdb does not build on FreeBSD. To: John Baldwin , Chris Johns References: <5834D6E0.9060601@rtems.org> <1893490.1c09n3VfH9@ralph.baldwin.cx> <58363493.6010108@rtems.org> <2608815.dbYXHQl3xm@ralph.baldwin.cx> Cc: gdb@sourceware.org From: Pedro Alves Message-ID: <1ea845b2-d6bc-e9f7-d649-bc4f37462d92@redhat.com> Date: Thu, 24 Nov 2016 12:12:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <2608815.dbYXHQl3xm@ralph.baldwin.cx> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-11/txt/msg00045.txt.bz2 On 11/24/2016 02:46 AM, John Baldwin wrote: > On Thursday, November 24, 2016 11:30:11 AM Chris Johns wrote: >> On 24/11/2016 11:15, John Baldwin wrote: >>> On Thursday, November 24, 2016 10:16:10 AM Chris Johns wrote: >>>> On 23/11/2016 10:38, Chris Johns wrote: >>>>> Hi, >>>>> >>>>> I am getting: >>>>> >>>>> ../sim/ppc/libsim.a(sim_calls.o): In function `sim_io_printf_filtered': >>>>> ../../../gdb-7.12/sim/ppc/sim_calls.c:(.text+0x17c): undefined reference >>>>> to `error' >>>>> ../sim/ppc/libsim.a(sim_calls.o): In function `sim_load': >>>>> ../../../gdb-7.12/sim/ppc/sim_calls.c:(.text+0x291): undefined reference >>>>> to `error' >>>>> ../../../gdb-7.12/sim/ppc/sim_calls.c:(.text+0x31d): undefined reference >>>>> to `error' >>>>> ../../../gdb-7.12/sim/ppc/sim_calls.c:(.text+0x357): undefined reference >>>>> to `error' >>>>> ../sim/ppc/libsim.a(sim_calls.o): In function `sim_create_inferior': >>>>> ../../../gdb-7.12/sim/ppc/sim_calls.c:(.text+0x53e): undefined reference >>>>> to `error' >>>>> >>>>> and errors.o has the following symbols: >>>>> >>>>> nm >>>>> build/powerpc-rtems4.12-gdb-7.12-x86_64-freebsd10.3-1/build/gdb/errors.o >>>>> 0000000000000120 T _Z14internal_errorPKciS0_z >>>>> U _Z15internal_verrorPKciS0_P13__va_list_tag >>>>> 00000000000001a0 T _Z16internal_warningPKciS0_z >>>>> U _Z17internal_vwarningPKciS0_P13__va_list_tag >>>>> 0000000000000090 T _Z5errorPKcz >>>>> U _Z6verrorPKcP13__va_list_tag >>>>> 0000000000000000 T _Z7warningPKcz >>>>> U _Z8vwarningPKcP13__va_list_tag >>>>> >>>>> Is there a C++/C thing happening here between the PCC simulator and GDB? >>>>> >>>> >>>> A follow up. It looks like GDB is being built by cc which is clang on >>>> FreeBSD. I am told by Joel this gdb target builds on Linux. >>>> >>>> I do not know what the extern binding is for gdb, C or C++? >>> >>> clang vs gcc shouldn't really break this. >> >> Yes I agree. >> >>> What undefined symbols do you see >>> in the nm of sim_calls.o? >> >> The symbol is `error` and in my original post I showed the output of nm >> for the errors.o object file and `error` symbol is mangled. One thing >> that confuses me is only this symbol is being reported and there must be >> other calls to gdb. > > FYI, I reproduced this with gdb's master branch using > "configure --target powerpc-rtems4.12-elf" (albeit on FreeBSD 11, though > I have gcc48 installed as /usr/local/bin/gcc and configure found that and > used it instead of cc). The raw symbol in sim_calls.o is indeed plain C: > > % nm sim/ppc/sim_calls.o | grep error > U bfd_get_error > U error > 0000000000000a20 T sim_io_error > > Compiling gdb as C isn't an option on 'master', so it will need a different > fix. Probably the sims need to be built as C++ now. The PPC sim shouldn't be calling GDB's "error" directly. If it does, then that's should be fixed. There's an "error" method in the host_callback structure (filled in by GDB) that should be used instead. Thanks, Pedro Alves