From nobody@FreeBSD.org  Sat Jun  9 15:47:59 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A39A1106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  9 Jun 2012 15:47:59 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 8B06B8FC0A
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  9 Jun 2012 15:47:59 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q59FlxEb025192
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 9 Jun 2012 15:47:59 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q59FlwHU025191;
	Sat, 9 Jun 2012 15:47:58 GMT
	(envelope-from nobody)
Message-Id: <201206091547.q59FlwHU025191@red.freebsd.org>
Date: Sat, 9 Jun 2012 15:47:58 GMT
From: Jakub Lach <jakub_lach@mailplus.pl>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [solution] audio/wavpack doesn't build with clang 3.1
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         168896
>Category:       ports
>Synopsis:       [patch] audio/wavpack doesn't build with clang 3.1
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    crees
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jun 09 15:50:06 UTC 2012
>Closed-Date:    Wed Sep 12 21:23:15 UTC 2012
>Last-Modified:  Wed Sep 12 21:30:02 UTC 2012
>Originator:     Jakub Lach
>Release:        FreeBSD 9.0-STABLE
>Organization:
>Environment:
FreeBSD 9.0-STABLE #0 r236716M amd64
>Description:
.if ${MACHINE_CPU:Mmmx}
CONFIGURE_ARGS= --enable-mmx
.endif

Is culprit. If removed from Makefile, it builds fine, 
same as upstream trunk, same as 4.60.1 tar from upstream.

Refraining from posting patch, as it's trivial, it's not a
issue with MMX per se, as =march-native builds fine, it's 
adding:

"-DOPT_MMX=1 -I. -I/usr/local/include -mmmx"

what breaks the build with: 

"extra2.c:85:41: error: passing 'int' to parameter of incompatible type"

Maybe it should be made conditional only for those using gcc4*, as it 
does not bother it.
  
>How-To-Repeat:

>Fix:
Fix included in description.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->freebsd-multimedia 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sat Jun 9 23:41:41 UTC 2012 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=168896 

From: Chris Rees <utisoft@gmail.com>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: ports/168896
Date: Wed, 12 Sep 2012 21:16:52 +0100

 I have a patch, with help from David Chisnall (theraven).
 
 http://www.bayofrum.net/~crees/patches/wavpack-clangfix.diff
 
 Basically, the problem is that the line checking GCC version is trying
 to find the correct __builtin_ia32_pslldi builtin.... but clang
 pretends it's GCC 4.2.
 
 Change it to feature-based checking... and voila.
 
 Mind if I commit?
 
 Chris
State-Changed-From-To: open->closed 
State-Changed-By: crees 
State-Changed-When: Wed Sep 12 21:23:12 UTC 2012 
State-Changed-Why:  
Fix committed.  Thanks for poking me to look at it! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=168896 
Responsible-Changed-From-To: freebsd-multimedia->crees 
Responsible-Changed-By: crees 
Responsible-Changed-When: Wed Sep 12 21:24:29 UTC 2012 
Responsible-Changed-Why:  
My patch 

http://www.freebsd.org/cgi/query-pr.cgi?pr=168896 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/168896: commit references a PR
Date: Wed, 12 Sep 2012 21:22:55 +0000 (UTC)

 Author: crees
 Date: Wed Sep 12 21:22:40 2012
 New Revision: 304164
 URL: http://svn.freebsd.org/changeset/ports/304164
 
 Log:
   Fix clang build.
   
   Thanks to theraven for helping to track down the problem.
   
   PR:		ports/168896
   Reviewed by:	multimedia (mav, briefly)
 
 Added:
   head/audio/wavpack/files/
   head/audio/wavpack/files/patch-src__wavpack_local.h   (contents, props changed)
 
 Added: head/audio/wavpack/files/patch-src__wavpack_local.h
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/audio/wavpack/files/patch-src__wavpack_local.h	Wed Sep 12 21:22:40 2012	(r304164)
 @@ -0,0 +1,22 @@
 +--- ./src/wavpack_local.h.orig	2009-12-01 04:24:50.000000000 +0000
 ++++ ./src/wavpack_local.h	2012-09-12 21:12:47.161974704 +0100
 +@@ -11,6 +11,10 @@
 + #ifndef WAVPACK_LOCAL_H
 + #define WAVPACK_LOCAL_H
 + 
 ++#ifndef __has_builtin
 ++#define __has_builtin(x) 0
 ++#endif
 ++
 + #if defined(WIN32)
 + #define FASTCALL __fastcall
 + #else
 +@@ -768,7 +772,7 @@
 + #define _m_paddd(m1, m2) __builtin_ia32_paddd (m1, m2)
 + #define _m_pcmpeqd(m1, m2) __builtin_ia32_pcmpeqd (m1, m2)
 + 
 +-#if (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) || __GNUC__ > 4
 ++#if (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) || __GNUC__ > 4 || __has_builtin(__builtin_ia32_pslldi)
 + #	define _m_pslldi(m1, m2) __builtin_ia32_pslldi ((__m64)m1, m2)
 + #	define _m_psradi(m1, m2) __builtin_ia32_psradi ((__m64)m1, m2)
 + #	define _m_psrldi(m1, m2) __builtin_ia32_psrldi ((__m64)m1, m2)
 _______________________________________________
 svn-ports-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-ports-all
 To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
 
>Unformatted:
