Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Dec 2011 00:58:39 +0300
From:      Jan Beich <jbeich@tormail.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/163518: [patch] x11/babl: unbreak SSE build with clang 
Message-ID:  <1RdWEL-000Cgb-Gl@internal.tormail.net>
Resent-Message-ID: <201112220020.pBM0K5gT096900@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         163518
>Category:       ports
>Synopsis:       [patch] x11/babl: unbreak SSE build with clang
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Dec 22 00:20:05 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Jan Beich
>Release:        FreeBSD 10.0-CURRENT amd64
>Organization:
>Environment:
WITH_SIMD=
>Description:
- unbreak sse detection on amd64
- don't use __builtin* functions directly
>How-To-Repeat:
$ make CC=clang
  gmake[2]: Entering directory `/usr/ports/x11/babl/work/babl-0.1.6/extensions'
  CC     sse_fixups_la-sse-fixups.lo
sse-fixups.c:96:16: error: use of unknown builtin '__builtin_ia32_movhlps'
           v = g4float_movhl (v, v);
               ^
sse-fixups.c:46:29: note: expanded from:
#define g4float_movhl(a,b)  __builtin_ia32_movhlps(a, b)
                            ^
sse-fixups.c:96:14: error: assigning to 'g4float' from incompatible type 'int';
           v = g4float_movhl (v, v);
             ^ ~~~~~~~~~~~~~~~~~~~~
sse-fixups.c:154:14: error: assigning to 'g4float' from incompatible type 'int';
           v = g4float_movhl (v, v);
             ^ ~~~~~~~~~~~~~~~~~~~~
3 errors generated.
gmake[2]: *** [sse_fixups_la-sse-fixups.lo] Error 1
>Fix:
--- clang.diff begins here ---
Index: x11/babl/Makefile
===================================================================
RCS file: /a/.csup/ports/x11/babl/Makefile,v
retrieving revision 1.11
diff -u -p -r1.11 Makefile
--- x11/babl/Makefile	22 Nov 2011 08:03:18 -0000	1.11
+++ x11/babl/Makefile	21 Dec 2011 21:54:57 -0000
@@ -38,4 +38,7 @@ CONFIGURE_ARGS+=--disable-mmx \
 		--disable-altivec
 .endif
 
+post-patch:	.SILENT
+	${REINPLACE_CMD} -i.64 -e 's|x86_64|amd64|g' ${WRKSRC}/configure
+
 .include <bsd.port.post.mk>
Index: x11/babl/files/patch-sse-fixups.c
===================================================================
RCS file: x11/babl/files/patch-sse-fixups.c
diff -N x11/babl/files/patch-sse-fixups.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ x11/babl/files/patch-sse-fixups.c	21 Dec 2011 21:51:49 -0000
@@ -0,0 +1,28 @@
+--- extensions/sse-fixups.c~
++++ extensions/sse-fixups.c
+@@ -23,6 +23,8 @@
+ 
+ #if defined(__GNUC__) && (__GNUC__ >= 4) && defined(USE_SSE) && defined(USE_MMX)
+ 
++#include <xmmintrin.h>
++
+ #include <stdint.h>
+ #include <stdlib.h>
+ 
+@@ -40,11 +42,11 @@ typedef int   g2int   __attribute__ ((ve
+ #define g4float_zero      g4float_all(0.0)
+ #define g4float_ff        g4float_all(255.0)
+ 
+-#define g4float_max(a,b)    __builtin_ia32_maxps(a, b)
+-#define g4float_min(a,b)    __builtin_ia32_minps(a, b)
+-#define g4float_cvt2pi(a)   __builtin_ia32_cvtps2pi(a)
+-#define g4float_movhl(a,b)  __builtin_ia32_movhlps(a, b)
+-#define g4float_emms        __builtin_ia32_emms
++#define g4float_max(a,b)    _mm_max_ps(a, b)
++#define g4float_min(a,b)    _mm_min_ps(a, b)
++#define g4float_cvt2pi(a)   _mm_cvtps_pi32(a)
++#define g4float_movhl(a,b)  _mm_movehl_ps(a, b)
++#define g4float_emms        _mm_empty
+ 
+ 
+ static INLINE long
--- clang.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1RdWEL-000Cgb-Gl>