[Mesa-dev] [Bug 83669] fix build with gcc link time optimizer
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Thu Apr 21 08:13:48 UTC 2016
https://bugs.freedesktop.org/show_bug.cgi?id=83669
--- Comment #13 from Marc Dietrich <marvin24 at gmx.de> ---
gcc/clang development is fast and also the mesa supported version numbers of
compilers are increasing. So this is a fast moving target. That said, I
currently use the _target_ attribute of gcc (not supported by clang yet AFAIK),
and add a #pragma target:
diff --git a/src/mesa/Makefile.am b/src/mesa/Makefile.am
index 3903818..b83dc76 100644
--- a/src/mesa/Makefile.am
+++ b/src/mesa/Makefile.am
@@ -181,7 +181,9 @@ libmesagallium_la_LIBADD = \
libmesa_sse41_la_SOURCES = \
$(X86_SSE41_FILES)
+if !HAVE_TARGET_ATTRIBUTE
libmesa_sse41_la_CFLAGS = $(AM_CFLAGS) $(SSE41_CFLAGS)
+endif
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = gl.pc
diff --git a/src/mesa/main/sse_minmax.c b/src/mesa/main/sse_minmax.c
index 2e34716..5fd59fc 100644
--- a/src/mesa/main/sse_minmax.c
+++ b/src/mesa/main/sse_minmax.c
@@ -25,6 +25,7 @@
*
*/
+#pragma GCC target ("sse4.1")
#include "main/sse_minmax.h"
#include <smmintrin.h>
#include <stdint.h>
diff --git a/src/mesa/main/streaming-load-memcpy.c
b/src/mesa/main/streaming-load-memcpy.c
index 32854b6..8066954 100644
--- a/src/mesa/main/streaming-load-memcpy.c
+++ b/src/mesa/main/streaming-load-memcpy.c
@@ -26,6 +26,7 @@
*
*/
+#pragma GCC target ("sse4.1")
#include "main/macros.h"
#include "main/streaming-load-memcpy.h"
#include <smmintrin.h>
That works fine for gcc and clang so far for me. Not sure if this is a working
solution for everyone.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160421/f46ec14a/attachment.html>
More information about the mesa-dev
mailing list