[FTBFS][build/meson] LLVM 16 requires C++17
Describe the issue
Building Mesa with clover
enabled fails since llvm/llvm-project commit b4e9977fc18405d4a11cbaf1975bcadbf75920b8, because it removed the C++17 #ifdef
s.
The problem is caused by the invocation of the clang_test_code
in src/gallium/targets/opencl/meson.build
with -std=c++14
instead of -std=c++17
.
The the clang_test_code
from src/gallium/targets/opencl/meson.build
clang_test_code = '''
#include <clang/Basic/Version.h>
int main (void) {
size_t found_pos = clang::getClangFullVersion().find(CLANG_VERSION_STRING);
return found_pos == ::std::string::npos ? 1 : 0;
}
'''
needs to be invoked with C++17 and of course later on Mesa (or at least clover
) needs to be built with C++17 too.
This should also affect all other LLVM users in Mesa, but my build hit this test first, so this is what showed up as an error.
Regression
This is a regression with LLVM 16 and upwards, though no code change in Mesa caused it. It is caused by the external LLVM dependency.