Linux RAID subsystem development
 help / color / mirror / Atom feed
* [PATCH] fix multiple definition linking error due to missing extern
@ 2022-02-06 20:51 Dirk Müller
  2022-02-07  7:48 ` Paul Menzel
  2022-02-08  5:45 ` Song Liu
  0 siblings, 2 replies; 5+ messages in thread
From: Dirk Müller @ 2022-02-06 20:51 UTC (permalink / raw)
  To: linux-raid; +Cc: 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

Signed-off-by: Dirk Müller <dmueller@suse.de>
---
 lib/raid6/test/test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/raid6/test/test.c b/lib/raid6/test/test.c
index a3cf071941ab..ab0459150a61 100644
--- a/lib/raid6/test/test.c
+++ b/lib/raid6/test/test.c
@@ -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)));
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [PATCH] fix multiple definition linking error due to missing extern
@ 2021-12-29 15:38 Dirk Müller
  0 siblings, 0 replies; 5+ messages in thread
From: Dirk Müller @ 2021-12-29 15:38 UTC (permalink / raw)
  To: linux-raid; +Cc: 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:

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

Signed-off-by: Dirk Müller <dmueller@suse.de>
---
 lib/raid6/test/test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/raid6/test/test.c b/lib/raid6/test/test.c
index a3cf071941ab..ab0459150a61 100644
--- a/lib/raid6/test/test.c
+++ b/lib/raid6/test/test.c
@@ -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)));
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-02-08 16:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-06 20:51 [PATCH] fix multiple definition linking error due to missing extern Dirk Müller
2022-02-07  7:48 ` Paul Menzel
2022-02-08  5:45 ` Song Liu
2022-02-08 16:51   ` Dirk Müller
  -- strict thread matches above, loose matches on Subject: below --
2021-12-29 15:38 Dirk Müller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox