Skip to contentSkip to conversation

New: Can't build with LLVM/clang 3.7.0

Bug 93454 [email protected] 1 participant 11 messages Dec 20, 2015 – Dec 23, 2015 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

https://bugs.freedesktop.org/show_bug.cgi?id=93454

Bug ID: 93454
Summary: Can't build with LLVM/clang 3.7.0
Product: Mesa
Version: 11.0
Hardware: Other
OS: All
Status: NEW
Severity: normal
Priority: medium
Component: Drivers/DRI/nouveau
Assignee: [email protected]
Reporter: [email protected]
QA Contact: [email protected]

System is OpenMandriva Cooker running LLVM/clang 3.7.0 as default compiler.

When i build mesa i got this error:

Makefile:1205: recipe for target 'nv50/nv84_video_vp.lo' failed make[3]: Leaving directory '/builddir/build/BUILD/mesa-11.0.7/src/gallium/drivers/nouveau' In file included from nv50/nv84_video_vp.c:25:
In file included from ../../../../src/gallium/auxiliary/util/u_sse.h:140:
/usr/bin/../lib64/clang/3.7.0/include/tmmintrin.h:28:2: error: "SSSE3 instruction set not enabled"
#error "SSSE3 instruction set not enabled"
^
1 error generated.
make[3]: *** [nv50/nv84_video_vp.lo] Error 1
make[3]: *** Waiting for unfinished jobs....

Adding -mssse3 to CFLAGS will not work for all hardware.

Signature · 3 lines
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#2 lore raw

[Bug 93454] Can't build with LLVM/clang 3.7.0 - SSSE3 instruction set not enabled

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=93454

Tomasz Paweł Gajc <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

            Summary|Can't build with LLVM/clang |Can't build with LLVM/clang
                   |3.7.0                       |3.7.0 - SSSE3 instruction
                   |                            |set not enabled
Signature · 3 lines
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#3 lore raw

[Bug 93454] Can't build with LLVM/clang 3.7.0 - SSSE3 instruction set not enabled

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=93454

Tomasz Paweł Gajc <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

           Hardware|Other                       |x86-64 (AMD64)
                 OS|All                         |Linux (All)
           Severity|normal                      |major
Signature · 3 lines
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#4 lore raw

[Bug 93454] Can't build with LLVM/clang 3.7.0 - SSSE3 instruction set not enabled

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=93454

--- Comment #1 from Ilia Mirkin <imirkin-FrUbXkNCsVf2fBVCVOL8/[email protected]> --- Hmmm... this comes from

#if defined(PIPE_ARCH_SSSE3)

#include <tmmintrin.h>

Which in turn comes from, hilariously,

#if defined(PIPE_CC_GCC) && (__GNUC__ * 100 + __GNUC_MINOR__) < 409 && !defined(__SSSE3__)
/* #warning SSE3 support requires -msse3 compiler options before GCC 4.9 */ #else
#define PIPE_ARCH_SSSE3
#endif

I'm guessing that was meant to be

#if defined(PIPE_CC_GCC) && (__GNUC__ * 100 + __GNUC_MINOR__) < 409 || !defined(__SSSE3__)

Signature · 3 lines
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#5 lore raw

[Bug 93454] Can't build with LLVM/clang 3.7.0 - SSSE3 instruction set not enabled

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=93454

--- Comment #2 from Ilia Mirkin <imirkin-FrUbXkNCsVf2fBVCVOL8/[email protected]> --- Hmmm... this comes from

#if defined(PIPE_ARCH_SSSE3)

#include <tmmintrin.h>

Which in turn comes from, hilariously,

#if defined(PIPE_CC_GCC) && (__GNUC__ * 100 + __GNUC_MINOR__) < 409 && !defined(__SSSE3__)
/* #warning SSE3 support requires -msse3 compiler options before GCC 4.9 */ #else
#define PIPE_ARCH_SSSE3
#endif

I'm guessing that was meant to be

#if defined(PIPE_CC_GCC) && (__GNUC__ * 100 + __GNUC_MINOR__) < 409 || !defined(__SSSE3__)

Signature · 3 lines
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#6 lore raw

[Bug 93454] Can't build with LLVM/clang 3.7.0 - SSSE3 instruction set not enabled

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=93454

--- Comment #3 from Tomasz Paweł Gajc <[email protected]> --- Let me try that in src/gallium/include/pipe/p_config.h

Signature · 3 lines
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#7 lore raw

[Bug 93454] Can't build with LLVM/clang 3.7.0 - SSSE3 instruction set not enabled

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=93454

