Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1803351

Summary: mesa builds fail with llvm 10.0.0 rc1/rc2 on ppc64le
Product: [Fedora] Fedora Reporter: Pete Walter <walter.pete>
Component: llvmAssignee: Tom Stellard <tstellar>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 32CC: ajax, dan, dmalcolm, jakub, jistone, klember, scottt.tw, sean, sguelton, siddharth.kde, tstellar
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: mesa-20.0.0-2.fc32 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-02-26 17:05:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1071880    

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