From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 104797 invoked by alias); 11 Sep 2015 13:37:46 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 104785 invoked by uid 89); 11 Sep 2015 13:37:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Fri, 11 Sep 2015 13:37:45 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 22BDDADD0; Fri, 11 Sep 2015 13:37:42 +0000 (UTC) Date: Fri, 11 Sep 2015 13:44:00 -0000 From: Michael Matz To: David Malcolm cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH 04/22] Reimplement diagnostic_show_locus, introducing rich_location classes In-Reply-To: <1441916913-11547-5-git-send-email-dmalcolm@redhat.com> Message-ID: References: <1441916913-11547-1-git-send-email-dmalcolm@redhat.com> <1441916913-11547-5-git-send-email-dmalcolm@redhat.com> User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-IsSubscribed: yes X-SW-Source: 2015-09/txt/msg00797.txt.bz2 Hi, On Thu, 10 Sep 2015, David Malcolm wrote: > +/* FIXME: (dmalcolm) > + This plugin is currently the only user of > + gcc_rich_location::add_range_with_caption > + As such, the symbol is present in libbackend.a, but not in "cc1", > + and running the plugin fails with a linker error: > + ./diagnostic_plugin_test_show_locus.so: undefined symbol: _ZN17gcc_rich_location22add_range_with_captionEjjP18diagnostic_contextPKcz > + which c++filt tells us is: > + ./diagnostic_plugin_test_show_locus.so: undefined symbol: gcc_rich_location::add_range_with_caption(unsigned int, unsigned int, diagnostic_context*, char const*, ...) > + > + I've tried various workarounds (adding DEBUG_FUNCTION to the > + method, taking its address), but can't seem to fix it that way. > + So as a nasty workaround, the following material is copied&pasted > + from gcc-rich-location.c: */ You need to make cc1 use _anything_ defined in the source file gcc-rich-location.c. E.g. it could be some global internal variable: int _force_me_into_cc1_hack; which you then refer to in e.g. diagnostic-color.c (or from whereever). Ciao, Michael.