aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/nss/nss/disable-Wvarargs-with-clang.patch
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2016-07-12 23:38:49 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-07-20 10:28:47 +0100
commit17dcf19d867eb15d5eadedfda99b18b3b0c379bb (patch)
tree755c7f514fe6d55d0c983399783949d4e26c45ba /meta/recipes-support/nss/nss/disable-Wvarargs-with-clang.patch
parent317447f1d1d18b0e7e5ca837270f9ebf476fdcac (diff)
downloadopenembedded-core-contrib-17dcf19d867eb15d5eadedfda99b18b3b0c379bb.tar.gz
nss: Fix build with clang
Add a patch to disable a clang specific warning and avoid passing clang options to gcc when we have cross compiler is clang but host compiler is gcc We do not need to use target cflags when building native pieces and hence avoid the inter-mixing of compiler options (From OE-Core rev: d13640f39f8f467597daa42774102329e82d9b68) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-support/nss/nss/disable-Wvarargs-with-clang.patch')
-rw-r--r--meta/recipes-support/nss/nss/disable-Wvarargs-with-clang.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/meta/recipes-support/nss/nss/disable-Wvarargs-with-clang.patch b/meta/recipes-support/nss/nss/disable-Wvarargs-with-clang.patch
new file mode 100644
index 0000000000..86b1b60556
--- /dev/null
+++ b/meta/recipes-support/nss/nss/disable-Wvarargs-with-clang.patch
@@ -0,0 +1,33 @@
+clang 3.9 add this warning to rightly flag undefined
+behavior, we relegate this to be just a warning instead
+of error and keep the behavior as it was. Right fix would
+be to not pass enum to the function with variadic arguments
+as last named argument
+
+Fixes errors like
+ocsp.c:2220:22: error: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Werror,-Wvarargs]
+ va_start(ap, responseType0);
+ ^
+ocsp.c:2200:43: note: parameter of type 'SECOidTag' is declared here
+ SECOidTag responseType0, ...)
+
+see
+https://www.securecoding.cert.org/confluence/display/cplusplus/EXP58-CPP.+Pass+an+object+of+the+correct+type+to+va_start
+for more details
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Index: nss-3.24/nss/coreconf/Werror.mk
+===================================================================
+--- nss-3.24.orig/nss/coreconf/Werror.mk
++++ nss-3.24/nss/coreconf/Werror.mk
+@@ -54,7 +54,7 @@ ifndef WARNING_CFLAGS
+ ifdef CC_IS_CLANG
+ # -Qunused-arguments : clang objects to arguments that it doesn't understand
+ # and fixing this would require rearchitecture
+- WARNING_CFLAGS += -Qunused-arguments
++ WARNING_CFLAGS += -Qunused-arguments -Wno-error=varargs
+ # -Wno-parentheses-equality : because clang warns about macro expansions
+ WARNING_CFLAGS += $(call disable_warning,parentheses-equality)
+ ifdef BUILD_OPT