[Mesa-dev] [PATCH] clover: Fix build against clang SVN >= r293097

Michel Dänzer michel at daenzer.net
Thu Jan 26 08:42:05 UTC 2017


From: Michel Dänzer <michel.daenzer at amd.com>

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---

Not sure if PropagateAttrs should be set to true or false. Setting it to
true because clang SVN r293097 does so for CUDA, and there are no piglit
quick_cl regressions with radeonsi on Kaveri.

 src/gallium/state_trackers/clover/llvm/compat.hpp | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/gallium/state_trackers/clover/llvm/compat.hpp b/src/gallium/state_trackers/clover/llvm/compat.hpp
index 81592ce702..906367b314 100644
--- a/src/gallium/state_trackers/clover/llvm/compat.hpp
+++ b/src/gallium/state_trackers/clover/llvm/compat.hpp
@@ -83,7 +83,14 @@ namespace clover {
          inline void
          add_link_bitcode_file(clang::CodeGenOptions &opts,
                                const std::string &path) {
-#if HAVE_LLVM >= 0x0308
+#if HAVE_LLVM >= 0x0500
+            clang::CodeGenOptions::BitcodeFileToLink F;
+
+            F.Filename = path;
+            F.PropagateAttrs = true;
+            F.LinkFlags = ::llvm::Linker::Flags::None;
+            opts.LinkBitcodeFiles.emplace_back(F);
+#elif HAVE_LLVM >= 0x0308
             opts.LinkBitcodeFiles.emplace_back(::llvm::Linker::Flags::None, path);
 #else
             opts.LinkBitcodeFile = path;
-- 
2.11.0



More information about the mesa-dev mailing list