]> git.droids-corp.org - dpdk.git/commitdiff
drivers/crypto: fix build with -fno-common
authorAkhil Goyal <akhil.goyal@nxp.com>
Wed, 13 May 2020 11:50:26 +0000 (17:20 +0530)
committerAkhil Goyal <akhil.goyal@nxp.com>
Fri, 15 May 2020 17:43:17 +0000 (19:43 +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 patch fixes the blunt workaround in the following commit.

Fixes: 50b03f3b8eaf ("drivers/crypto: disable gcc 10 no-common errors")
Bugzilla ID: 469
Cc: stable@dpdk.org
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Tested-by: Kevin Traynor <ktraynor@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
13 files changed:
drivers/common/dpaax/Makefile
drivers/common/dpaax/caamflib.c [new file with mode: 0644]
drivers/common/dpaax/meson.build
drivers/common/dpaax/rte_common_dpaax_version.map
drivers/crypto/caam_jr/Makefile
drivers/crypto/caam_jr/caam_jr.c
drivers/crypto/caam_jr/meson.build
drivers/crypto/dpaa2_sec/Makefile
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
drivers/crypto/dpaa2_sec/meson.build
drivers/crypto/dpaa_sec/Makefile
drivers/crypto/dpaa_sec/dpaa_sec.c
drivers/crypto/dpaa_sec/meson.build

index 15b0b38d0dfb6f1a582ca3f8338269780b68d89a..2f4b924fda03df1370c7fd9b274c9adc14355752 100644 (file)
@@ -15,6 +15,7 @@ CFLAGS += -Wno-pointer-arith
 CFLAGS += -Wno-cast-qual
 
 CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax
+CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax/caamflib
 
 # versioning export map
 EXPORT_MAP := rte_common_dpaax_version.map
@@ -22,7 +23,7 @@ EXPORT_MAP := rte_common_dpaax_version.map
 #
 # all source are stored in SRCS-y
 #
-SRCS-y += dpaax_iova_table.c dpaa_of.c
+SRCS-y += dpaax_iova_table.c dpaa_of.c caamflib.c
 
 LDLIBS += -lrte_eal
 
diff --git a/drivers/common/dpaax/caamflib.c b/drivers/common/dpaax/caamflib.c
new file mode 100644 (file)
index 0000000..55e2028
--- /dev/null
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
+ *
+ * Copyright 2020 NXP
+ *
+ */
+
+#include <rta.h>
+
+/*
+ * SEC HW block revision.
+ *
+ * This *must not be confused with SEC version*:
+ * - SEC HW block revision format is "v"
+ * - SEC revision format is "x.y"
+ */
+enum rta_sec_era rta_sec_era;
index ff2d1a5071c153ece339513dc159f3530df26493..0b8bf7bd51c8809b930c6b8f2a3155fbaacb368b 100644 (file)
@@ -6,7 +6,9 @@ if not is_linux
        reason = 'only supported on linux'
 endif
 
-sources = files('dpaax_iova_table.c', 'dpaa_of.c')
+sources = files('dpaax_iova_table.c', 'dpaa_of.c', 'caamflib.c')
+
+includes += include_directories('caamflib')
 
 cflags += ['-D_GNU_SOURCE']
 if cc.has_argument('-Wno-cast-qual')
index f72eba761deb0dad5c9cf9934aace9c9e744d915..837ce01af3ebcdc7e74a4e881ef34dd65a52001d 100644 (file)
@@ -21,3 +21,7 @@ DPDK_20.0 {
 
        local: *;
 };
+
+INTERNAL {
+       rta_sec_era;
+};
index 10848884cb85b572da03c560b33ca4010548cd09..89d3238172185b9e22bb5b36e51c0227851ede69 100644 (file)
@@ -14,13 +14,6 @@ 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 5a29dd169d48c2371fc2e304239366c0caf62b39..45003ba25abf00467df04963fcd2bd51246897fe 100644 (file)
@@ -37,8 +37,6 @@
 static uint8_t cryptodev_driver_id;
 int caam_jr_logtype;
 
-enum rta_sec_era rta_sec_era;
-
 /* Lists the states possible for the SEC user space driver. */
 enum sec_driver_state_e {
        SEC_DRIVER_STATE_IDLE,          /* Driver not initialized */
index 551b13632206c3436e5d9f73031cf1b077beffc7..f8b5250a9392f9c9106149f96fb9d59fd48f40c4 100644 (file)
@@ -12,11 +12,6 @@ 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 8ce637db60554515b2f2bac43900292d94832fa7..a0a2795575a6ccfb53170613ad76c2aa3b611fbf 100644 (file)
@@ -19,13 +19,6 @@ 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 fe34e644cc98fd6331d1e9a974f79114bb3734b5..6459a025b40a6d60be8bfb03fb6dba0277dcf7d3 100644 (file)
@@ -56,8 +56,6 @@
 #define SEC_FLC_DHR_OUTBOUND   -114
 #define SEC_FLC_DHR_INBOUND    0
 
-enum rta_sec_era rta_sec_era = RTA_SEC_ERA_8;
-
 static uint8_t cryptodev_driver_id;
 
 int dpaa2_logtype_sec;
@@ -3870,6 +3868,8 @@ cryptodev_dpaa2_sec_probe(struct rte_dpaa2_driver *dpaa2_drv __rte_unused,
 
        if (dpaa2_svr_family == SVR_LX2160A)
                rta_set_sec_era(RTA_SEC_ERA_10);
+       else
+               rta_set_sec_era(RTA_SEC_ERA_8);
 
        DPAA2_SEC_INFO("2-SEC ERA is %d", rta_get_sec_era());
 
index 505ad9414690982c955293f9175465886237cb9a..cb1c2d049256b430786f85bb0b4e86f3df9b5323 100644 (file)
@@ -10,9 +10,4 @@ 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 6cf392cb3737e033c0a9c2a85b799df9ff22d847..ea266962a39550c42a1a6d441d5f9622cb0bd10b 100644 (file)
@@ -13,13 +13,6 @@ 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 25dcbd259a25ae99cc74bbea411648e8aeca1ec8..a9bfb8685e09bd146a6cdeba792f1a41e2eda31d 100644 (file)
@@ -43,8 +43,6 @@
 #include <dpaa_sec_log.h>
 #include <dpaax_iova_table.h>
 
-enum rta_sec_era rta_sec_era;
-
 int dpaa_logtype_sec;
 
 static uint8_t cryptodev_driver_id;
index f5e6604575118328234d36c1834b4b66e6b07286..7d422d8d5586d459ccf9d0af4e1160292a99ab22 100644 (file)
@@ -9,11 +9,6 @@ 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/')