Ilia Mirkin <imirkin-FrUbXkNCsVf2fBVCVOL8/[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #4 from Ilia Mirkin <imirkin-FrUbXkNCsVf2fBVCVOL8/[email protected]> --- This logic was last altered in the change below... My copy of clang 3.5 purports to be gcc 4.2.1. What does clang 3.7 report?

clang -E -dM - < /dev/null | grep GNUC

commit eb643db30e1bdf5171d0a012674016c317925b6e

Author: Jose Fonseca <[email protected]>
Date:   Sun Aug 9 11:21:03 2015 +0100

gallium: GCC 4.9 allows to include tmmintrin.h without -msse3.

Fixes build with MinGW x86_64 build with GCC 4.9, due to conflicting definition _mm_shuffle_epi8 of u_sse.h and system headers.

Trivial.

Signature · 3 lines
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#8 lore raw

[Bug 93454] Can't build with LLVM/clang 3.7.0 - SSSE3 instruction set not enabled

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=93454

--- Comment #5 from Tomasz Paweł Gajc <[email protected]> --- (In reply to Ilia Mirkin from comment #4)

Quoted 1 line

clang -E -dM - < /dev/null | grep GNUC

#define __GNUC_MINOR__ 9
#define __GNUC_PATCHLEVEL__ 1
#define __GNUC_STDC_INLINE__ 1
#define __GNUC__4

Signature · 3 lines
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#9 lore raw

[Bug 93454] Can't build with LLVM/clang 3.7.0 - SSSE3 instruction set not enabled

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=93454

--- Comment #6 from Jose Fonseca <[email protected]> --- The issue is simple:

- GCC used to require -msse3 in order to include tmmintrin.h
- MSVC/ICC does not
- GCC 4.9 finally eliminated that awkward requirement -- it's now possible to use SSE3 instrinsics without giving GCC carte blanch to emit SSSE3 whenever it wants

- it appears Clang claims to be GCC 4.9 but does not in fact support this.

We can workaround by adding

(quoted diff) +0 -0

b/src/gallium/include/pipe/p_config.h
index 0b570c7..7d5d7d4 100644

src/gallium/include/pipe/p_config.h +0 -1
@@ -96,7 +96,7 @@
 #else
 #define PIPE_ARCH_SSE
 #endif
-#if defined(PIPE_CC_GCC) && (__GNUC__ * 100 + __GNUC_MINOR__) < 409 &&

!defined(__SSSE3__)
+#if defined(PIPE_CC_GCC) && ((__GNUC__ * 100 + __GNUC_MINOR__) < 409 || defined(__clang__)) && !defined(__SSSE3__)
/* #warning SSE3 support requires -msse3 compiler options before GCC 4.9 */ #else
#define PIPE_ARCH_SSSE3

But this is above all a bug in Clang 3.7. If that strive/claim to be GCC 4.9 then they should handle this too.

Signature · 3 lines
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#10 lore raw

[Bug 93454] Can't build with LLVM/clang 3.7.0 - SSSE3 instruction set not enabled

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=93454

Tomasz Paweł Gajc <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

                URL|                            |https://llvm.org/bugs/show_
                   |                            |bug.cgi?id=24990

--- Comment #7 from Tomasz Paweł Gajc <[email protected]> --- Hi, thanks for the workaround
I found this bug report https://llvm.org/bugs/show_bug.cgi?id=24990 and i was paring commits for llvm and clang and i did not found anything that would corresponds to above bug.

Signature · 3 lines
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#11 lore raw

[Bug 93454] Can't build with LLVM/clang 3.7.0 - SSSE3 instruction set not enabled

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=93454

Jose Fonseca <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |RESOLVED
         Resolution|---                         |NOTOURBUG

--- Comment #8 from Jose Fonseca <[email protected]> --- (In reply to Tomasz Paweł Gajc from comment #7)

Quoted 4 lines

Hi, thanks for the workaround
I found this bug report https://llvm.org/bugs/show_bug.cgi?id=24990 and i was paring commits for llvm and clang and i did not found anything that would corresponds to above bug.

It looks like they had fixed this already before the bug report.

From the git history, the fix is

https://github.com/llvm-mirror/clang/commit/41885d36e85ead75a1d18ef7d2f43663f90ed67e

Not sure what clang version got it in the end.

But given this has already been fixed in Clang, I think we shouldn't fix it in Mesa, otherwise we'll need complex logic to detect exactly which clang versions support or not this.

OpenMandriva Cooker made the decision to use LLVM/clang 3.7.0 as default compiler, so they should crossport any fixes necessary to keep light on.

Signature · 3 lines
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau