From 50b03f3b8eaf725c9e9b35f614c4a33f9623e29a Mon Sep 17 00:00:00 2001 From: Kevin Traynor Date: Fri, 8 May 2020 17:27:55 +0100 Subject: [PATCH] drivers/crypto: disable gcc 10 no-common errors gcc 10 defaults to -fno-common and as a result when linking with crypto drivers: drivers/librte_pmd_dpaa_sec.a(crypto_dpaa_sec_dpaa_sec.c.o): (.bss+0x4): multiple definition of `rta_sec_era'; drivers/librte_pmd_caam_jr.a(crypto_caam_jr_caam_jr.c.o): (.bss+0x0): first defined here drivers/librte_pmd_dpaa2_sec.a(crypto_dpaa2_sec_dpaa2_sec_dpseci.c.o): (.data+0x0): multiple definition of `rta_sec_era'; drivers/librte_pmd_caam_jr.a(crypto_caam_jr_caam_jr.c.o): (.bss+0x0): first defined here This is a blunt fix for the issue by enabling fcommon for dpaa_sec/dpaa2_sec/caam_jr. Bugzilla ID: 469 Cc: stable@dpdk.org Signed-off-by: Kevin Traynor Acked-by: Akhil Goyal --- drivers/crypto/caam_jr/Makefile | 7 +++++++ drivers/crypto/caam_jr/meson.build | 5 +++++ drivers/crypto/dpaa2_sec/Makefile | 7 +++++++ drivers/crypto/dpaa2_sec/meson.build | 5 +++++ drivers/crypto/dpaa_sec/Makefile | 7 +++++++ drivers/crypto/dpaa_sec/meson.build | 5 +++++ 6 files changed, 36 insertions(+) diff --git a/drivers/crypto/caam_jr/Makefile b/drivers/crypto/caam_jr/Makefile index 89d3238172..10848884cb 100644 --- a/drivers/crypto/caam_jr/Makefile +++ b/drivers/crypto/caam_jr/Makefile @@ -14,6 +14,13 @@ CFLAGS += -D _GNU_SOURCE CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) +# FIXME: temporary solution for Bugzilla 469 +ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) +ifeq ($(shell test $(GCC_VERSION) -ge 100 && echo 1), 1) +CFLAGS += -fcommon +endif +endif + CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax/caamflib/ diff --git a/drivers/crypto/caam_jr/meson.build b/drivers/crypto/caam_jr/meson.build index f8b5250a93..551b136322 100644 --- a/drivers/crypto/caam_jr/meson.build +++ b/drivers/crypto/caam_jr/meson.build @@ -12,6 +12,11 @@ sources = files('caam_jr_capabilities.c', 'caam_jr_uio.c', 'caam_jr.c') +# FIXME: temporary solution for Bugzilla 469 +if (toolchain == 'gcc' and cc.version().version_compare('>=10.0.0')) + cflags += '-fcommon' +endif + includes += include_directories('../../bus/dpaa/include/') includes += include_directories('../../common/dpaax/') includes += include_directories('../../common/dpaax/caamflib/') diff --git a/drivers/crypto/dpaa2_sec/Makefile b/drivers/crypto/dpaa2_sec/Makefile index a0a2795575..8ce637db60 100644 --- a/drivers/crypto/dpaa2_sec/Makefile +++ b/drivers/crypto/dpaa2_sec/Makefile @@ -19,6 +19,13 @@ CFLAGS += -Wno-implicit-fallthrough endif endif +# FIXME: temporary solution for Bugzilla 469 +ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) +ifeq ($(shell test $(GCC_VERSION) -ge 100 && echo 1), 1) +CFLAGS += -fcommon +endif +endif + CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax/caamflib CFLAGS += -I$(RTE_SDK)/drivers/crypto/dpaa2_sec/ diff --git a/drivers/crypto/dpaa2_sec/meson.build b/drivers/crypto/dpaa2_sec/meson.build index cb1c2d0492..505ad94146 100644 --- a/drivers/crypto/dpaa2_sec/meson.build +++ b/drivers/crypto/dpaa2_sec/meson.build @@ -10,4 +10,9 @@ deps += ['security', 'mempool_dpaa2'] sources = files('dpaa2_sec_dpseci.c', 'mc/dpseci.c') +# FIXME: temporary solution for Bugzilla 469 +if (toolchain == 'gcc' and cc.version().version_compare('>=10.0.0')) + cflags += '-fcommon' +endif + includes += include_directories('mc', '../../common/dpaax', '../../common/dpaax/caamflib') diff --git a/drivers/crypto/dpaa_sec/Makefile b/drivers/crypto/dpaa_sec/Makefile index ea266962a3..6cf392cb37 100644 --- a/drivers/crypto/dpaa_sec/Makefile +++ b/drivers/crypto/dpaa_sec/Makefile @@ -13,6 +13,13 @@ LIB = librte_pmd_dpaa_sec.a CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) +# FIXME: temporary solution for Bugzilla 469 +ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) +ifeq ($(shell test $(GCC_VERSION) -ge 100 && echo 1), 1) +CFLAGS += -fcommon +endif +endif + CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/base/qbman diff --git a/drivers/crypto/dpaa_sec/meson.build b/drivers/crypto/dpaa_sec/meson.build index 7d422d8d55..f5e6604575 100644 --- a/drivers/crypto/dpaa_sec/meson.build +++ b/drivers/crypto/dpaa_sec/meson.build @@ -9,6 +9,11 @@ endif deps += ['bus_dpaa', 'mempool_dpaa', 'security'] sources = files('dpaa_sec.c') +# FIXME: temporary solution for Bugzilla 469 +if (toolchain == 'gcc' and cc.version().version_compare('>=10.0.0')) + cflags += '-fcommon' +endif + includes += include_directories('../../bus/dpaa/include') includes += include_directories('../../common/dpaax') includes += include_directories('../../common/dpaax/caamflib/') -- 2.20.1