Date: Tue, 3 Mar 2015 07:27:45 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r380341 - head/security/p5-CryptX/files Message-ID: <201503030727.t237Rj3V009911@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dim (src committer) Date: Tue Mar 3 07:27:44 2015 New Revision: 380341 URL: https://svnweb.freebsd.org/changeset/ports/380341 QAT: https://qat.redports.org/buildarchive/r380341/ Log: In the embedded copy of libtomcrypt, change the ROLc/RORc inline functions to macros, so the constraints requirements are satisfied at compile time. It is almost exactly the same as the patch for libtomcrypt itself, in PR 198017. Approved by: maintainer (vanilla) PR: 198190 Added: head/security/p5-CryptX/files/ head/security/p5-CryptX/files/patch-src__ltc__headerss__tomcrypt_macros.h (contents, props changed) Added: head/security/p5-CryptX/files/patch-src__ltc__headerss__tomcrypt_macros.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/security/p5-CryptX/files/patch-src__ltc__headerss__tomcrypt_macros.h Tue Mar 3 07:27:44 2015 (r380341) @@ -0,0 +1,107 @@ +--- src/ltc/headers/tomcrypt_macros.h.orig 2014-01-23 16:45:59.000000000 +0100 ++++ src/ltc/headers/tomcrypt_macros.h 2015-03-02 20:23:48.396007000 +0100 +@@ -281,21 +281,19 @@ + + #ifndef LTC_NO_ROLC + +-static inline ulong32 ROLc(ulong32 word, const int i) +-{ +- asm ("roll %2,%0" +- :"=r" (word) +- :"0" (word),"I" (i)); +- return word; +-} +- +-static inline ulong32 RORc(ulong32 word, const int i) +-{ +- asm ("rorl %2,%0" +- :"=r" (word) +- :"0" (word),"I" (i)); +- return word; +-} ++#define ROLc(word, i) ({ \ ++ ulong32 _word = word; \ ++ asm ("roll %2,%0" \ ++ :"=r" (_word) \ ++ :"0" (_word),"I" (i)); \ ++ _word; }) ++ ++#define RORc(word, i) ({ \ ++ ulong32 _word = word; \ ++ asm ("rorl %2,%0" \ ++ :"=r" (_word) \ ++ :"0" (_word),"I" (i)); \ ++ _word; }) + + #else + +@@ -324,21 +322,19 @@ + + #ifndef LTC_NO_ROLC + +-static inline ulong32 ROLc(ulong32 word, const int i) +-{ +- asm ("rotlwi %0,%0,%2" +- :"=r" (word) +- :"0" (word),"I" (i)); +- return word; +-} +- +-static inline ulong32 RORc(ulong32 word, const int i) +-{ +- asm ("rotrwi %0,%0,%2" +- :"=r" (word) +- :"0" (word),"I" (i)); +- return word; +-} ++#define ROLc(word, i) ({ \ ++ ulong32 _word = word; \ ++ asm ("rotlwi %0,%0,%2" \ ++ :"=r" (_word) \ ++ :"0" (_word),"I" (i)); \ ++ _word; }) ++ ++#define RORc(word, i) ({ \ ++ ulong32 _word = word; \ ++ asm ("rotrwi %0,%0,%2" \ ++ :"=r" (_word) \ ++ :"0" (_word),"I" (i)); \ ++ _word; }) + + #else + +@@ -380,21 +376,19 @@ + + #ifndef LTC_NO_ROLC + +-static inline ulong64 ROL64c(ulong64 word, const int i) +-{ +- asm("rolq %2,%0" +- :"=r" (word) +- :"0" (word),"J" (i)); +- return word; +-} +- +-static inline ulong64 ROR64c(ulong64 word, const int i) +-{ +- asm("rorq %2,%0" +- :"=r" (word) +- :"0" (word),"J" (i)); +- return word; +-} ++#define ROL64c(word, i) ({ \ ++ ulong64 _word = word; \ ++ asm ("rolq %2,%0" \ ++ :"=r" (_word) \ ++ :"0" (_word),"J" (i)); \ ++ _word; }) ++ ++#define ROR64c(word, i) ({ \ ++ ulong64 _word = word; \ ++ asm ("rorq %2,%0" \ ++ :"=r" (_word) \ ++ :"0" (_word),"J" (i)); \ ++ _word; }) + + #else /* LTC_NO_ROLC */ +
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201503030727.t237Rj3V009911>