From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 41631 invoked by alias); 23 Apr 2015 11:42:16 -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 41616 invoked by uid 89); 23 Apr 2015 11:42:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 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; Thu, 23 Apr 2015 11:42:15 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 243C98E74D for ; Thu, 23 Apr 2015 11:42:14 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t3NBgCWl000989; Thu, 23 Apr 2015 07:42:13 -0400 Message-ID: <5538DA94.6080704@redhat.com> Date: Thu, 23 Apr 2015 11:42:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Jan Kratochvil , gdb-patches@sourceware.org CC: Phil Muldoon Subject: Re: [PATCH] compile: Use libcc1.so->libcc1.so.0 References: <20150421213616.14023.38329.stgit@host1.jankratochvil.net> In-Reply-To: <20150421213616.14023.38329.stgit@host1.jankratochvil.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-04/txt/msg00865.txt.bz2 On 04/21/2015 10:36 PM, Jan Kratochvil wrote: > (2) Currently GDB does only dlopen("libcc1.so") and then depending on which > libcc1.so version it would find first it would succeed/fail. > I guess it is more convenient to do dlopen("libcc1.so.1") instead > (where ".1"=".x" corresponds to GCC_FE_VERSION_x). > That is this patch (with x=0). I don't agree with tying the so version with GCC_FE_VERSION. The so version is supposed to indicate binary compatibility. And the ABI is maintained as long as the ABI of the single entry point -- gcc_c_fe_context -- is maintained. We can bump GCC_C_FE_VERSION_x leaving the .so version alone, and on the plugin/gcc side, add new functions at the end of the context vtable, keeping the vtable compatible with GCC_C_FE_VERSION_0: /* The type of the initialization function. The caller passes in the desired base version and desired C-specific version. If the request can be satisfied, a compatible gcc_context object will be ^^^^^^^^^^ returned. Otherwise, the function returns NULL. */ typedef struct gcc_c_context *gcc_c_fe_context_function (enum gcc_base_api_version, enum gcc_c_api_version); With that, an older gdb that requests GCC_FE_VERSION_0 should still work. A newer gdb that understands both v1 and v0 can first try GCC_FE_VERSION_1, and if that fails, try GCC_FE_VERSION_0, etc. It's that code that does the initialization/handshake on both ends (gdb/gcc) that should decide which versions each end supports. Doesn't have to be a single version. Thanks, Pedro Alves