fix building with GCC 10
cover fix building with GCC 10
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.
See https://gcc.gnu.org/gcc-10/porting_to.html for more informations.
I didn't put -fcommon to CFLAGS since:
Compiling with -fno-common is useful on targets for which it provides better performance, or if you wish to verify that the program will work on other systems that always treat uninitialized variable definitions this way.
from gcc man page
Timothy Redaelli (3):
crypto/octeontx2: fix building with GCC 10
app/test: fix building with GCC 10
app/test-pipeline: fix building with GCC 10
app/test-pipeline/config.c | 2 +- app/test/test_fib_perf.c | 2 +- app/test/test_lpm_perf.c | 2 +- drivers/crypto/octeontx2/otx2_cryptodev.c | 2 ++ drivers/crypto/octeontx2/otx2_cryptodev.h | 2 +- drivers/crypto/octeontx2/otx2_cryptodev_ops.h | 2 +- 6 files changed, 7 insertions(+), 5 deletions(-)
Signature · 1 line
2.24.1
PATCH 1/3 crypto/octeontx2: fix building with GCC 10
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.
--- drivers/crypto/octeontx2/otx2_cryptodev.c | 2 ++ drivers/crypto/octeontx2/otx2_cryptodev.h | 2 +- drivers/crypto/octeontx2/otx2_cryptodev_ops.h | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-)
drivers/crypto/octeontx2/otx2_cryptodev.c +2 -0
@@ -24,6 +24,8 @@int otx2_cpt_logtype; +uint8_t otx2_cryptodev_driver_id; +static struct rte_pci_id pci_id_cpt_table[] = { { RTE_PCI_DEVICE(PCI_VENDOR_ID_CAVIUM,
drivers/crypto/octeontx2/otx2_cryptodev.h +1 -1
@@ -38,6 +38,6 @@ extern int otx2_cpt_logtype;/* * Crypto device driver ID */ -uint8_t otx2_cryptodev_driver_id; +extern uint8_t otx2_cryptodev_driver_id;#endif /* _OTX2_CRYPTODEV_H_ */
drivers/crypto/octeontx2/otx2_cryptodev_ops.h +1 -1
@@ -16,6 +16,6 @@ enum otx2_cpt_egrp {OTX2_CPT_EGRP_AE =2 }; -struct rte_cryptodev_ops otx2_cpt_ops; +extern struct rte_cryptodev_ops otx2_cpt_ops;#endif /* _OTX2_CRYPTODEV_OPS_H_ */
Signature · 1 line
2.24.1
Re: [dpdk-dev] [EXT] [PATCH 1/3] crypto/octeontx2: fix building with GCC 10
Quoted 56 lines
----------------------------------------------------------------------
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.Fixes 2f8a1b963eb7 ("crypto/octeontx2: add PMD skeleton")Signed-off-by Timothy Redaelli <[email protected]>--- drivers/crypto/octeontx2/otx2_cryptodev.c | 2 ++ drivers/crypto/octeontx2/otx2_cryptodev.h | 2 +- drivers/crypto/octeontx2/otx2_cryptodev_ops.h | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-)drivers/crypto/octeontx2/otx2_cryptodev.c +2
-0@@ -24,6 +24,8 @@int otx2_cpt_logtype; +uint8_t otx2_cryptodev_driver_id; +static struct rte_pci_id pci_id_cpt_table[] = { { RTE_PCI_DEVICE(PCI_VENDOR_ID_CAVIUM,drivers/crypto/octeontx2/otx2_cryptodev.h +1
-1@@ -38,6 +38,6 @@ extern int otx2_cpt_logtype;/* * Crypto device driver ID */ -uint8_t otx2_cryptodev_driver_id; +extern uint8_t otx2_cryptodev_driver_id;#endif /* _OTX2_CRYPTODEV_H_ */ drivers/crypto/octeontx2/otx2_cryptodev_ops.h +1
-2@@ -16,6 +16,6 @@ enum otx2_cpt_egrp {OTX2_CPT_EGRP_AE =2 }; -struct rte_cryptodev_ops otx2_cpt_ops; +extern struct rte_cryptodev_ops otx2_cpt_ops;#endif /* _OTX2_CRYPTODEV_OPS_H_ */ --
Quoted 1 line
2.24.1
PATCH 2/3 app/test: fix building with GCC 10
In reply to Timothy RedaelliGCC 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.
--- app/test/test_fib_perf.c | 2 +- app/test/test_lpm_perf.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
app/test/test_fib_perf.c +1 -1
@@ -35,7 +35,7 @@ struct route_rule {uint8_t depth; }; -struct route_rule large_route_table[MAX_RULE_NUM ]; +static struct route_rule large_route_table[MAX_RULE_NUM ];static uint32_t num_route_entries;#define NUM_ROUTE_ENTRIES num_route_entries
app/test/test_lpm_perf.c +1 -1
@@ -34,7 +34,7 @@ struct route_rule {uint8_t depth; }; -struct route_rule large_route_table[MAX_RULE_NUM ]; +static struct route_rule large_route_table[MAX_RULE_NUM ];static uint32_t num_route_entries;#define NUM_ROUTE_ENTRIES num_route_entries
Signature · 1 line
2.24.1
Re: [dpdk-dev] [PATCH 2/3] app/test: fix building with GCC 10
Quoted 31 lines · Timothy Redaelli
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.
Fixes 08e0c7581468 ("test/fib: add performance autotests")Signed-off-by Timothy Redaelli <[email protected]>--- app/test/test_fib_perf.c | 2 +- app/test/test_lpm_perf.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)app/test/test_fib_perf.c +1
-1@@ -35,7 +35,7 @@ struct route_rule {uint8_t depth; }; -struct route_rule large_route_table[MAX_RULE_NUM ]; +static struct route_rule large_route_table[MAX_RULE_NUM ];static uint32_t num_route_entries;#define NUM_ROUTE_ENTRIES num_route_entriesapp/test/test_lpm_perf.c +0
-0
app/test/test_lpm_perf.c struct route_rule { · line 40
Quoted 8 lines
app/test/test_lpm_perf.c +1
-1@@ -34,7 +34,7 @@ struct route_rule {uint8_t depth; }; -struct route_rule large_route_table[MAX_RULE_NUM ]; +static struct route_rule large_route_table[MAX_RULE_NUM ];static uint32_t num_route_entries;#define NUM_ROUTE_ENTRIES num_route_entries
Signature · 2 lines
Regards, Vladimir
PATCH 3/3 app/test-pipeline: fix building with GCC 10
In reply to Timothy RedaelliGCC 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.
--- app/test-pipeline/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
app/test-pipeline/config.c +1 -1
@@ -42,7 +42,7 @@#include "main.h" -struct app_params app; +extern struct app_params app;static const char usage[] ="\n" ;
Signature · 1 line
2.24.1
Re: [dpdk-dev] [dpdk-stable] [PATCH 3/3] app/test-pipeline: fix building with GCC 10
Quoted 18 lines · Timothy Redaelli
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.
Fixes 48f31ca50cc4 ("app/pipeline: packet framework benchmark")Signed-off-by Timothy Redaelli <[email protected]>--- app/test-pipeline/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)app/test-pipeline/config.c +0
-0
app/test-pipeline/config.c line 45
Quoted 5 lines
app/test-pipeline/config.c +1
-1@@ -42,7 +42,7 @@#include "main.h" -struct app_params app; +extern struct app_params app;
app is already declared as extern in main.h.
--
David Marchand
Quoted 4 lines · Timothy Redaelli
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.
Quoted 8 lines
See https://gcc.gnu.org/gcc-10/porting_to.html for more informations.
I didn't put -fcommon to CFLAGS since:
Compiling with -fno-common is useful on targets for which it provides better performance, or if you wish to verify that the program will work on other systems that always treat uninitialized variable definitions this way.
from gcc man page
Series applied, thanks.
Signature · 1 line
David Marchand