From patchwork Fri Aug 10 10:09:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yvan Roux X-Patchwork-Id: 956182 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-483489-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="iqazEceC"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="WBNojksz"; dkim-atps=neutral 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 41n17t1tlvz9s4Z for ; Fri, 10 Aug 2018 20:09:43 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=liUDmOFU2bDA2bsXl4XLXJbou0GzbYjIrGlcufUBdfhMWH clUmuElAPWmCu8YiIpoaFJNnqqFkepurk0nzq9BYRB39XzWVTp456wACmVYiuEut li8G7stGfVWW3XYplAcwtaxUeUshCgfe0ZV63hR/rGeVCzvtSAxoaOoVw/H+k= 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 :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=6cEWNTIizDV84d/iSGPIY+geGVg=; b=iqazEceC1sDq3K3EKLoE EDNQbxBG+U9UgL4/pAjsUbKP0J4GIicUVD7CnDFivtmL+iDqqM8WPg77LZbn9Lvn F5dZxX86yUxZPAEhfq5QAA/JfWnT9v4iu+HZ2gQDKbXZKmalXWACT3C1KwQ78g1r Z8pcosFgvWfP7OnLsJwUpfs= Received: (qmail 123815 invoked by alias); 10 Aug 2018 10:09:36 -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 123802 invoked by uid 89); 10 Aug 2018 10:09:35 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS, TIME_LIMIT_EXCEEDED autolearn=unavailable version=3.3.2 spammy=BRANCH, withgnuld, with-gnu-ld, UD:cppbuiltin.c X-HELO: mail-io0-f170.google.com Received: from mail-io0-f170.google.com (HELO mail-io0-f170.google.com) (209.85.223.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 10 Aug 2018 10:09:25 +0000 Received: by mail-io0-f170.google.com with SMTP id l7-v6so3358872iok.6 for ; Fri, 10 Aug 2018 03:09:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:from:date:message-id:subject:to; bh=juxxfMwQAcx6JzXeWP5jKTl5+9CuOjocQ4YYQ+oBWhA=; b=WBNojksz22wXN3cjxIqZBNOHir6UtxrZmNQjoTo3to0KbY5K2u1I/S21l7FEiHvpKO 8Qr6SF38OXhls224rGyALnflzEoXE67iLpHye2HCZFjE+tHzOoy7HKCgJxNowGLgLnCy AhemZ89VabuWgrfTh4EtjMt9xEvk+fBjAyoyU= MIME-Version: 1.0 From: Yvan Roux Date: Fri, 10 Aug 2018 12:09:12 +0200 Message-ID: Subject: [arm-8-branch] Add Linaro version string and macros To: gcc-patches@gcc.gnu.org, Ramana Radhakrishnan X-IsSubscribed: yes Hi, This patch adds Linaro version string and release macros to ARM GCC 8 vendor branch. Ok to commit? Thanks Yvan gcc/ChangeLog 2018-08-10 Yvan Roux * LINARO-VERSION: New file. * configure.ac: Add Linaro version string. * configure: Regenerate. * Makefile.in (LINAROVER, LINAROVER_C, LINAROVER_S): Define. (CFLAGS-cppbuiltin.o): Add LINAROVER macro definition. (cppbuiltin.o): Depend on $(LINAROVER). * cppbuiltin.c (parse_linarover): New. (define_GNUC__): Define __LINARO_RELEASE__ and __LINARO_SPIN__ macros. Index: gcc/LINARO-VERSION =================================================================== --- gcc/LINARO-VERSION (nonexistent) +++ gcc/LINARO-VERSION (working copy) @@ -0,0 +1 @@ +8.2-2018.08~dev Index: gcc/Makefile.in =================================================================== --- gcc/Makefile.in (revision 263464) +++ gcc/Makefile.in (working copy) @@ -854,10 +854,12 @@ DEVPHASE := $(srcdir)/DEV-PHASE # experimental, prerelease, "" DATESTAMP := $(srcdir)/DATESTAMP # YYYYMMDD or empty REVISION := $(srcdir)/REVISION # [BRANCH revision XXXXXX] +LINAROVER := $(srcdir)/LINARO-VERSION # M.x-YYYY.MM[-S][~dev] BASEVER_c := $(shell cat $(BASEVER)) DEVPHASE_c := $(shell cat $(DEVPHASE)) DATESTAMP_c := $(shell cat $(DATESTAMP)) +LINAROVER_c := $(shell cat $(LINAROVER)) ifeq (,$(wildcard $(REVISION))) REVISION_c := @@ -884,6 +886,7 @@ "\"$(if $(DEVPHASE_c)$(filter-out 0,$(PATCHLEVEL_c)), $(DATESTAMP_c))\"" PKGVERSION_s:= "\"@PKGVERSION@\"" BUGURL_s := "\"@REPORT_BUGS_TO@\"" +LINAROVER_s := "\"$(LINAROVER_c)\"" PKGVERSION := @PKGVERSION@ BUGURL_TEXI := @REPORT_BUGS_TEXI@ @@ -2883,8 +2886,9 @@ -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \ @TARGET_SYSTEM_ROOT_DEFINE@ -CFLAGS-cppbuiltin.o += $(PREPROCESSOR_DEFINES) -DBASEVER=$(BASEVER_s) -cppbuiltin.o: $(BASEVER) +CFLAGS-cppbuiltin.o += $(PREPROCESSOR_DEFINES) -DBASEVER=$(BASEVER_s) \ + -DLINAROVER=$(LINAROVER_s) +cppbuiltin.o: $(BASEVER) $(LINAROVER) CFLAGS-cppdefault.o += $(PREPROCESSOR_DEFINES) Index: gcc/configure =================================================================== --- gcc/configure (revision 263464) +++ gcc/configure (working copy) @@ -1726,7 +1726,8 @@ --with-stabs arrange to use stabs instead of host debug format --with-dwarf2 force the default debug format to be DWARF 2 --with-specs=SPECS add SPECS to driver command-line processing - --with-pkgversion=PKG Use PKG in the version string in place of "GCC" + --with-pkgversion=PKG Use PKG in the version string in place of "Linaro + GCC `cat $srcdir/LINARO-VERSION`" --with-bugurl=URL Direct users to URL to report a bug --with-multilib-list select multilibs (AArch64, SH and x86-64 only) --with-gnu-ld assume the C compiler uses GNU ld default=no @@ -7649,7 +7650,7 @@ *) PKGVERSION="($withval) " ;; esac else - PKGVERSION="(GCC) " + PKGVERSION="(Linaro GCC `cat $srcdir/LINARO-VERSION`) " fi @@ -18448,7 +18449,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 18451 "configure" +#line 18452 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -18554,7 +18555,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 18557 "configure" +#line 18558 "configure" #include "confdefs.h" #if HAVE_DLFCN_H Index: gcc/configure.ac =================================================================== --- gcc/configure.ac (revision 263464) +++ gcc/configure.ac (working copy) @@ -929,7 +929,7 @@ ) AC_SUBST(CONFIGURE_SPECS) -ACX_PKGVERSION([GCC]) +ACX_PKGVERSION([Linaro GCC `cat $srcdir/LINARO-VERSION`]) ACX_BUGURL([https://gcc.gnu.org/bugs/]) # Sanity check enable_languages in case someone does not run the toplevel Index: gcc/cppbuiltin.c =================================================================== --- gcc/cppbuiltin.c (revision 263464) +++ gcc/cppbuiltin.c (working copy) @@ -53,18 +53,41 @@ *patchlevel = s_patchlevel; } +/* Parse a LINAROVER version string of the format "M.m-year.month[-spin][~dev]" + to create Linaro release number YYYYMM and spin version. */ +static void +parse_linarover (int *release, int *spin) +{ + static int s_year = -1, s_month, s_spin; + if (s_year == -1) + if (sscanf (LINAROVER, "%*[^-]-%d.%d-%d", &s_year, &s_month, &s_spin) != 3) + { + sscanf (LINAROVER, "%*[^-]-%d.%d", &s_year, &s_month); + s_spin = 0; + } + + if (release) + *release = s_year * 100 + s_month; + + if (spin) + *spin = s_spin; +} + /* Define __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__ and __VERSION__. */ static void define__GNUC__ (cpp_reader *pfile) { - int major, minor, patchlevel; + int major, minor, patchlevel, linaro_release, linaro_spin; parse_basever (&major, &minor, &patchlevel); + parse_linarover (&linaro_release, &linaro_spin); cpp_define_formatted (pfile, "__GNUC__=%d", major); cpp_define_formatted (pfile, "__GNUC_MINOR__=%d", minor); cpp_define_formatted (pfile, "__GNUC_PATCHLEVEL__=%d", patchlevel); cpp_define_formatted (pfile, "__VERSION__=\"%s\"", version_string); + cpp_define_formatted (pfile, "__LINARO_RELEASE__=%d", linaro_release); + cpp_define_formatted (pfile, "__LINARO_SPIN__=%d", linaro_spin); cpp_define_formatted (pfile, "__ATOMIC_RELAXED=%d", MEMMODEL_RELAXED); cpp_define_formatted (pfile, "__ATOMIC_SEQ_CST=%d", MEMMODEL_SEQ_CST); cpp_define_formatted (pfile, "__ATOMIC_ACQUIRE=%d", MEMMODEL_ACQUIRE);