Bug 168896 - [patch] audio/wavpack doesn't build with clang 3.1
Summary: [patch] audio/wavpack doesn't build with clang 3.1
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Chris Rees
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-09 16:50 UTC by jakub_lach
Modified: 2012-09-12 22:30 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jakub_lach 2012-06-09 16:50:06 UTC
.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.

Fix: 

Fix included in description.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2012-06-10 00:41:41 UTC
Responsible Changed
From-To: freebsd-ports-bugs->freebsd-multimedia

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Chris Rees 2012-09-12 21:16:52 UTC
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
Comment 3 dfilter service freebsd_committer freebsd_triage 2012-09-12 22:22:55 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"
Comment 4 Chris Rees freebsd_committer freebsd_triage 2012-09-12 22:23:12 UTC
State Changed
From-To: open->closed

Fix committed.  Thanks for poking me to look at it!
Comment 5 Chris Rees freebsd_committer freebsd_triage 2012-09-12 22:24:29 UTC
Responsible Changed
From-To: freebsd-multimedia->crees

My patch