Bug 1803351 - mesa builds fail with llvm 10.0.0 rc1/rc2 on ppc64le
Summary: mesa builds fail with llvm 10.0.0 rc1/rc2 on ppc64le
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: llvm
Version: 32
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Tom Stellard
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PPCTracker
TreeView+ depends on / blocked
 
Reported: 2020-02-15 12:26 UTC by Pete Walter
Modified: 2020-02-26 17:05 UTC (History)
11 users (show)

Fixed In Version: mesa-20.0.0-2.fc32
Clone Of:
Environment:
Last Closed: 2020-02-26 17:05:44 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Pete Walter 2020-02-15 12:26:57 UTC
mesa doesn't build with new llvm 10.0.0 rc1/rc2 on ppc64le. Lots of compiler errors about llvm headers. Could one of the llvm maintainers investigate this, please?

e.g. "/usr/include/llvm/ADT/PointerIntPair.h:150:8: error: enumerator value for 'IntShift' is not an integer constant"

https://koji.fedoraproject.org/koji/taskinfo?taskID=41514452

Comment 1 Dan Horák 2020-02-26 14:25:52 UTC
the errors start with

In file included from /usr/include/llvm/IR/Module.h:19,
                 from ../src/gallium/state_trackers/clover/llvm/codegen.hpp:35,
                 from ../src/gallium/state_trackers/clover/llvm/codegen/bitcode.cpp:34:
/usr/include/llvm/ADT/STLExtras.h:559:49: error: 'std::index_sequence' has not been declared
  559 |   template <size_t... Ns> value_type deref(std::index_sequence<Ns...>) const {
      |                                                 ^~~~~~~~~~~~~~
/usr/include/llvm/ADT/STLExtras.h:559:63: error: expected ',' or '...' before '<' token
  559 |   template <size_t... Ns> value_type deref(std::index_sequence<Ns...>) const {
      |                                                               ^
/usr/include/llvm/ADT/STLExtras.h:564:36: error: 'std::index_sequence' has not been declared
  564 |   decltype(iterators) tup_inc(std::index_sequence<Ns...>) const {
      |                                    ^~~~~~~~~~~~~~
/usr/include/llvm/ADT/STLExtras.h:564:50: error: expected ',' or '...' before '<' token
  564 |   decltype(iterators) tup_inc(std::index_sequence<Ns...>) const {
      |                                                  ^
/usr/include/llvm/ADT/STLExtras.h:569:36: error: 'std::index_sequence' has not been declared

so my first guess is a missing #include ...

Comment 2 Tom Stellard 2020-02-26 14:51:12 UTC
This looks like a bug in the mesa build.  On ppc64le it's compiling with -std=gnu++11, but on other arches it is compiling with -std=gnu++14.  LLVM uses c++14 features, so compiling with -std=gnu++11 won't work.

Comment 3 Kalev Lember 2020-02-26 16:03:43 UTC
Ahh, that makes sense. Indeed, mesa has this in meson.build:

  if host_machine.cpu_family().startswith('ppc') and cpp.compiles('''
      #if !defined(__VEC__) || !defined(__ALTIVEC__)
      #error "AltiVec not enabled"
      #endif''',
      name : 'Altivec')
    clover_cpp_std += ['cpp_std=gnu++11']
  endif

... which ends up forcing gnu++11 on ppc arches.

Comment 4 Kalev Lember 2020-02-26 16:15:47 UTC
I went ahead and hacked around this in https://src.fedoraproject.org/rpms/mesa/c/bd392f431cc481ea754581d3052959bb7454ca5b

Comment 5 Dan Horák 2020-02-26 16:52:30 UTC
(In reply to Kalev Lember from comment #3)
> Ahh, that makes sense. Indeed, mesa has this in meson.build:
> 
>   if host_machine.cpu_family().startswith('ppc') and cpp.compiles('''
>       #if !defined(__VEC__) || !defined(__ALTIVEC__)
>       #error "AltiVec not enabled"
>       #endif''',
>       name : 'Altivec')
>     clover_cpp_std += ['cpp_std=gnu++11']
>   endif
> 
> ... which ends up forcing gnu++11 on ppc arches.

which is probably from times, when the default was c++11 and using the altivec required gnu++11, because of some gnu extensions


Note You need to log in before you can comment on or make changes to this bug.