Summary: | media-libs/mesa[opencl] fails to build with sys-devel/clang[default-libcxx] | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Haelwenn (lanodan) Monnier <contact> |
Component: | Current packages | Assignee: | Gentoo X packagers <x11> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | bugs.gentoo.org, jstein, llvm, mgorny |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 836220 | ||
Attachments: |
lzma /var/tmp/portage/media-libs/mesa-18.3.6/temp/build.log
/var/tmp/portage/media-libs/mesa-18.3.6/temp/build.log.lzma: CXX="clang++ -stdlib=libc++" patch xz media-libs:mesa-9999:20191009-224356.log |
Description
Haelwenn (lanodan) Monnier
2019-05-12 05:33:16 UTC
Created attachment 576090 [details]
lzma /var/tmp/portage/media-libs/mesa-18.3.6/temp/build.log
Please make it more apparent that you're building with clang in future reports. The relevant error from the log is In file included from ../mesa-18.3.6/src/gallium/state_trackers/clover/llvm/invocation.cpp:52: ../mesa-18.3.6/src/gallium/state_trackers/clover/llvm/metadata.hpp:45:23: error: no matching constructor for initialization of 'std::vector<const ::llvm::MDNode *>' return { n->op_begin(), n->op_end() }; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/v1/vector:495:5: note: candidate constructor not viable: no known conversion from 'llvm::NamedMDNode::const_op_iterator' (aka 'op_iterator_impl<const llvm::MDNode *, llvm::MDNode>') to 'std::__1::vector<const llvm::MDNode *, std::__1::allocator<const llvm::MDNode *> >::size_type' (aka 'unsigned int') for 1st argument vector(size_type __n, const_reference __x); ^ /me shrugs Does it build with clang-7.1? >Please make it more apparent that you're building with clang in future reports. Sorry, will try to for next times. >Does it build with clang-7.1? Nah, still doesn't build, the error is the same (did a diff). USE=... default-libcxx ... libcxx Could this be the culprit? Can you try without those? I tried with both CXX="clang++ -stdlib=libstdc++" and reverting the USE flags you mentionned and I'm getting some: undefined reference to `_Unwind_Resume' from nowhere, and installing llvm-libunwind or libunwind (which I didn't have because it often caused horrible issues due to the name conflict) doesn't solves it. Okay, I cleaned my LLVM/Clang toolchain (removed USE="default-compiler-rt" too, builded llvm+clang 6 with gcc and then llvm+clang 7.1 with clang-6). And I can confirm that mesa[opencl] builds fine with llvm+clang 7.1 and llvm+clang 6. I guess C(XX)FLAGS instead of the USE="default-compiler-rt default-libcxx" should be recommended instead. Okay, so either 1) the Mesa code isn't correct and still works with libstdc++ for some reason; or 2) libc++ has a bug Would be nice to test it against 8.0.0. (sorry, no resources here) Created attachment 580334 [details]
/var/tmp/portage/media-libs/mesa-18.3.6/temp/build.log.lzma: CXX="clang++ -stdlib=libc++"
Sorry, I don't really have the ressources to have basically another gentoo setup with 8.0 to still keep on using 7.1 everywhere in a clean way.
Anyway if it can help, on the same machine and clean toolchain but CXX="clang++ -stdlib=libc++" I get a log which seems quite similar.
media-libs/mesa-18.3.6 still fails with Clang 8 + libcxx 8. Oooh! Please try this patch: https://gitlab.freedesktop.org/mesa/mesa/merge_requests/1598.patch (specifically patch 2/4) Created attachment 592354 [details, diff]
patch
Better yet, try this.
On which version of mesa should I apply it, -9999? I tried on media-libs/mesa-19.1.7::gentoo and I got "1 out of 1 hunk FAILED -- saving rejects to file src/gallium/state_trackers/clover/llvm/metadata.hpp.rej". (In reply to Haelwenn Monnier from comment #13) > On which version of mesa should I apply it, -9999? I tried on > media-libs/mesa-19.1.7::gentoo and I got "1 out of 1 hunk FAILED -- saving > rejects to file src/gallium/state_trackers/clover/llvm/metadata.hpp.rej". The attached patches are already in upstream git, so if you can successfully compile -9999 then we're good. Otherwise, I'd try applying them to 19.2.x. Created attachment 592356 [details]
xz media-libs:mesa-9999:20191009-224356.log
Failed to build but my environment isn't exactly clean right now, attached the build.log anyway.
Will retry after I clean things up.
This is fixed in 19.3. |