[dpdk-stable] [PATCH 18.11 3/4] crypto/octeontx: fix gcc 10 -fno-common build errors

Kevin Traynor ktraynor at redhat.com
Tue Jun 16 15:51:36 CEST 2020


gcc 10 defaults to -fno-common, this means a linker error will now be
reported if the same global variable is defined in more than one
compilation unit.

Fix this for cpt_logtype.

Signed-off-by: Kevin Traynor <ktraynor at redhat.com>
---
 drivers/common/cpt/cpt_pmd_logs.h       | 2 +-
 drivers/crypto/octeontx/otx_cryptodev.c | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/common/cpt/cpt_pmd_logs.h b/drivers/common/cpt/cpt_pmd_logs.h
index 4cbec4e36c..2681d12869 100644
--- a/drivers/common/cpt/cpt_pmd_logs.h
+++ b/drivers/common/cpt/cpt_pmd_logs.h
@@ -46,5 +46,5 @@
  * by otx_* driver routines during PCI probe.
  */
-int cpt_logtype;
+extern int cpt_logtype;
 
 #endif /* _CPT_PMD_LOGS_H_ */
diff --git a/drivers/crypto/octeontx/otx_cryptodev.c b/drivers/crypto/octeontx/otx_cryptodev.c
index d48fd1971c..d334fbfdd5 100644
--- a/drivers/crypto/octeontx/otx_cryptodev.c
+++ b/drivers/crypto/octeontx/otx_cryptodev.c
@@ -20,4 +20,6 @@ static int otx_cryptodev_logtype;
 uint8_t otx_cryptodev_driver_id;
 
+int cpt_logtype;
+
 static struct rte_pci_id pci_id_cpt_table[] = {
 	{
-- 
2.21.3



More information about the stable mailing list