From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Archive: List-Post: List-Help: Sender: gcc-patches-owner@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 20:38:00 -0000 Message-ID: <20150423203827.23973.72954.stgit@host1.jankratochvil.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-04/txt/msg01447.txt.bz2 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);