Bug 198190

Summary: Fix security/p5-CryptX build with clang 3.6.0
Product: Ports & Packages Reporter: Dimitry Andric <dim>
Component: Individual Port(s)Assignee: Vanilla I. Shu <vanilla>
Status: Closed FIXED    
Severity: Affects Many People Flags: bugzilla: maintainer-feedback? (vanilla)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 197395    
Attachments:
Description Flags
Change inline const rotate functions to macros none

Description Dimitry Andric freebsd_committer freebsd_triage 2015-03-02 19:29:17 UTC
Created attachment 153677 [details]
Change inline const rotate functions to macros

During the exp-run in bug 197395, it was found that security/p5-CryptX gives errors with clang 3.6.0:

http://package18.nyi.freebsd.org/data/headamd64PR197395-default/2015-02-27_12h37m16s/logs/errors/p5-CryptX-0.021_1.log

These errors all because the embedded copy of libtomcrypt 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.  It is almost exactly the same as the patch for libtomcrypt itself, in bug 198017.

The produced code is exactly the same, as far as I can determine.  I tested this on i386 and amd64.
Comment 1 Vanilla I. Shu freebsd_committer freebsd_triage 2015-03-03 07:02:54 UTC
Sure, just do it.
Comment 2 commit-hook freebsd_committer freebsd_triage 2015-03-03 07:27:49 UTC
A commit references this bug:

Author: dim
Date: Tue Mar  3 07:27:45 UTC 2015
New revision: 380341
URL: https://svnweb.freebsd.org/changeset/ports/380341

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

Changes:
  head/security/p5-CryptX/files/
  head/security/p5-CryptX/files/patch-src__ltc__headerss__tomcrypt_macros.h
Comment 3 Dimitry Andric freebsd_committer freebsd_triage 2015-03-03 07:31:35 UTC
Fixed by r380341.