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: 143912 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3158531ljj; Fri, 10 Aug 2018 03:09:47 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxUUikJLeVH919d1KgpTOzWMoOjENHFTa/cpCUs96gJ2OSvXtCYLrVFu7i/KKznrhRzJM9z X-Received: by 2002:a63:4e25:: with SMTP id c37-v6mr5824070pgb.6.1533895787700; Fri, 10 Aug 2018 03:09:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533895787; cv=none; d=google.com; s=arc-20160816; b=aYYByA7A6wgsutFOPxAjFTyR5eEKigufmE+OBQGiTEHn9sQvxM5Vx5d6BVeFKoyHSZ bT4NmvKG9YwmIuaMavc1iDs+CcClTI/NJRZgN+Z0UlKKVoVI7gjhqvncBeP3kS9gDoWY km09AaEo0tYqVnbm6dL2kTlfpkUb4HOvlxfs4/03EoDyCr/Lbku+H//BJ30YCSAuMJpC JH/LZHhz1rQA2kDsg197iLhDOXjbTtPQro+6qbR9FebgJTxiKlI3xeJXSPhxYK4KKZ/W vavGvMVr8kCsFmf+Zx2MBnKEyOGl+0jiq0AZ5q2jficZNhHZZrWLZAmfWq5sjDFnpUnp CK3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:mime-version:dkim-signature :delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=pthU+Hlg/RV6Emwt9TmxG7XllEL5qrz7YazjCDGuzpo=; b=UlQogQBB1YFagAaDPbf6IxHbm2MaZnmtG1ltYXTHdefEZkXdaO/ixBRgByeukQ6u7H d7ujc0qk2cOWI2ppkJZGEE25iR/fJGsAXewycmlINrsu+d+oodaR9368r30jyobSmhCX H/NRFNUUWmt++CQbVtR9qCGWRwbGh0AAmIs8wHtvtKLmWVaQB9AjRy0Tyjl/U7NdAyK/ VxlaFi87hkrWN6rBGYqrJBUyVELn9dm44cBVAxX7T0nVCKB6sydf+R9ClXMdDhrxUz13 2hlrIgYYFSylmRbG5ivaRS/Hw4u26ZiR1tiGEwu1FFsEauKxiB56kz8BbhIOtanC2aEr MBqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="AQy/5Req"; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=WBNojksz; spf=pass (google.com: domain of gcc-patches-return-483489-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-483489-patch=linaro.org@gcc.gnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id q65-v6si9537345pga.283.2018.08.10.03.09.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 03:09:47 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-483489-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="AQy/5Req"; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=WBNojksz; spf=pass (google.com: domain of gcc-patches-return-483489-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-483489-patch=linaro.org@gcc.gnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=IJLQYSqQb2YwI68zGarGZnPujH0jvKN6NBo9Y8BtCGkMg9 edg41ctL/A9dMXghrORIlW7I2/4UisFg3kCaMo6hiFPoAkyevvOQp0Pg0Gjj2+6Z eqhiYTDbkp3CzlHlVtwqyy6EWCxBW+BR+tMcDzV4nmIbFh0NfwYiozJyam2I4= 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=AQy/5Req+NON/2CnxhG5 WQqHHZMVi4tTdkzB+1zkrsfSABa+jZxeO1s4q1E4duK4cnoJ7DSEUopWXhZvsYjg 1aXbvWhsDLDu2IaesFY7uf4WdMwibiELnP7qLBkznLrZcT/Vz8ves6J13SQmNJ8U e11O7tzdRQ1zrWfJV6IPpUY= 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);