Re: [PATCH] fix multiple definition linking error due to missing extern

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear Dirk,


Am 06.02.22 um 21:51 schrieb Dirk Müller:

It’d be great of you added a prefix in the commit message summary. Maybe:

lib/raid6/test: 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

Nit: Without

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@xxxxxxx>

Thank you for properly analyzing and fixing it in a better way than my (non-working) attempt [1].

Should it be tagged for the stable series, that means CC’ed to <stable@xxxxxxxxxxxxxxx>?

---
  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)));

Reviewed-by: Paul Menzel <pmenzel@xxxxxxxxxxxxx>


Kind regards,

Paul


[1]: https://lore.kernel.org/linux-raid/20220126114144.370517-3-pmenzel@xxxxxxxxxxxxx/T/#u



[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux