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
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 ...
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.
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.
I went ahead and hacked around this in https://src.fedoraproject.org/rpms/mesa/c/bd392f431cc481ea754581d3052959bb7454ca5b
(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