https://github.com/openwall/john/pull/4258

diff --git src/opencl_DES_bs.h src/opencl_DES_bs.h
index 8f122e34b..77e83800f 100644
--- src/opencl_DES_bs.h
+++ src/opencl_DES_bs.h
@@ -62,7 +62,7 @@ extern int restore_lws_config(const char *, int, size_t *, size_t, unsigned int
 
 typedef unsigned WORD vtype;
 
-unsigned int CC_CACHE_ALIGN opencl_DES_bs_index768[0x300];
+extern unsigned int CC_CACHE_ALIGN opencl_DES_bs_index768[0x300];
 
 struct fmt_main;
 
diff --git src/opencl_DES_bs_plug.c src/opencl_DES_bs_plug.c
index 831cecbad..a52812f65 100644
--- src/opencl_DES_bs_plug.c
+++ src/opencl_DES_bs_plug.c
@@ -38,6 +38,7 @@ static opencl_DES_bs_transfer *des_raw_keys;
 static unsigned int *des_int_key_loc;
 static unsigned int static_gpu_locations[MASK_FMT_INT_PLHDR];
 static size_t process_key_gws;
+unsigned int CC_CACHE_ALIGN opencl_DES_bs_index768[0x300];
 
 unsigned char opencl_DES_E[48] = {
 	31, 0, 1, 2, 3, 4,
diff --git src/opencl_agilekeychain_fmt_plug.c src/opencl_agilekeychain_fmt_plug.c
index ac1a5529b..a5f19c2df 100644
--- src/opencl_agilekeychain_fmt_plug.c
+++ src/opencl_agilekeychain_fmt_plug.c
@@ -76,7 +76,7 @@ static agile_password *inbuffer;
 static agile_hash *outbuffer;
 static agile_salt currentsalt;
 static cl_mem mem_in, mem_out, mem_setting;
-size_t insize, outsize, settingsize, cracked_size;
+static size_t insize, outsize, settingsize;
 static struct fmt_main *self;
 
 #define STEP			0
diff --git src/opencl_axcrypt_fmt_plug.c src/opencl_axcrypt_fmt_plug.c
index f94d089a8..d18fd387f 100644
--- src/opencl_axcrypt_fmt_plug.c
+++ src/opencl_axcrypt_fmt_plug.c
@@ -74,7 +74,7 @@ static axcrypt_salt currentsalt;
 static cl_mem mem_in, mem_out, mem_setting;
 static struct fmt_main *self;
 
-size_t insize, outsize, settingsize, cracked_size;
+static size_t insize, outsize, settingsize;
 
 #define STEP			0
 #define SEED			256
diff --git src/opencl_gpg_fmt_plug.c src/opencl_gpg_fmt_plug.c
index 7094c72c7..9a2bf712c 100644
--- src/opencl_gpg_fmt_plug.c
+++ src/opencl_gpg_fmt_plug.c
@@ -101,7 +101,7 @@ static cl_mem mem_in, mem_out, mem_setting;
 static struct fmt_main *self;
 static cl_kernel crypt_kernel_sha256, crypt_kernel_sha512;
 
-size_t insize, outsize, settingsize, cracked_size;
+static size_t insize, outsize, settingsize, cracked_size;
 
 #define STEP			0
 #define SEED			256
diff --git src/opencl_keychain_fmt_plug.c src/opencl_keychain_fmt_plug.c
index be64a028d..b23133b6c 100644
--- src/opencl_keychain_fmt_plug.c
+++ src/opencl_keychain_fmt_plug.c
@@ -78,7 +78,7 @@ static keychain_out *outbuffer;
 static keychain_salt currentsalt;
 static cl_mem mem_in, mem_dk, mem_salt, mem_out;
 
-size_t insize, dksize, saltsize, outsize;
+static size_t insize, dksize, saltsize, outsize;
 
 #define STEP                    0
 #define SEED                    256
diff --git src/opencl_lm.h src/opencl_lm.h
index db7b50963..6f3fa12f3 100644
--- src/opencl_lm.h
+++ src/opencl_lm.h
@@ -68,9 +68,9 @@
 
 typedef unsigned WORD vtype;
 
-unsigned int CC_CACHE_ALIGN opencl_lm_index768[0x300];
+extern unsigned int CC_CACHE_ALIGN opencl_lm_index768[0x300];
 
-unsigned char opencl_lm_u[0x100];
+extern unsigned char opencl_lm_u[0x100];
 
 typedef struct {
 	unsigned char *pxkeys[LM_DEPTH]; /* Pointers into xkeys.c */
diff --git src/opencl_lm_plug.c src/opencl_lm_plug.c
index ee6eae720..1d633a39c 100644
--- src/opencl_lm_plug.c
+++ src/opencl_lm_plug.c
@@ -19,6 +19,8 @@
 opencl_lm_combined *opencl_lm_all;
 opencl_lm_transfer *opencl_lm_keys;
 unsigned int *opencl_lm_int_key_loc = NULL;
+unsigned int CC_CACHE_ALIGN opencl_lm_index768[0x300];
+unsigned char opencl_lm_u[0x100];
 
 static unsigned char LM_KP[56] = {
 	1, 2, 3, 4, 5, 6, 7,
diff --git src/opencl_odf_fmt_plug.c src/opencl_odf_fmt_plug.c
index d636506c5..d4d5ca566 100644
--- src/opencl_odf_fmt_plug.c
+++ src/opencl_odf_fmt_plug.c
@@ -67,7 +67,7 @@ static odf_password *saved_key;
 static odf_out *crypt_out;
 static odf_salt currentsalt;
 
-size_t insize, outsize, settingsize, cracked_size;
+static size_t insize, outsize, settingsize;
 
 static struct custom_salt *cur_salt;
 
diff --git src/opencl_pfx_fmt_plug.c src/opencl_pfx_fmt_plug.c
index de0213362..f28100182 100644
--- src/opencl_pfx_fmt_plug.c
+++ src/opencl_pfx_fmt_plug.c
@@ -80,7 +80,7 @@ static pfx_salt currentsalt;
 static cl_mem mem_in, mem_out, mem_setting;
 static struct fmt_main *self;
 
-size_t insize, outsize, settingsize, cracked_size;
+static size_t insize, outsize, settingsize;
 
 #define STEP			0
 #define SEED			256
diff --git src/opencl_pgpdisk_fmt_plug.c src/opencl_pgpdisk_fmt_plug.c
index 6b940edce..cd5ea9fbf 100644
--- src/opencl_pgpdisk_fmt_plug.c
+++ src/opencl_pgpdisk_fmt_plug.c
@@ -67,7 +67,7 @@ static cl_kernel aes_kernel, twofish_kernel, cast_kernel;
 static cl_mem mem_in, mem_out, mem_salt;
 static struct fmt_main *self;
 
-size_t insize, outsize, saltsize;
+static size_t insize, outsize, saltsize;
 
 // This file contains auto-tuning routine(s). Has to be included after formats definitions.
 #include "opencl_autotune.h"
diff --git src/opencl_pgpsda_fmt_plug.c src/opencl_pgpsda_fmt_plug.c
index 86f385073..00e6c6fb1 100644
--- src/opencl_pgpsda_fmt_plug.c
+++ src/opencl_pgpsda_fmt_plug.c
@@ -64,7 +64,7 @@ static pgpsda_salt currentsalt;
 static cl_mem mem_in, mem_out, mem_setting;
 static struct fmt_main *self;
 
-size_t insize, outsize, settingsize;
+static size_t insize, outsize, settingsize;
 
 // This file contains auto-tuning routine(s). Has to be included after formats definitions.
 #include "opencl_autotune.h"
diff --git src/opencl_pgpwde_fmt_plug.c src/opencl_pgpwde_fmt_plug.c
index fb54a8ab2..1b88c62a4 100644
--- src/opencl_pgpwde_fmt_plug.c
+++ src/opencl_pgpwde_fmt_plug.c
@@ -68,7 +68,7 @@ static pgpwde_salt currentsalt;
 static cl_mem mem_in, mem_out, mem_setting;
 static struct fmt_main *self;
 
-size_t insize, outsize, settingsize, cracked_size;
+static size_t insize, outsize, settingsize;
 
 // This file contains auto-tuning routine(s). Has to be included after formats definitions.
 #include "opencl_autotune.h"
diff --git src/opencl_sappse_fmt_plug.c src/opencl_sappse_fmt_plug.c
index eb1e98c86..76066267d 100644
--- src/opencl_sappse_fmt_plug.c
+++ src/opencl_sappse_fmt_plug.c
@@ -70,7 +70,7 @@ static sappse_salt currentsalt;
 static cl_mem mem_in, mem_out, mem_setting;
 static struct fmt_main *self;
 
-size_t insize, outsize, settingsize, cracked_size;
+static size_t insize, outsize, settingsize;
 
 #define STEP			0
 #define SEED			256
diff --git src/opencl_ssh_fmt_plug.c src/opencl_ssh_fmt_plug.c
index 4e1e95162..92c8e2480 100644
--- src/opencl_ssh_fmt_plug.c
+++ src/opencl_ssh_fmt_plug.c
@@ -74,7 +74,7 @@ static ssh_salt currentsalt;
 static cl_mem mem_in, mem_out, mem_setting;
 static struct fmt_main *self;
 
-size_t insize, outsize, settingsize, cracked_size;
+static size_t insize, outsize, settingsize;
 
 #define STEP			0
 #define SEED			256
diff --git src/opencl_sspr_fmt_plug.c src/opencl_sspr_fmt_plug.c
index 3524f3634..46510eda7 100644
--- src/opencl_sspr_fmt_plug.c
+++ src/opencl_sspr_fmt_plug.c
@@ -88,7 +88,7 @@ static cl_mem mem_in, mem_out, mem_setting, mem_state;
 static struct fmt_main *self;
 static cl_kernel sspr_kernel[5], loop_kernel[5];
 
-size_t insize, outsize, settingsize;
+static size_t insize, outsize, settingsize;
 
 #define STEP			0
 #define SEED			256
diff --git src/opencl_tc_fmt_plug.c src/opencl_tc_fmt_plug.c
index ccd9a7c6b..d6964605a 100644
--- src/opencl_tc_fmt_plug.c
+++ src/opencl_tc_fmt_plug.c
@@ -59,8 +59,8 @@ john_register_one(&FMT_STRUCT);
 #define MAX_KFILE_SZ            1048576 /* 1 MB */
 #define MAX_KEYFILES            256
 
-unsigned char (*keyfiles_data)[MAX_KFILE_SZ];
-int (*keyfiles_length);
+static unsigned char (*keyfiles_data)[MAX_KFILE_SZ];
+static int (*keyfiles_length);
 
 #define KEYLEN  PLAINTEXT_LENGTH
 #define OUTLEN  64
@@ -80,7 +80,7 @@ typedef struct {
 	unsigned int bin[(512 - 64) / 4];
 } tc_salt;
 
-struct cust_salt {
+static struct cust_salt {
 	unsigned char salt[64];
 	unsigned char bin[512 - 64];
 	int loop_inc;
diff --git src/opencl_zip_fmt_plug.c src/opencl_zip_fmt_plug.c
index 49fb644f0..f82dbb924 100644
--- src/opencl_zip_fmt_plug.c
+++ src/opencl_zip_fmt_plug.c
@@ -83,7 +83,7 @@ static zip_salt currentsalt;
 static cl_mem mem_in, mem_out, mem_setting, mem_data;
 static struct fmt_main *self;
 
-static size_t insize, outsize, settingsize, datasize;
+size_t insize, outsize, settingsize, datasize, cracked_size;
 
 #define STEP			0
 #define SEED			256
diff --git src/truecrypt_fmt_plug.c src/truecrypt_fmt_plug.c
index 34b6e4ceb..8b8c11701 100644
--- src/truecrypt_fmt_plug.c
+++ src/truecrypt_fmt_plug.c
@@ -101,11 +101,11 @@ static unsigned char (*first_block_dec)[16];
 #define MAX_KEYFILES            256
 
 // keyfile(s) data
-unsigned char (*keyfiles_data)[MAX_KFILE_SZ];
-int (*keyfiles_length);
+static unsigned char (*keyfiles_data)[MAX_KFILE_SZ];
+static int (*keyfiles_length);
 static int *cracked;
 
-struct cust_salt {
+static struct cust_salt {
 	unsigned char salt[64];
 	// I 'thought' that bin[] could be removed, so that only salt[] was used
 	// for salt dupe-removal. That was wrong, bin[] must also be part of the
