Bug 198017 - Fix security/libtomcrypt build with clang 3.6.0
Summary: Fix security/libtomcrypt build with clang 3.6.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Antoine Brodin
URL:
Keywords:
Depends on:
Blocks: 197395
  Show dependency treegraph
 
Reported: 2015-02-24 22:25 UTC by Dimitry Andric
Modified: 2015-03-15 15:40 UTC (History)
0 users

See Also:


Attachments
Change inline const rotate functions to macros (3.09 KB, patch)
2015-02-24 22:25 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2015-02-24 22:25:30 UTC
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.
Comment 1 Jan Beich freebsd_committer freebsd_triage 2015-03-01 00:58:58 UTC
The version here looks more complete and less noise than in

https://github.com/libtom/libtomcrypt/commit/62878de
Comment 2 Dimitry Andric freebsd_committer freebsd_triage 2015-03-01 01:15:47 UTC
(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.
Comment 3 Antoine Brodin freebsd_committer freebsd_triage 2015-03-15 15:33:50 UTC
Take
Comment 4 commit-hook freebsd_committer freebsd_triage 2015-03-15 15:38:11 UTC
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