summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-12-01 11:47:24 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-12-02 08:02:25 +0100
commit3aa5f100eb1402bea7896524f0f04dabdca65af7 (patch)
tree89f36380ae987910d31f09dbef04fb4b4e8def9f
parent39a7cf0303a4a633393733d95581e24669d15155 (diff)
external/nss: work around missing clang-cl #pragma support
Change-Id: I068ff0ef2252409689c0c376ec41bdd97b4567cc
-rw-r--r--external/nss/UnpackedTarball_nss.mk1
-rw-r--r--external/nss/clang-cl.patch.056
2 files changed, 57 insertions, 0 deletions
diff --git a/external/nss/UnpackedTarball_nss.mk b/external/nss/UnpackedTarball_nss.mk
index 4afd2751fdc3..38acfedad04f 100644
--- a/external/nss/UnpackedTarball_nss.mk
+++ b/external/nss/UnpackedTarball_nss.mk
@@ -23,6 +23,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,nss,\
external/nss/nss-3.13.3-build.patch.3 \
external/nss/nss.mingw.patch.3) \
external/nss/ubsan.patch.0 \
+ external/nss/clang-cl.patch.0 \
$(if $(filter IOS,$(OS)), \
external/nss/nss-chromium-nss-static.patch \
external/nss/nss-more-static.patch \
diff --git a/external/nss/clang-cl.patch.0 b/external/nss/clang-cl.patch.0
new file mode 100644
index 000000000000..bc904218f804
--- /dev/null
+++ b/external/nss/clang-cl.patch.0
@@ -0,0 +1,56 @@
+# "#pragma deprecated" and "#pragma intrinsic" not (yet?) handled in the "if
+# (LangOpts.MicrosoftExt)" block in Preprocessor::RegisterBuiltinPragmas in
+# Clang's lib/Lex/Pragma.cpp:
+--- nspr/pr/include/pratom.h
++++ nspr/pr/include/pratom.h
+@@ -83,7 +83,7 @@
+
+ #include <intrin.h>
+
+-#ifdef _MSC_VER
++#if defined _WIN32 && !defined __clang__
+ #pragma intrinsic(_InterlockedIncrement)
+ #pragma intrinsic(_InterlockedDecrement)
+ #pragma intrinsic(_InterlockedExchange)
+--- nspr/pr/include/prbit.h
++++ nspr/pr/include/prbit.h
+@@ -14,7 +14,7 @@
+ ** functions.
+ */
+ #if defined(_WIN32) && (_MSC_VER >= 1300) && \
+- (defined(_M_IX86) || defined(_M_AMD64) || defined(_M_ARM))
++ (defined(_M_IX86) || defined(_M_AMD64) || defined(_M_ARM)) && !defined __clang__
+ # include <intrin.h>
+ # pragma intrinsic(_BitScanForward,_BitScanReverse)
+ __forceinline static int __prBitScanForward32(unsigned int val)
+@@ -136,7 +136,7 @@
+ */
+
+ #if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_AMD64) || \
+- defined(_M_X64) || defined(_M_ARM))
++ defined(_M_X64) || defined(_M_ARM)) && !defined __clang__
+ #include <stdlib.h>
+ #pragma intrinsic(_rotl, _rotr)
+ #define PR_ROTATE_LEFT32(a, bits) _rotl(a, bits)
+--- nss/lib/certdb/certdb.h
++++ nss/lib/certdb/certdb.h
+@@ -31,7 +31,7 @@
+ #endif
+ #define CERTDB_VALID_PEER ((__CERTDB_VALID_PEER) CERTDB_TERMINAL_RECORD)
+ #else
+-#ifdef _WIN32
++#if defined _WIN32 && !defined __clang__
+ #pragma deprecated(CERTDB_VALID_PEER)
+ #endif
+ #define CERTDB_VALID_PEER CERTDB_TERMINAL_RECORD
+--- nss/lib/util/pkcs11n.h
++++ nss/lib/util/pkcs11n.h
+@@ -390,7 +390,7 @@
+ /* keep the old value for compatibility reasons*/
+ #define CKT_NSS_MUST_VERIFY ((__CKT_NSS_MUST_VERIFY)(CKT_NSS +4))
+ #else
+-#ifdef _WIN32
++#if defined _WIN32 && !defined __clang__
+ /* This magic gets the windows compiler to give us a deprecation
+ * warning */
+ #pragma deprecated(CKT_NSS_UNTRUSTED, CKT_NSS_MUST_VERIFY, CKT_NSS_VALID)