From 2aa4265544b1e3d4a7e4b4f93bfcc572fa96bc85 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Mon, 10 Feb 2020 15:06:08 +0100 Subject: [PATCH] Unbreak build on gcc 10 (wit -fno-common) --- opensc-0.20.0-no-common.patch | 27 +++++++++++++++++++++++++++ opensc.spec | 2 ++ 2 files changed, 29 insertions(+) create mode 100644 opensc-0.20.0-no-common.patch diff --git a/opensc-0.20.0-no-common.patch b/opensc-0.20.0-no-common.patch new file mode 100644 index 0000000..4c4444c --- /dev/null +++ b/opensc-0.20.0-no-common.patch @@ -0,0 +1,27 @@ +diff --git a/src/tests/p11test/p11test.c b/src/tests/p11test/p11test.c +index feecf6fb..a16282cb 100644 +--- a/src/tests/p11test/p11test.c ++++ b/src/tests/p11test/p11test.c +@@ -34,6 +34,9 @@ + + #define DEFAULT_P11LIB "../../pkcs11/.libs/opensc-pkcs11.so" + ++/* Global variable keeping information about token we are using */ ++token_info_t token; ++ + void display_usage() { + fprintf(stdout, + " Usage:\n" +diff --git a/src/tests/p11test/p11test_common.h b/src/tests/p11test/p11test_common.h +index 2f3b238d..9eb5cede 100644 +--- a/src/tests/p11test/p11test_common.h ++++ b/src/tests/p11test/p11test_common.h +@@ -84,7 +84,7 @@ typedef struct { + size_t num_keygen_mechs; + } token_info_t; + +-token_info_t token; ++extern token_info_t token; + + #endif /* P11TEST_COMMON_H */ + diff --git a/opensc.spec b/opensc.spec index a8026e9..6fd03ec 100644 --- a/opensc.spec +++ b/opensc.spec @@ -14,6 +14,7 @@ Source1: opensc.module # https://github.com/OpenSC/OpenSC/blob/master/tests/common.sh Source2: common.sh Patch1: opensc-0.19.0-pinpad.patch +Patch2: opensc-0.20.0-no-common.patch BuildRequires: pcsc-lite-devel BuildRequires: readline-devel @@ -48,6 +49,7 @@ every software/card that does so, too. %prep %setup -q %patch1 -p1 -b .pinpad +%patch2 -p1 -b .no-common cp %{SOURCE2} tests/ # The test-pkcs11-tool-allowed-mechanisms already works in Fedora