diff options
author | Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> | 2023-07-27 14:07:28 +0200 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2023-09-08 09:08:54 -0700 |
commit | e67ab61e29e979b6a6a8c87cb421c15d7adf5425 (patch) | |
tree | 344308e60a947ac36e8b49607e68f0060be38f66 | |
parent | 2619fb925b9c242973abda9bf4dc85d29c3a5836 (diff) | |
download | meta-clang-e67ab61e29e979b6a6a8c87cb421c15d7adf5425.tar.gz |
nss: Add upstream patches to fix the build with clang
Signed-off-by: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
3 files changed, 99 insertions, 0 deletions
diff --git a/dynamic-layers/openembedded-layer/recipes-support/nss/nss/0001-Bug-1661378-pkix-Do-not-use-NULL-where-0-is-needed.patch b/dynamic-layers/openembedded-layer/recipes-support/nss/nss/0001-Bug-1661378-pkix-Do-not-use-NULL-where-0-is-needed.patch new file mode 100644 index 0000000..65158b3 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/nss/nss/0001-Bug-1661378-pkix-Do-not-use-NULL-where-0-is-needed.patch | |||
@@ -0,0 +1,44 @@ | |||
1 | From b2ad4a0d31083a5fc1dbfb65b51bff14b2b7942f Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Wed, 2 Sep 2020 10:45:48 -0700 | ||
4 | Subject: [PATCH] Bug 1661378 - pkix: Do not use NULL where 0 is needed Clang | ||
5 | finds this error | ||
6 | |||
7 | pkix_logger.c:316:32: error: cast to smaller integer type 'PKIX_ERRORCLASS' from 'void *' [-Werror,-Wvoid-pointer-to-enum-cast] | ||
8 | logger->logComponent = (PKIX_ERRORCLASS)NULL; | ||
9 | ^~~~~~~~~~~~~~~~~~~~~ | ||
10 | pkix_logger.c:617:32: error: cast to smaller integer type 'PKIX_ERRORCLASS' from 'void *' [-Werror,-Wvoid-pointer-to-enum-cast] | ||
11 | logger->logComponent = (PKIX_ERRORCLASS)NULL; | ||
12 | ^~~~~~~~~~~~~~~~~~~~~ | ||
13 | 2 errors generated. | ||
14 | |||
15 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
16 | --- | ||
17 | lib/nss/libpkix/pkix/util/pkix_logger.c | 4 ++-- | ||
18 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
19 | |||
20 | diff --git a/nss/lib/nss/libpkix/pkix/util/pkix_logger.c b/nss/lib/libpkix/pkix/util/pkix_logger.c | ||
21 | index a916e6e4f..10f537a31 100644 | ||
22 | --- a/nss/lib/nss/libpkix/pkix/util/pkix_logger.c | ||
23 | +++ b/nss/lib/libpkix/pkix/util/pkix_logger.c | ||
24 | @@ -313,7 +313,7 @@ pkix_Logger_Destroy( | ||
25 | |||
26 | logger->callback = NULL; | ||
27 | PKIX_DECREF(logger->context); | ||
28 | - logger->logComponent = (PKIX_ERRORCLASS)NULL; | ||
29 | + logger->logComponent = (PKIX_ERRORCLASS)0; | ||
30 | |||
31 | cleanup: | ||
32 | |||
33 | @@ -614,7 +614,7 @@ PKIX_Logger_Create( | ||
34 | |||
35 | logger->callback = callback; | ||
36 | logger->maxLevel = 0; | ||
37 | - logger->logComponent = (PKIX_ERRORCLASS)NULL; | ||
38 | + logger->logComponent = (PKIX_ERRORCLASS)0; | ||
39 | |||
40 | PKIX_INCREF(loggerContext); | ||
41 | logger->context = loggerContext; | ||
42 | -- | ||
43 | 2.41.0 | ||
44 | |||
diff --git a/dynamic-layers/openembedded-layer/recipes-support/nss/nss/0001-Bug-1738028-avoid-a-clang-13-unused-variable-warning.patch b/dynamic-layers/openembedded-layer/recipes-support/nss/nss/0001-Bug-1738028-avoid-a-clang-13-unused-variable-warning.patch new file mode 100644 index 0000000..ff7829e --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/nss/nss/0001-Bug-1738028-avoid-a-clang-13-unused-variable-warning.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | Upstream-status: Backport | ||
2 | |||
3 | The warnings below are actual errors when building. | ||
4 | |||
5 | Signed-off-by: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> | ||
6 | --- | ||
7 | From 99c69dc3ca363ce9ff909531f8581252189905d0 Mon Sep 17 00:00:00 2001 | ||
8 | From: "John M. Schanck" <jschanck@mozilla.com> | ||
9 | Date: Mon, 13 Dec 2021 16:35:17 +0000 | ||
10 | Subject: [PATCH] Bug 1738028: avoid a clang 13 unused variable warning in opt | ||
11 | build. r=bbeurdouche | ||
12 | |||
13 | Differential Revision: https://phabricator.services.mozilla.com/D130309 | ||
14 | |||
15 | --HG-- | ||
16 | extra : moz-landing-system : lando | ||
17 | --- | ||
18 | lib/certhigh/certvfypkix.c | 2 ++ | ||
19 | lib/freebl/shvfy.c | 1 + | ||
20 | 2 files changed, 3 insertions(+) | ||
21 | |||
22 | diff --git a/nss/lib/certhigh/certvfypkix.c b/nss/lib/certhigh/certvfypkix.c | ||
23 | index 95d88b53f..7c8784f4e 100644 | ||
24 | --- a/nss/lib/certhigh/certvfypkix.c | ||
25 | +++ b/nss/lib/certhigh/certvfypkix.c | ||
26 | @@ -817,6 +817,8 @@ cert_PkixErrorToNssCode( | ||
27 | void *plContext) | ||
28 | { | ||
29 | int errLevel = 0; | ||
30 | + (void)errLevel; /* Suppress unused var warning (Bug 1738028) */ | ||
31 | + | ||
32 | PKIX_Int32 nssErr = 0; | ||
33 | PKIX_Error *errPtr = error; | ||
34 | |||
35 | diff --git a/nss/lib/freebl/shvfy.c b/nss/lib/freebl/shvfy.c | ||
36 | index da42467fd..0428bf6c0 100644 | ||
37 | --- a/nss/lib/freebl/shvfy.c | ||
38 | +++ b/nss/lib/freebl/shvfy.c | ||
39 | @@ -335,6 +335,7 @@ blapi_SHVerifyFile(const char *shName, PRBool self) | ||
40 | SECStatus rv; | ||
41 | DSAPublicKey key; | ||
42 | int count; | ||
43 | + (void)count; /* Suppress unused var warning (Bug 1738028) */ | ||
44 | #ifdef FREEBL_USE_PRELINK | ||
45 | int pid = 0; | ||
46 | #endif | ||
47 | -- | ||
48 | 2.41.0 | ||
49 | |||
diff --git a/dynamic-layers/openembedded-layer/recipes-support/nss/nss_3.51.1.bbappend b/dynamic-layers/openembedded-layer/recipes-support/nss/nss_3.51.1.bbappend new file mode 100644 index 0000000..a4731ff --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/nss/nss_3.51.1.bbappend | |||
@@ -0,0 +1,6 @@ | |||
1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" | ||
2 | |||
3 | SRC_URI:append:toolchain-clang = "\ | ||
4 | file://0001-Bug-1738028-avoid-a-clang-13-unused-variable-warning.patch \ | ||
5 | file://0001-Bug-1661378-pkix-Do-not-use-NULL-where-0-is-needed.patch \ | ||
6 | " | ||