drivers/crypto: disable gcc 10 no-common errors
authorKevin Traynor <ktraynor@redhat.com>
Fri, 8 May 2020 16:27:55 +0000 (17:27 +0100)
committerAkhil Goyal <akhil.goyal@nxp.com>
Mon, 11 May 2020 11:17:43 +0000 (13:17 +0200)
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 <ktraynor@redhat.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
drivers/crypto/caam_jr/Makefile
drivers/crypto/caam_jr/meson.build
drivers/crypto/dpaa2_sec/Makefile
drivers/crypto/dpaa2_sec/meson.build
drivers/crypto/dpaa_sec/Makefile
drivers/crypto/dpaa_sec/meson.build

index 89d3238..1084888 100644 (file)
@@ -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/
index f8b5250..551b136 100644 (file)
@@ -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/')
index a0a2795..8ce637d 100644 (file)
@@ -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/
index cb1c2d0..505ad94 100644 (file)
@@ -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')
index ea26696..6cf392c 100644 (file)
@@ -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
index 7d422d8..f5e6604 100644 (file)
@@ -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/')