From nobody@FreeBSD.org  Mon Aug 27 16:09:03 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id DDA40106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 27 Aug 2012 16:09:03 +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 C84D98FC1E
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 27 Aug 2012 16:09:03 +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 q7RG93lH088134
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 27 Aug 2012 16:09:03 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q7RG93Ui088132;
	Mon, 27 Aug 2012 16:09:03 GMT
	(envelope-from nobody)
Message-Id: <201208271609.q7RG93Ui088132@red.freebsd.org>
Date: Mon, 27 Aug 2012 16:09:03 GMT
From: Dan McGregor <dan.mcgregor@usask.ca>
To: freebsd-gnats-submit@FreeBSD.org
Subject: multimedia/libxine fails to build with clang as cc
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         171119
>Category:       ports
>Synopsis:       multimedia/libxine fails to build with clang as cc
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    nox
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 27 16:10:04 UTC 2012
>Closed-Date:    Mon Aug 27 22:20:24 UTC 2012
>Last-Modified:  Mon Aug 27 22:20:24 UTC 2012
>Originator:     Dan McGregor
>Release:        10-CURRENT
>Organization:
>Environment:
FreeBSD nebuchadnezzar.local 10.0-CURRENT FreeBSD 10.0-CURRENT #0 r+5a7bf35: Wed Aug 22 13:23:02 CST 2012     dan@nebuchadnezzar.local:/home/dan/freebsd-obj/usr/home/dan/freebsd/sys/GENERIC  amd64

>Description:
libxine fails with the following error when build with clang:


ifs.c:534:2: error: clobbers must be last on the x87 stack
        emms();/*__asm__ __volatile__ ("emms");*/
        ^
./mmx.h:733:38: note: expanded from macro 'emms'
#define emms() __asm__ __volatile__ ("emms"::: \
                                     ^
cc: warning: argument unused during compilation: '-fexpensive-optimizations'
cc: warning: argument unused during compilation: '-fno-force-addr'
1 error generated.


The offending part of mmx.h is:

#define emms() __asm__ __volatile__ ("emms"::: \
                      "st(1)","st(2)","st(3)","st(4)","st(5)","st(6)","st(7)")

>How-To-Repeat:
Build libxine with CC=clang CXX=clang++ or build world with WITH_CLANG_IS_CC and WITHOUT_GCC then build libxine.
>Fix:
The easiest solution for me was to add USE_GCC=4.4+ to the Makefile, which brought in gcc as a dependency.

The other solution is to remove the clobber list from the emms asm directive.  I don't know what that does to building with gcc, though.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->nox 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Aug 27 16:10:18 UTC 2012 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/171119: commit references a PR
Date: Mon, 27 Aug 2012 22:19:05 +0000 (UTC)

 Author: nox
 Date: Mon Aug 27 22:18:55 2012
 New Revision: 303264
 URL: http://svn.freebsd.org/changeset/ports/303264
 
 Log:
   (Attempt to) fix build with clang by assuming clang doesn't need a
   clobber list with __asm__ __volatile__ ("emms").
   
   PR:		ports/171119
   Submitted by:	Dan McGregor <dan.mcgregor@usask.ca>
 
 Added:
   head/multimedia/libxine/files/patch-src-post-goom-mmx.h   (contents, props changed)
 
 Added: head/multimedia/libxine/files/patch-src-post-goom-mmx.h
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/multimedia/libxine/files/patch-src-post-goom-mmx.h	Mon Aug 27 22:18:55 2012	(r303264)
 @@ -0,0 +1,32 @@
 +--- src/post/goom/mmx.h.orig
 ++++ src/post/goom/mmx.h
 +@@ -721,17 +721,29 @@ void zoom_filter_xmmx (int prevX, int pr
 + */
 + #ifdef	MMX_TRACE
 + 
 ++#ifdef __clang__
 ++#define	emms() \
 ++	{ \
 ++		printf("emms()\n"); \
 ++		__asm__ __volatile__ ("emms"); \
 ++	}
 ++#else
 + #define	emms() \
 + 	{ \
 + 		printf("emms()\n"); \
 + 		__asm__ __volatile__ ("emms" \
 +                         "st(1)","st(2)","st(3)","st(4)","st(5)","st(6)","st(7)"); \
 + 	}
 ++#endif
 + 
 + #else
 + 
 ++#ifdef __clang__
 ++#define	emms() __asm__ __volatile__ ("emms")
 ++#else
 + #define	emms() __asm__ __volatile__ ("emms"::: \
 +                       "st(1)","st(2)","st(3)","st(4)","st(5)","st(6)","st(7)")
 ++#endif
 + 
 + #endif
 + 
 _______________________________________________
 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"
 
State-Changed-From-To: open->closed 
State-Changed-By: nox 
State-Changed-When: Mon Aug 27 22:20:23 UTC 2012 
State-Changed-Why:  
Fix (attempt) committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=171119 
>Unformatted:
