drivers/crypto: fix gcc 10 fno-common errors

Message ID 20200508162755.7114-1-ktraynor@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series drivers/crypto: fix gcc 10 fno-common errors |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-nxp-Performance success Performance Testing PASS
ci/travis-robot warning Travis build: failed
ci/Intel-compilation success Compilation OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing fail Testing issues

Commit Message

Kevin Traynor May 8, 2020, 4:27 p.m. UTC
  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>

---
Reverting to fcommon for crypto so it can build cleanly for rc2 as per:
http://inbox.dpdk.org/dev/4010985e-6c80-2e82-dad2-73970f89b79e@intel.com/
---
 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(+)
  

Comments

Kevin Traynor May 8, 2020, 8:34 p.m. UTC | #1
https://travis-ci.com/ovsrobot/dpdk/builds/164784623
looks to be travis run issue

passing on my travis
https://travis-ci.org/github/kevuzaj/dpdk-master/builds/684814829


On 08/05/2020 17:27, Kevin Traynor wrote:
> 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>
> 
> ---
> Reverting to fcommon for crypto so it can build cleanly for rc2 as per:
> http://inbox.dpdk.org/dev/4010985e-6c80-2e82-dad2-73970f89b79e@intel.com/
> ---
>  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 89d323817..10848884c 100644
> --- a/drivers/crypto/caam_jr/Makefile
> +++ b/drivers/crypto/caam_jr/Makefile
> @@ -15,4 +15,11 @@ 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
> diff --git a/drivers/crypto/caam_jr/meson.build b/drivers/crypto/caam_jr/meson.build
> index f8b5250a9..551b13632 100644
> --- a/drivers/crypto/caam_jr/meson.build
> +++ b/drivers/crypto/caam_jr/meson.build
> @@ -13,4 +13,9 @@ sources = files('caam_jr_capabilities.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/')
> diff --git a/drivers/crypto/dpaa2_sec/Makefile b/drivers/crypto/dpaa2_sec/Makefile
> index a0a279557..8ce637db6 100644
> --- a/drivers/crypto/dpaa2_sec/Makefile
> +++ b/drivers/crypto/dpaa2_sec/Makefile
> @@ -20,4 +20,11 @@ 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
> diff --git a/drivers/crypto/dpaa2_sec/meson.build b/drivers/crypto/dpaa2_sec/meson.build
> index cb1c2d049..505ad9414 100644
> --- a/drivers/crypto/dpaa2_sec/meson.build
> +++ b/drivers/crypto/dpaa2_sec/meson.build
> @@ -11,3 +11,8 @@ 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 ea266962a..6cf392cb3 100644
> --- a/drivers/crypto/dpaa_sec/Makefile
> +++ b/drivers/crypto/dpaa_sec/Makefile
> @@ -14,4 +14,11 @@ 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
> diff --git a/drivers/crypto/dpaa_sec/meson.build b/drivers/crypto/dpaa_sec/meson.build
> index 7d422d8d5..f5e660457 100644
> --- a/drivers/crypto/dpaa_sec/meson.build
> +++ b/drivers/crypto/dpaa_sec/meson.build
> @@ -10,4 +10,9 @@ 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')
>
  
Akhil Goyal May 11, 2020, 8:26 a.m. UTC | #2
> 
> 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>

Applied to dpdk-next-crypto

Thanks.
  

Patch

diff --git a/drivers/crypto/caam_jr/Makefile b/drivers/crypto/caam_jr/Makefile
index 89d323817..10848884c 100644
--- a/drivers/crypto/caam_jr/Makefile
+++ b/drivers/crypto/caam_jr/Makefile
@@ -15,4 +15,11 @@  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
diff --git a/drivers/crypto/caam_jr/meson.build b/drivers/crypto/caam_jr/meson.build
index f8b5250a9..551b13632 100644
--- a/drivers/crypto/caam_jr/meson.build
+++ b/drivers/crypto/caam_jr/meson.build
@@ -13,4 +13,9 @@  sources = files('caam_jr_capabilities.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/')
diff --git a/drivers/crypto/dpaa2_sec/Makefile b/drivers/crypto/dpaa2_sec/Makefile
index a0a279557..8ce637db6 100644
--- a/drivers/crypto/dpaa2_sec/Makefile
+++ b/drivers/crypto/dpaa2_sec/Makefile
@@ -20,4 +20,11 @@  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
diff --git a/drivers/crypto/dpaa2_sec/meson.build b/drivers/crypto/dpaa2_sec/meson.build
index cb1c2d049..505ad9414 100644
--- a/drivers/crypto/dpaa2_sec/meson.build
+++ b/drivers/crypto/dpaa2_sec/meson.build
@@ -11,3 +11,8 @@  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 ea266962a..6cf392cb3 100644
--- a/drivers/crypto/dpaa_sec/Makefile
+++ b/drivers/crypto/dpaa_sec/Makefile
@@ -14,4 +14,11 @@  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
diff --git a/drivers/crypto/dpaa_sec/meson.build b/drivers/crypto/dpaa_sec/meson.build
index 7d422d8d5..f5e660457 100644
--- a/drivers/crypto/dpaa_sec/meson.build
+++ b/drivers/crypto/dpaa_sec/meson.build
@@ -10,4 +10,9 @@  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')