libxcrypt/libxcrypt-4.4.10-crypt-common_h_Declare_ascii64_with_explicit_extern.patch

30 lines
1.2 KiB
Diff

From 941362e2868a71a32a2a497903e651fb647b4fd2 Mon Sep 17 00:00:00 2001
From: Zack Weinberg <zackw@panix.com>
Date: Wed, 11 Dec 2019 13:33:07 -0500
Subject: [PATCH] crypt-common.h: Declare `ascii64` with explicit `extern`.
GCC 10 changes its default compilation mode from `-fcommon` to
`-fno-common`, which means that tentative definitions of data objects
will no longer be merged across translation units; instead they will
produce multiple definition errors. The `ascii64` constant was
supposed to be _declared_ in crypt-common.h, but it was accidentally a
tentative definition instead. Fix this by adding the `extern`
annotation that should have always been there.
---
lib/crypt-common.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/crypt-common.h b/lib/crypt-common.h
index c97fa5d..1134bc4 100644
--- a/lib/crypt-common.h
+++ b/lib/crypt-common.h
@@ -24,7 +24,7 @@
/* The base-64 encoding table used by most hashing methods.
(bcrypt uses a slightly different encoding.) Size 65
because it's used as a C string in a few places. */
-const unsigned char ascii64[65];
+extern const unsigned char ascii64[65];
/* Same table gets used with other names in various places. */
#define b64t ((const char *) ascii64)