diff options
| author | Ting Liu <ting.liu@nxp.com> | 2020-12-15 21:38:13 +0800 |
|---|---|---|
| committer | Otavio Salvador <otavio@ossystems.com.br> | 2020-12-16 08:40:31 -0300 |
| commit | 009f221c3e4467562d47a421547fedf71b5030a2 (patch) | |
| tree | 802bd6d0975b651c929ac82790b60258b5d468f4 | |
| parent | d33395a8a26ad024c1c4ce431698ece6d07b178a (diff) | |
| download | meta-freescale-009f221c3e4467562d47a421547fedf71b5030a2.tar.gz | |
libpkcs11: fix multiple definition error
gcc10 default to -fno-common, which results in error:
| ../aarch64-fsl-linux/10.2.0/ld: /tmp/ccaL5AXA.o:.../libpkcs11/git-r0/git/app/pkcs11_app.c:23: multiple definition of `funcs'; /tmp/ccvGV0xB.o:.../app/utils.c:18: first defined here
| collect2: error: ld returned 1 exit status
| Makefile:66: recipe for target 'app' failed
| make: *** [app] Error 1
Signed-off-by: Ting Liu <ting.liu@nxp.com>
| -rw-r--r-- | recipes-extended/libpkcs11/libpkcs11/0001-fix-multiple-definition-error.patch | 90 | ||||
| -rw-r--r-- | recipes-extended/libpkcs11/libpkcs11_git.bb | 4 |
2 files changed, 93 insertions, 1 deletions
diff --git a/recipes-extended/libpkcs11/libpkcs11/0001-fix-multiple-definition-error.patch b/recipes-extended/libpkcs11/libpkcs11/0001-fix-multiple-definition-error.patch new file mode 100644 index 000000000..a1680a8b7 --- /dev/null +++ b/recipes-extended/libpkcs11/libpkcs11/0001-fix-multiple-definition-error.patch | |||
| @@ -0,0 +1,90 @@ | |||
| 1 | From e8e566a4b4d589cbdf2613c78cac75ecbea86d3b Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Ting Liu <ting.liu@nxp.com> | ||
| 3 | Date: Wed, 30 Sep 2020 10:24:14 +0530 | ||
| 4 | Subject: [PATCH] fix multiple definition error | ||
| 5 | |||
| 6 | gcc10 default to -fno-common, which results in error: | ||
| 7 | | ../aarch64-fsl-linux/10.2.0/ld: /tmp/ccaL5AXA.o:.../libpkcs11/git-r0/git/app/pkcs11_app.c:23: multiple definition of `funcs'; /tmp/ccvGV0xB.o:.../app/utils.c:18: first defined here | ||
| 8 | | collect2: error: ld returned 1 exit status | ||
| 9 | | Makefile:66: recipe for target 'app' failed | ||
| 10 | | make: *** [app] Error 1 | ||
| 11 | |||
| 12 | Upstream-Status: Pending | ||
| 13 | |||
| 14 | Signed-off-by: Ting Liu <ting.liu@nxp.com> | ||
| 15 | --- | ||
| 16 | app/gen_test.c | 2 +- | ||
| 17 | app/pkcs11_app.c | 2 +- | ||
| 18 | app/sign_digest_update_final.c | 2 +- | ||
| 19 | app/thread_test.c | 2 +- | ||
| 20 | app/utils.c | 2 +- | ||
| 21 | 5 files changed, 5 insertions(+), 5 deletions(-) | ||
| 22 | |||
| 23 | diff --git a/app/gen_test.c b/app/gen_test.c | ||
| 24 | index fbd3429..2476e18 100644 | ||
| 25 | --- a/app/gen_test.c | ||
| 26 | +++ b/app/gen_test.c | ||
| 27 | @@ -17,7 +17,7 @@ | ||
| 28 | #include <openssl/pem.h> | ||
| 29 | #include <openssl/md5.h> | ||
| 30 | |||
| 31 | -CK_FUNCTION_LIST *funcs; | ||
| 32 | +static CK_FUNCTION_LIST *funcs; | ||
| 33 | |||
| 34 | #define err2str(X) case X: return #X | ||
| 35 | |||
| 36 | diff --git a/app/pkcs11_app.c b/app/pkcs11_app.c | ||
| 37 | index 2b4a70d..3883dab 100644 | ||
| 38 | --- a/app/pkcs11_app.c | ||
| 39 | +++ b/app/pkcs11_app.c | ||
| 40 | @@ -20,7 +20,7 @@ | ||
| 41 | #include <openssl/pem.h> | ||
| 42 | #include "utils.h" | ||
| 43 | |||
| 44 | -CK_FUNCTION_LIST *funcs; | ||
| 45 | +static CK_FUNCTION_LIST *funcs; | ||
| 46 | |||
| 47 | struct getOptValue_t { | ||
| 48 | uint32_t main_option; | ||
| 49 | diff --git a/app/sign_digest_update_final.c b/app/sign_digest_update_final.c | ||
| 50 | index b3367ed..49fee20 100644 | ||
| 51 | --- a/app/sign_digest_update_final.c | ||
| 52 | +++ b/app/sign_digest_update_final.c | ||
| 53 | @@ -20,7 +20,7 @@ | ||
| 54 | #include <openssl/pem.h> | ||
| 55 | #include "utils.h" | ||
| 56 | |||
| 57 | -CK_FUNCTION_LIST *funcs; | ||
| 58 | +static CK_FUNCTION_LIST *funcs; | ||
| 59 | |||
| 60 | struct getOptValue_t { | ||
| 61 | uint32_t main_option; | ||
| 62 | diff --git a/app/thread_test.c b/app/thread_test.c | ||
| 63 | index 19d03ee..a574074 100644 | ||
| 64 | --- a/app/thread_test.c | ||
| 65 | +++ b/app/thread_test.c | ||
| 66 | @@ -20,7 +20,7 @@ | ||
| 67 | #include <sched.h> | ||
| 68 | #include <pthread.h> | ||
| 69 | |||
| 70 | -CK_FUNCTION_LIST *funcs; | ||
| 71 | +static CK_FUNCTION_LIST *funcs; | ||
| 72 | |||
| 73 | #define err2str(X) case X: return #X | ||
| 74 | #define MAX_THREADS 10 | ||
| 75 | diff --git a/app/utils.c b/app/utils.c | ||
| 76 | index 7afad95..9f9e143 100644 | ||
| 77 | --- a/app/utils.c | ||
| 78 | +++ b/app/utils.c | ||
| 79 | @@ -15,7 +15,7 @@ | ||
| 80 | #include <tee_slot.h> | ||
| 81 | #include "utils.h" | ||
| 82 | |||
| 83 | -CK_FUNCTION_LIST *funcs; | ||
| 84 | +static CK_FUNCTION_LIST *funcs; | ||
| 85 | |||
| 86 | #define err2str(X) case X: return #X | ||
| 87 | |||
| 88 | -- | ||
| 89 | 2.17.1 | ||
| 90 | |||
diff --git a/recipes-extended/libpkcs11/libpkcs11_git.bb b/recipes-extended/libpkcs11/libpkcs11_git.bb index 33c27ecdb..30f33a202 100644 --- a/recipes-extended/libpkcs11/libpkcs11_git.bb +++ b/recipes-extended/libpkcs11/libpkcs11_git.bb | |||
| @@ -2,7 +2,9 @@ DESCRIPTION = "PKCS library" | |||
| 2 | LICENSE = "GPLv2 & BSD" | 2 | LICENSE = "GPLv2 & BSD" |
| 3 | LIC_FILES_CHKSUM = "file://LICENSE;md5=803852533e29eb1d6d5e55ad3078b625" | 3 | LIC_FILES_CHKSUM = "file://LICENSE;md5=803852533e29eb1d6d5e55ad3078b625" |
| 4 | 4 | ||
| 5 | SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/libpkcs11;nobranch=1" | 5 | SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/libpkcs11;nobranch=1 \ |
| 6 | file://0001-fix-multiple-definition-error.patch \ | ||
| 7 | " | ||
| 6 | SRCREV = "a243fb21772f1bd434d8bc1ac45feb36571afadb" | 8 | SRCREV = "a243fb21772f1bd434d8bc1ac45feb36571afadb" |
| 7 | 9 | ||
| 8 | DEPENDS = "openssl secure-obj" | 10 | DEPENDS = "openssl secure-obj" |
