mk: fix build with Debian/Ubuntu-specific gcc version

Commit 71f0ab1849 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.

Fixes: 71f0ab1849 ("mk: rework gcc version detection to permit versions newer than 4.x")

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
Acked-by: David Marchand <david.marchand@6wind.com>
This commit is contained in:
Panu Matilainen 2015-02-24 12:46:56 +02:00 committed by Thomas Monjalon
parent a906cf28fd
commit 6eb85c0e44
5 changed files with 14 additions and 14 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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