pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/security/libtomcrypt For clang, don't use the rotate i...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/397626847e0b
branches:  trunk
changeset: 645218:397626847e0b
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Sun Jan 25 13:13:51 2015 +0000

description:
For clang, don't use the rotate inline asm, but expect the compiler to
generate optimal code.

diffstat:

 security/libtomcrypt/distinfo                                     |   3 +-
 security/libtomcrypt/patches/patch-src_headers_tomcrypt__macros.h |  25 ++++++++++
 2 files changed, 27 insertions(+), 1 deletions(-)

diffs (43 lines):

diff -r 6c2c93437955 -r 397626847e0b security/libtomcrypt/distinfo
--- a/security/libtomcrypt/distinfo     Sun Jan 25 13:12:54 2015 +0000
+++ b/security/libtomcrypt/distinfo     Sun Jan 25 13:13:51 2015 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.3 2014/01/16 13:32:10 drochner Exp $
+$NetBSD: distinfo,v 1.4 2015/01/25 13:13:51 joerg Exp $
 
 SHA1 (crypt-1.17.tar.bz2) = 9c746822c84e4276e432b64964f94d1d5ddd13ad
 RMD160 (crypt-1.17.tar.bz2) = 742d72d82fea2e6a9865d8c682c10cbaba69ea2f
@@ -6,3 +6,4 @@
 SHA1 (patch-aa) = a2385cf0543a19b1555d4370a10c012c5141b48a
 SHA1 (patch-ab) = c0eb1522dd02c2811deebfa353433e81e71a8928
 SHA1 (patch-ac) = 871a713512b20199b502876d2523e8bf619c5e85
+SHA1 (patch-src_headers_tomcrypt__macros.h) = 4aa1e0773a11c32fca83e7de82e12d44fdbb8202
diff -r 6c2c93437955 -r 397626847e0b security/libtomcrypt/patches/patch-src_headers_tomcrypt__macros.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/security/libtomcrypt/patches/patch-src_headers_tomcrypt__macros.h Sun Jan 25 13:13:51 2015 +0000
@@ -0,0 +1,25 @@
+$NetBSD: patch-src_headers_tomcrypt__macros.h,v 1.1 2015/01/25 13:13:51 joerg Exp $
+
+clang doesn't allow non-constant arguments for "I" constraints.
+Just use the C version, it will get optimised to rotate anyway.
+
+--- src/headers/tomcrypt_macros.h.orig 2015-01-24 16:35:36.000000000 +0000
++++ src/headers/tomcrypt_macros.h
+@@ -242,7 +242,7 @@ asm __volatile__ (             \
+ #define RORc(x,n) _lrotr(x,n)
+ #define ROLc(x,n) _lrotl(x,n)
+ 
+-#elif !defined(__STRICT_ANSI__) && defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) && !defined(INTEL_CC) && !defined(LTC_NO_ASM)
++#elif !defined(__STRICT_ANSI__) && defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) && !defined(INTEL_CC) && !defined(LTC_NO_ASM) && !defined(__clang__)
+ 
+ static inline unsigned ROL(unsigned word, int i)
+ {
+@@ -341,7 +341,7 @@ static inline unsigned RORc(unsigned wor
+ 
+ 
+ /* 64-bit Rotates */
+-#if !defined(__STRICT_ANSI__) && defined(__GNUC__) && defined(__x86_64__) && !defined(LTC_NO_ASM)
++#if !defined(__STRICT_ANSI__) && defined(__GNUC__) && defined(__x86_64__) && !defined(LTC_NO_ASM) && !defined(__clang__)
+ 
+ static inline unsigned long ROL64(unsigned long word, int i)
+ {



Home | Main Index | Thread Index | Old Index