Skip to contentSkip to conversation

lib/raid6/test: fix multiple definition linking error

PATCH Applied Dirk Müller 2 participants 2 messages Feb 8, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 lib/raid6/test: fix multiple definition linking error

GCC 10+ defaults to -fno-common, which enforces proper declaration of external references using "extern". without this change a link would fail with:

lib/raid6/test/algos.c:28: multiple definition of `raid6_call'; lib/raid6/test/test.c:22: first defined here

the pq.h header that is included already includes an extern declaration so we can just remove the redundant one here.

---
 lib/raid6/test/test.c | 1 -
 1 file changed, 1 deletion(-)
lib/raid6/test/test.c +0 -1
index a3cf071941ab..841a55242aba 100644
@@ -19,7 +19,6 @@
 #define NDISKS		16	/* Including P and Q */
 
 const char raid6_empty_zero_page[PAGE_SIZE] __attribute__((aligned(PAGE_SIZE)));
-struct raid6_calls raid6_call;
 
 char *dataptrs[NDISKS];
 char data[NDISKS][PAGE_SIZE] __attribute__((aligned(PAGE_SIZE)));
Signature · 1 line
2.35.1
maintainer Applied
#1 lore raw
Quoted 8 lines · Dirk Müller

GCC 10+ defaults to -fno-common, which enforces proper declaration of external references using "extern". without this change a link would fail with:

lib/raid6/test/algos.c:28: multiple definition of `raid6_call'; lib/raid6/test/test.c:22: first defined here

Quoted 6 lines

the pq.h header that is included already includes an extern declaration so we can just remove the redundant one here.

Applied to md-next. Thanks!

Song