From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by dpdk.org (Postfix) with ESMTP id 6B9015A4C for ; Tue, 22 Mar 2016 23:35:51 +0100 (CET) Received: by mail-wm0-f52.google.com with SMTP id p65so1167378wmp.0 for ; Tue, 22 Mar 2016 15:35:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:organization:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=Q3Aqz2YKKLuRPxzXLwiF+vVi7W0+/LL3pttWQ0kw/jI=; b=Jl4BOSKmA9les08IrFbFZbcpgSW2whbebwbIFsjM9cr3o9sY/wFojOXu5zvWkpF5nF BIZKzcsla2aUsyPC/B0j1CU+kGXa5cADMzMXBtOfQ08zCO6TzLYBQpecs8kvz1Eu/pKs aPWtXtrPtjP/V9E3p8shpbLFksW1C9Q9qi1S8i74jCKf7fjltZ5t7ARR+tDCuyk/VCsK 44+m6db4jnwTxGlPqx/NadT/h6/DOEioxLaojkGPMEgMO0IGrXBojNnZDYWs5SdMh4O+ 0yVtA1YZQzf7Ho+oMN0Yc9HHe56pC3bhYhKZOrhlI+H4FNfvzSx6OfnXhVQRz+KwK+r4 xr3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding; bh=Q3Aqz2YKKLuRPxzXLwiF+vVi7W0+/LL3pttWQ0kw/jI=; b=WlkNKtb1dLUXJ2k8moHS8z6jNTV1Mvn+aDlnCfRsmMmHV8iZRM9iGfdwAB8cWgMlar HicybcNc0lsICJqStWhvKCGGSH6Y585+dIED6Ea3eZcyNVlzGAslz6hOoUYsf2TDUbo9 V+PBDO8JWI9WbB3izguM+SOmxcR751FfZ5+yhPCBcKVEWxbNExT0YZr1tv0Zb3++EYvC choHPEVbSwIqkSufeuaKlvurfWtk+JQZghVFtlny5Wi4AL89gtLBCXCpfw90/papCQSm fkKeCtalG89JpJu+mcMELg1BBcuPlKNI4dI5rnI+EOyTsc0teWP4YGOCmVmJCQyRURfw njjQ== X-Gm-Message-State: AD7BkJJXZ7vxieHeoa/8CqvPBFiH0S5Vu4LVHYlrP5IlwXM7UswlAKfg+a316JWuxcXFB8oc X-Received: by 10.28.153.135 with SMTP id b129mr23332018wme.3.1458686151162; Tue, 22 Mar 2016 15:35:51 -0700 (PDT) Received: from xps13.localnet (91.111.75.86.rev.sfr.net. [86.75.111.91]) by smtp.gmail.com with ESMTPSA id 198sm17289wml.22.2016.03.22.15.35.49 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 22 Mar 2016 15:35:50 -0700 (PDT) From: Thomas Monjalon To: Markos Chandras Cc: dev@dpdk.org Date: Tue, 22 Mar 2016 23:34:09 +0100 Message-ID: <2653966.ML0Fr8PsdQ@xps13> Organization: 6WIND User-Agent: KMail/4.14.10 (Linux/4.1.6-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <1458666816-29778-1-git-send-email-mchandras@suse.de> References: <1458666816-29778-1-git-send-email-mchandras@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] mk: toolchain: gcc: query the compiler macros to obtain the gcc version X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 22:35:51 -0000 2016-03-22 17:13, Markos Chandras: > This is similar to what's being used in the Linux kernel. Querying the > GCC macros directly gives more accurate results compared to -dumpversion > which could vary across distributions. > > Signed-off-by: Markos Chandras > --- > In openSUSE Tumbleweed (and in any other SUSE distribution which > uses (or will use) gcc >= 5), gcc -dumpversion returns '5'. This is on > purpose as discussed in https://bugzilla.opensuse.org/show_bug.cgi?id=941428 Good to know. It could be in the commit log. > As a result of which, the gcc-4.x comparison (40 against 5) does not > work leading to tons of warnings and failures during build. This patch > aims to change the way the gcc version is obtained by using the gcc macros > directly. Thanks for catching. > -GCC_VERSION = $(subst .,,$(shell $(CC) -dumpversion | cut -f1-2 -d.)) > +GCC_MAJOR = $(shell echo __GNUC__ | $(CC) -E -x c - | tail -n 1) > +GCC_MINOR = $(shell echo __GNUC_MINOR__ | $(CC) -E -x c - | tail -n 1) > +GCC_VERSION = $(GCC_MAJOR)$(GCC_MINOR) Are we sure the minor will always be only one digit?