Created attachment 153479 [details]
Change inline const rotate functions to macros
During the exp-run in bug 197395, it was found that security/libtomcrypt gives errors with clang 3.6.0:
These errors all because tomcrypt uses the 'I' and 'J' asm constraints incorrectly. These can only be used with compile-time integer constants (e.g. numeric literals).
I propose the attached patch, which changes the ROLc/RORc inline function to macros, so the constraints requirements are satisfied at compile time.
The produced code is exactly the same, as far as I can determine. I tested this on i386 and amd64.
The version here looks more complete and less noise than in
(In reply to Jan Beich from comment #1)
Ah, I wasn't even aware of that upstream commit. :) Indeed, it does not handle the powerpc specific functions.
In any case, upstream seems to have done some more janitorial work in their headers, such as renaming types. So if we want to use the upstream fix instead, we should also import a newer upstream version.
A commit references this bug:
Date: Sun Mar 15 15:37:56 UTC 2015
New revision: 381342
Allow building with clang 3.6
Submitted by: dim