From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ob0-f170.google.com (mail-ob0-f170.google.com [209.85.214.170]) by dpdk.org (Postfix) with ESMTP id 57162ADB3 for ; Tue, 24 Feb 2015 11:59:10 +0100 (CET) Received: by mail-ob0-f170.google.com with SMTP id va2so42543183obc.1 for ; Tue, 24 Feb 2015 02:59:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=uxqdImN2Dt5RMGcxPbSXz9mWYvSqpZX1mg0hrrF3o4c=; b=GeXHx4PqX/sUQyj7pomKwfOmvWEHy6z/w2WNuR2CJ742xAnhDj6aufeDz+BWyMnc4g 1rG+M0adcO5xLoJcJzM6ipu+ilnLry3KUK3VqcB3cvhwO8jgJUrOPVCefI1TP9k4HN6L 2gF08mqXgBCtHS7yVLN+hbktdSXghnPbkeDnHRpFnulMZDLkImmKOiQGhP68M76gPHV+ nURZ+y05PIUM4IsOXwvr4uPyKe7xJnsBLcF9q215nCiIoXephShTdcg102v0Ta9DQU00 4ZP1lbCbSSsGzYqbfGJh2nHb72dVFixbbFErIL5BOWM5eWauGd/bgJINC2VwgHt2dUdD 2vMA== X-Gm-Message-State: ALoCoQnO5CUrB+uVJrR8X5udSEXxCkjKsBH/PISwW/6RXk9tHot8eZTUnNTnzKT7AH6pv9vtU61k MIME-Version: 1.0 X-Received: by 10.182.153.71 with SMTP id ve7mr10579187obb.76.1424775549877; Tue, 24 Feb 2015 02:59:09 -0800 (PST) Received: by 10.76.133.162 with HTTP; Tue, 24 Feb 2015 02:59:09 -0800 (PST) In-Reply-To: <7529e243896615deb7d93e6080dfd2aced92bf86.1424774816.git.pmatilai@redhat.com> References: <7529e243896615deb7d93e6080dfd2aced92bf86.1424774816.git.pmatilai@redhat.com> Date: Tue, 24 Feb 2015 11:59:09 +0100 Message-ID: From: David Marchand To: Panu Matilainen Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH] mk: Work around Debian/Ubuntu-specific 'gcc -dumpversion' output 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, 24 Feb 2015 10:59:10 -0000 Panu, ack (and works with my debian gcc). -- David Marchand On Tue, Feb 24, 2015 at 11:46 AM, Panu Matilainen wrote: > Commit 71f0ab1849b4fc3ca928deb566df12ca725ed150 broke compilation > on some versions of Debian and Ubuntu where gcc has been modified > to only emit MAJOR.MINOR part of the version from 'gcc -dumpversion'. > Drop the micro-version from gcc version comparisons to work around > this, it wasn't being used for anything anyway. > > Signed-off-by: Panu Matilainen > --- > lib/librte_pmd_fm10k/Makefile | 2 +- > lib/librte_pmd_i40e/Makefile | 2 +- > lib/librte_pmd_ixgbe/Makefile | 6 +++--- > lib/librte_pmd_vmxnet3/Makefile | 2 +- > mk/toolchain/gcc/rte.toolchain-compat.mk | 16 ++++++++-------- > 5 files changed, 14 insertions(+), 14 deletions(-) > > diff --git a/lib/librte_pmd_fm10k/Makefile b/lib/librte_pmd_fm10k/Makefile > index 2730b81..998bf23 100644 > --- a/lib/librte_pmd_fm10k/Makefile > +++ b/lib/librte_pmd_fm10k/Makefile > @@ -62,7 +62,7 @@ else > # > # CFLAGS for gcc > # > -ifeq ($(shell test $(GCC_VERSION) -ge 440 && echo 1), 1) > +ifeq ($(shell test $(GCC_VERSION) -ge 44 && echo 1), 1) > CFLAGS += -Wno-deprecated > endif > CFLAGS_BASE_DRIVER = -Wno-unused-parameter -Wno-unused-value > diff --git a/lib/librte_pmd_i40e/Makefile b/lib/librte_pmd_i40e/Makefile > index 484379a..64bab16 100644 > --- a/lib/librte_pmd_i40e/Makefile > +++ b/lib/librte_pmd_i40e/Makefile > @@ -69,7 +69,7 @@ CFLAGS_BASE_DRIVER += -Wno-pointer-to-int-cast > CFLAGS_BASE_DRIVER += -Wno-format-nonliteral > CFLAGS_BASE_DRIVER += -Wno-format-security > > -ifeq ($(shell test $(GCC_VERSION) -ge 440 && echo 1), 1) > +ifeq ($(shell test $(GCC_VERSION) -ge 44 && echo 1), 1) > CFLAGS_BASE_DRIVER += -Wno-unused-but-set-variable > endif > > diff --git a/lib/librte_pmd_ixgbe/Makefile b/lib/librte_pmd_ixgbe/Makefile > index ab56cbf..43870f7 100644 > --- a/lib/librte_pmd_ixgbe/Makefile > +++ b/lib/librte_pmd_ixgbe/Makefile > @@ -60,18 +60,18 @@ else > # > # CFLAGS for gcc > # > -ifeq ($(shell test $(GCC_VERSION) -ge 440 && echo 1), 1) > +ifeq ($(shell test $(GCC_VERSION) -ge 44 && echo 1), 1) > CFLAGS += -Wno-deprecated > endif > CFLAGS_BASE_DRIVER = -Wno-unused-parameter -Wno-unused-value > CFLAGS_BASE_DRIVER += -Wno-strict-aliasing -Wno-format-extra-args > > -ifeq ($(shell test $(GCC_VERSION) -ge 460 && echo 1), 1) > +ifeq ($(shell test $(GCC_VERSION) -ge 46 && echo 1), 1) > CFLAGS_ixgbe_common.o += -Wno-unused-but-set-variable > CFLAGS_ixgbe_x550.o += -Wno-unused-but-set-variable > -Wno-maybe-uninitialized > endif > > -ifeq ($(shell test $(GCC_VERSION) -le 460 && echo 1), 1) > +ifeq ($(shell test $(GCC_VERSION) -le 46 && echo 1), 1) > CFLAGS_ixgbe_x550.o += -Wno-uninitialized > CFLAGS_ixgbe_phy.o += -Wno-uninitialized > endif > diff --git a/lib/librte_pmd_vmxnet3/Makefile > b/lib/librte_pmd_vmxnet3/Makefile > index 9dda0a7..fc616c4 100644 > --- a/lib/librte_pmd_vmxnet3/Makefile > +++ b/lib/librte_pmd_vmxnet3/Makefile > @@ -56,7 +56,7 @@ else > # > # CFLAGS for gcc > # > -ifeq ($(shell test $(GCC_VERSION) -ge 440 && echo 1), 1) > +ifeq ($(shell test $(GCC_VERSION) -ge 44 && echo 1), 1) > CFLAGS += -Wno-deprecated > endif > CFLAGS_BASE_DRIVER = -Wno-unused-parameter -Wno-unused-value > diff --git a/mk/toolchain/gcc/rte.toolchain-compat.mk b/mk/toolchain/gcc/ > rte.toolchain-compat.mk > index a867559..05aa37f 100644 > --- a/mk/toolchain/gcc/rte.toolchain-compat.mk > +++ b/mk/toolchain/gcc/rte.toolchain-compat.mk > @@ -38,10 +38,10 @@ > > #find out GCC version > > -GCC_VERSION = $(subst .,,$(shell $(CC) -dumpversion)) > +GCC_VERSION = $(subst .,,$(shell $(CC) -dumpversion | cut -f1-2 -d.)) > > # if GCC is older than 4.x > -ifeq ($(shell test $(GCC_VERSION) -lt 400 && echo 1), 1) > +ifeq ($(shell test $(GCC_VERSION) -lt 40 && echo 1), 1) > MACHINE_CFLAGS = > $(warning You are using GCC < 4.x. This is neither supported, nor tested.) > > @@ -55,18 +55,18 @@ else > # GCC 4.6.x - added support for corei7, corei7-avx > # GCC 4.7.x - added support for fsgsbase, rdrnd, f16c, core-avx-i, > core-avx2 > > - ifeq ($(shell test $(GCC_VERSION) -le 470 && echo 1), 1) > + ifeq ($(shell test $(GCC_VERSION) -le 47 && echo 1), 1) > MACHINE_CFLAGS := $(patsubst > -march=core-avx-i,-march=corei7-avx,$(MACHINE_CFLAGS)) > MACHINE_CFLAGS := $(patsubst > -march=core-avx2,-march=core-avx2,$(MACHINE_CFLAGS)) > endif > - ifeq ($(shell test $(GCC_VERSION) -lt 460 && echo 1), 1) > + ifeq ($(shell test $(GCC_VERSION) -lt 46 && echo 1), 1) > MACHINE_CFLAGS := $(patsubst > -march=corei7-avx,-march=core2 -maes -mpclmul -mavx,$(MACHINE_CFLAGS)) > MACHINE_CFLAGS := $(patsubst -march=corei7,-march=core2 > -maes -mpclmul,$(MACHINE_CFLAGS)) > endif > - ifeq ($(shell test $(GCC_VERSION) -lt 450 && echo 1), 1) > + ifeq ($(shell test $(GCC_VERSION) -lt 45 && echo 1), 1) > MACHINE_CFLAGS := $(patsubst -march=atom,-march=core2 > -mssse3,$(MACHINE_CFLAGS)) > endif > - ifeq ($(shell test $(GCC_VERSION) -lt 440 && echo 1), 1) > + ifeq ($(shell test $(GCC_VERSION) -lt 44 && echo 1), 1) > MACHINE_CFLAGS := $(filter-out -mavx -mpclmul > -maes,$(MACHINE_CFLAGS)) > ifneq ($(findstring SSE4_2, $(CPUFLAGS)),) > MACHINE_CFLAGS += -msse4.2 > @@ -75,12 +75,12 @@ else > MACHINE_CFLAGS += -msse4.1 > endif > endif > - ifeq ($(shell test $(GCC_VERSION) -lt 430 && echo 1), 1) > + ifeq ($(shell test $(GCC_VERSION) -lt 43 && echo 1), 1) > MACHINE_CFLAGS := $(filter-out -msse% > -mssse%,$(MACHINE_CFLAGS)) > MACHINE_CFLAGS := $(patsubst > -march=core2,-march=generic,$(MACHINE_CFLAGS)) > MACHINE_CFLAGS += -msse3 > endif > - ifeq ($(shell test $(GCC_VERSION) -lt 420 && echo 1), 1) > + ifeq ($(shell test $(GCC_VERSION) -lt 42 && echo 1), 1) > MACHINE_CFLAGS := $(filter-out -march% -mtune% > -msse%,$(MACHINE_CFLAGS)) > endif > endif > -- > 2.1.0 > >