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: http://package18.nyi.freebsd.org/data/headamd64PR197395-default/2015-02-11_23h04m51s/logs/errors/libtomcrypt-1.17_4.log 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 https://github.com/libtom/libtomcrypt/commit/62878de
(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.
Take
A commit references this bug: Author: antoine Date: Sun Mar 15 15:37:56 UTC 2015 New revision: 381342 URL: https://svnweb.freebsd.org/changeset/ports/381342 Log: Allow building with clang 3.6 PR: 198017 Submitted by: dim Changes: head/security/libtomcrypt/files/ head/security/libtomcrypt/files/patch-src_headers_tomcrypt__macros.h