From patchwork Thu Apr 23 20:38:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kratochvil X-Patchwork-Id: 464048 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 174EF1400DE for ; Fri, 24 Apr 2015 06:38:39 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass reason="1024-bit key; unprotected key" header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=Zzcqt/ZX; dkim-adsp=none (unprotected policy); dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:from:to:cc:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=mQvRjK9NUh/ZJliK jHQAJt+MDBr9E2D7r4ncQSuYknx0P7B2pxrnQLBJyBVjCZo899DDOlcauEb3E4Wg shfb2NaFJr1wd5icLZbWHTHypAc2g6uMaufMTXqnWfXdC78eZVKR9+0+ecS2eAz3 WkMk/QTMwD8OT2UPcl4UiZ/Ujao= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:from:to:cc:date:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=eqeib5w07RdjaGMX3ah329 l7KbY=; b=Zzcqt/ZX76UIKdYEfW5SQFxbaZ1t7sERFJjvrEHxHL/PJJD1b0r8ol 5ypMrCCo+1oFC92+H4fWCgiSW2HWsqoaeuQQV3tq1WqEdhebcpvdAvxqmQjjom5z 6/m+JPh3iCj5atSiQy3qW2tRpheCQgJ2BMI6NfrJJBq2LVlKK70K8= Received: (qmail 68943 invoked by alias); 23 Apr 2015 20:38:31 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 68934 invoked by uid 89); 23 Apr 2015 20:38:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.8 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 20:38:30 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t3NKcTaa032752 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 23 Apr 2015 16:38:29 -0400 Received: from host1.jankratochvil.net (ovpn-116-27.ams2.redhat.com [10.36.116.27]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t3NKcRWX023615; Thu, 23 Apr 2015 16:38:28 -0400 Subject: [PATCH v2 1/4] libcc1: Introduce GCC_FE_VERSION_1 From: Jan Kratochvil To: gcc-patches@gcc.gnu.org Cc: Phil Muldoon Date: Thu, 23 Apr 2015 22:38:27 +0200 Message-ID: <20150423203827.23973.72954.stgit@host1.jankratochvil.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-IsSubscribed: yes Hi, in mail thread https://sourceware.org/ml/gdb-patches/2015-04/msg00804.html the idea of breaking libcc1.so compatibility was rejected. Therefore this patch series implements full backward/forward GCC/GDB ABI compatibility. Jan include/ChangeLog 2015-04-23 Jan Kratochvil * gcc-interface.h (enum gcc_base_api_version): Add GCC_FE_VERSION_1. libcc1/ChangeLog 2015-04-23 Jan Kratochvil * libcc1.cc (vtable): Update to GCC_FE_VERSION_1. (gcc_c_fe_context): Accept also GCC_FE_VERSION_1. --- include/gcc-interface.h | 3 ++- libcc1/libcc1.cc | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/gcc-interface.h b/include/gcc-interface.h index 34010f2..dcfa6ce 100644 --- a/include/gcc-interface.h +++ b/include/gcc-interface.h @@ -44,7 +44,8 @@ struct gcc_base_context; enum gcc_base_api_version { - GCC_FE_VERSION_0 = 0 + GCC_FE_VERSION_0 = 0, + GCC_FE_VERSION_1 = 1, }; /* The operations defined by the GCC base API. This is the vtable for diff --git a/libcc1/libcc1.cc b/libcc1/libcc1.cc index 7d7d2c1..99a0fa1 100644 --- a/libcc1/libcc1.cc +++ b/libcc1/libcc1.cc @@ -504,7 +504,7 @@ libcc1_destroy (struct gcc_base_context *s) static const struct gcc_base_vtable vtable = { - GCC_FE_VERSION_0, + GCC_FE_VERSION_1, libcc1_set_arguments, libcc1_set_source_file, libcc1_set_print_callback, @@ -523,7 +523,8 @@ struct gcc_c_context * gcc_c_fe_context (enum gcc_base_api_version base_version, enum gcc_c_api_version c_version) { - if (base_version != GCC_FE_VERSION_0 || c_version != GCC_C_FE_VERSION_0) + if ((base_version != GCC_FE_VERSION_0 && base_version != GCC_FE_VERSION_1) + || c_version != GCC_C_FE_VERSION_0) return NULL; return new libcc1 (&vtable, &c_vtable);