mk: fix build on arm64
[dpdk.git] / mk / toolchain / gcc / rte.toolchain-compat.mk
index dbddc98..35376da 100644 (file)
@@ -22,11 +22,20 @@ HOST_GCC_VERSION = $(HOST_GCC_MAJOR)$(HOST_GCC_MINOR)
 
 LD_VERSION = $(shell $(LD) -v)
 # disable AVX512F support for GCC & binutils 2.30 as a workaround for Bug 97
+ifeq ($(CONFIG_RTE_ARCH_X86), y)
 ifneq ($(filter 2.30%,$(LD_VERSION)),)
 FORCE_DISABLE_AVX512 := y
 # print warning only once for librte_eal
 ifneq ($(filter %librte_eal,$(CURDIR)),)
-$(warning AVX512 support disabled because of ld 2.30. See Bug 97)
+$(warning AVX512 support disabled because of binutils 2.30. See Bug 97)
+endif
+endif
+ifneq ($(filter 2.31%,$(LD_VERSION)),)
+FORCE_DISABLE_AVX512 := y
+# print warning only once for librte_eal
+ifneq ($(filter %librte_eal,$(CURDIR)),)
+$(warning AVX512 support disabled because of binutils 2.31. See Bug 249)
+endif
 endif
 endif
 
@@ -79,6 +88,10 @@ else
                MACHINE_CFLAGS := $(filter-out -march% -mtune% -msse%,$(MACHINE_CFLAGS))
        endif
 
+       ifeq ($(shell test $(GCC_VERSION) -lt 74 && echo 1), 1)
+               CONFIG_RTE_ENABLE_LTO=n
+       endif
+
        # Disable thunderx PMD for gcc < 4.7
        ifeq ($(shell test $(GCC_VERSION) -lt 47 && echo 1), 1)
                CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD=d
@@ -90,7 +103,7 @@ else
        endif
 
        # Disable octeontx event PMD for gcc < 4.8.6 & ARCH=arm64
-       ifeq ($(CONFIG_RTE_ARCH), arm64)
+       ifeq ($(RTE_ARCH), arm64)
        ifeq ($(shell test $(GCC_VERSION)$(GCC_PATCHLEVEL) -lt 486 && echo 1), 1)
                CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF=d
                CONFIG_RTE_LIBRTE_OCTEONTX_MEMPOOL=d