fix multiple definition linking error due to missing extern
PATCH 1/1 fix multiple definition linking error due to missing extern
GCC 10+ defaults to -fno-common, which enforces proper declaration of external references using "extern". without this change a link would fail with:
ld: raid6.a(algos.o):lib/raid6/test/algos.c:28: multiple definition of `raid6_call';
lib/raid6/test/test.c:22: first defined hereSigned-off-by Dirk Müller <[email protected]>
--- lib/raid6/test/test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/raid6/test/test.c +1 -1
@@ -19,7 +19,7 @@#define NDISKS 16/* Including P and Q */ const char raid6_empty_zero_page[PAGE_SIZE] __attribute__((aligned(PAGE_SIZE))); -struct raid6_calls raid6_call; +extern struct raid6_calls raid6_call;char *dataptrs[NDISKS ]; char data[NDISKS][PAGE_SIZE] __attribute__((aligned(PAGE_SIZE)));
Signature · 1 line
2.34.1