summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorkamil <kamil@pkgsrc.org>2018-05-11 19:20:11 +0000
committerkamil <kamil@pkgsrc.org>2018-05-11 19:20:11 +0000
commit9e926b454567905a9069a8381f1d377042f6dbf6 (patch)
tree896c5d39acca1dc1550b63006ede6e373c1907f9 /security
parenta7b09ad309459b2cda5826f89fcdadeb84a2461a (diff)
downloadpkgsrc-9e926b454567905a9069a8381f1d377042f6dbf6.tar.gz
libgcrypt: Fix build with Clang
Port code that disables optimization on GCC to Clang/LLVM.
Diffstat (limited to 'security')
-rw-r--r--security/libgcrypt/distinfo3
-rw-r--r--security/libgcrypt/patches/patch-random_jitterentropy-base.c26
2 files changed, 28 insertions, 1 deletions
diff --git a/security/libgcrypt/distinfo b/security/libgcrypt/distinfo
index ddebb2396c0..47550b61977 100644
--- a/security/libgcrypt/distinfo
+++ b/security/libgcrypt/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.76 2017/12/14 08:49:54 adam Exp $
+$NetBSD: distinfo,v 1.77 2018/05/11 19:20:11 kamil Exp $
SHA1 (libgcrypt-1.8.2.tar.bz2) = ab8aae5d7a68f8e0988f90e11e7f6a4805af5c8d
RMD160 (libgcrypt-1.8.2.tar.bz2) = e0bed861b328fe411faa74daca0db388fb5aed88
@@ -6,4 +6,5 @@ SHA512 (libgcrypt-1.8.2.tar.bz2) = 1e8c414f95bf6b50e778102ca7c1b3b1f30d8320826d9
Size (libgcrypt-1.8.2.tar.bz2) = 2966534 bytes
SHA1 (patch-aa) = 60b3f4453b217ed8879a2ffd8d485c0195ffb5f8
SHA1 (patch-cipher_rijndael-arm.S) = ef3cb7f481022440780eb48ae31cbfad0a3ec115
+SHA1 (patch-random_jitterentropy-base.c) = 5a14676aae7ad5d12f9f0bed366af5183aaf22ad
SHA1 (patch-src_visibility.h) = 8cbbf6803ab34b4b7dda832aa8ee18247aa89518
diff --git a/security/libgcrypt/patches/patch-random_jitterentropy-base.c b/security/libgcrypt/patches/patch-random_jitterentropy-base.c
new file mode 100644
index 00000000000..fb8b99e4f23
--- /dev/null
+++ b/security/libgcrypt/patches/patch-random_jitterentropy-base.c
@@ -0,0 +1,26 @@
+$NetBSD: patch-random_jitterentropy-base.c,v 1.1 2018/05/11 19:20:11 kamil Exp $
+
+Port to Clang.
+
+--- random/jitterentropy-base.c.orig 2017-11-23 18:16:58.000000000 +0000
++++ random/jitterentropy-base.c
+@@ -50,13 +50,18 @@
+ */
+
+ #undef _FORTIFY_SOURCE
++
++#ifdef __clang__
++#pragma clang optimize off
++#else
+ #pragma GCC optimize ("O0")
++#endif
+
+ #include "jitterentropy.h"
+
+ #ifndef CONFIG_CRYPTO_CPU_JITTERENTROPY_STAT
+ /* only check optimization in a compilation for real work */
+- #ifdef __OPTIMIZE__
++ #if defined(__OPTIMIZE__) && !defined(__clang__)
+ #error "The CPU Jitter random number generator must not be compiled with optimizations. See documentation. Use the compiler switch -O0 for compiling jitterentropy-base.c."
+ #endif
+ #endif