Hi, I compiled a toolchain based on LLVM/Clang v3.7.0 today and tested it with an updated version of my Linux Graphics driver stack (see attached logs).
Here on Ubuntu/precise AMD64 I required two patches (see attached 0001 and 0002) post-mesa-10.6.5+ to build it successfully. Feel free to cherry-pick them to 10.6 Git branch. Hope this helps other people. Regards, - Sedat - P.S.: My build-script is also attached.
From 80994a8a8a010b52c14d161c7fc2b5b1496e85c4 Mon Sep 17 00:00:00 2001 From: Vinson Lee <[email protected]> Date: Tue, 26 May 2015 22:18:28 -0700 Subject: [PATCH 1/2] gallivm: Do not use NoFramePointerElim with LLVM 3.7. TargetOptions::NoFramePointerElim was removed in llvm-3.7.0svn r238244 "Remove NoFramePointerElim and NoFramePointerElimOverride from TargetOptions and remove ExecutionEngine's dependence on CodeGen. NFC." Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Tom Stellard <[email protected]> --- src/gallium/auxiliary/gallivm/lp_bld_debug.cpp | 2 ++ src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp b/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp index be3e834b7748..76c302f6531e 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp +++ b/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp @@ -277,8 +277,10 @@ disassemble(const void* func, llvm::raw_ostream & Out) options.StackAlignmentOverride = 4; #endif #if defined(DEBUG) || defined(PROFILE) +#if HAVE_LLVM < 0x0307 options.NoFramePointerElim = true; #endif +#endif OwningPtr<TargetMachine> TM(T->createTargetMachine(Triple, sys::getHostCPUName(), "", options)); /* diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp index 5e8a634f0199..ffed9e6b69a1 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp +++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp @@ -439,8 +439,10 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT, #if HAVE_LLVM < 0x0304 options.NoFramePointerElimNonLeaf = true; #endif +#if HAVE_LLVM < 0x0307 options.NoFramePointerElim = true; #endif +#endif builder.setEngineKind(EngineKind::JIT) .setErrorStr(&Error) -- 2.5.1
From df6165a805b4d5863ad54337e185c0aaacd12c26 Mon Sep 17 00:00:00 2001 From: Jose Fonseca <[email protected]> Date: Thu, 28 May 2015 10:11:36 +0100 Subject: [PATCH 2/2] gallivm: Workaround LLVM PR23628. Temporarily undefine DEBUG macro while including LLVM C++ headers, leveraging the push/pop_macro pragmas, which are supported both by GCC and MSVC. https://bugs.freedesktop.org/show_bug.cgi?id=90621 Trivial. --- src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp index ffed9e6b69a1..5e25819ac557 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp +++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp @@ -50,6 +50,12 @@ #include <stddef.h> +// Workaround http://llvm.org/PR23628 +#if HAVE_LLVM >= 0x0307 +# pragma push_macro("DEBUG") +# undef DEBUG +#endif + #include <llvm-c/Core.h> #include <llvm-c/ExecutionEngine.h> #include <llvm/Target/TargetOptions.h> @@ -70,6 +76,11 @@ #include <llvm/IR/Module.h> #include <llvm/Support/CBindingWrapping.h> +// Workaround http://llvm.org/PR23628 +#if HAVE_LLVM >= 0x0307 +# pragma pop_macro("DEBUG") +#endif + #include "pipe/p_config.h" #include "util/u_debug.h" #include "util/u_cpu_detect.h" -- 2.5.1
build-and-install-log_libdrm-2-4-64_llvm-3-7-0.txt.gz
Description: GNU Zip compressed data
build-and-install-log_mesa-10-6-5-33-gb0bce4c7831f_disable-glx-tls_gallivm-fixes_llvm-3-7-0.txt.gz
Description: GNU Zip compressed data
build-and-install-log_intelddx-2-99-917-459-g300319e2044c_llvm-3-7-0.txt.gz
Description: GNU Zip compressed data
build_mesa-with-llvm.sh
Description: Bourne shell script
_______________________________________________ mesa-dev mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-dev
