[Mesa-dev] [PATCH] gallivm: Fix build against LLVM SVN >= r216982

Roland Scheidegger sroland at vmware.com
Wed Sep 3 07:10:09 PDT 2014


Oh, interesting. The patch though is

Reviewed-by: Roland Scheidegger <sroland at vmware.com>

Am 03.09.2014 04:36, schrieb Michel Dänzer:
> From: Michel Dänzer <michel.daenzer at amd.com>
> 
> Only MCJIT is available anymore.
> 
> Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
> ---
>  src/gallium/auxiliary/gallivm/lp_bld_init.c   | 9 +++++++++
>  src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 2 ++
>  2 files changed, 11 insertions(+)
> 
> diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c
> index 8b8686d..ce87b8c 100644
> --- a/src/gallium/auxiliary/gallivm/lp_bld_init.c
> +++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c
> @@ -43,6 +43,14 @@
>  #include <llvm-c/BitWriter.h>
>  
>  
> +/* Only MCJIT is available as of LLVM SVN r216982 */
> +#if HAVE_LLVM >= 0x0306
> +
> +#define USE_MCJIT 1
> +#define HAVE_AVX 1
> +
> +#else
> +
>  /**
>   * AVX is supported in:
>   * - standard JIT from LLVM 3.2 onwards
> @@ -64,6 +72,7 @@
>  #  define HAVE_AVX 0
>  #endif
>  
> +#endif /* HAVE_LLVM >= 0x0306 */
>  
>  #if USE_MCJIT
>  void LLVMLinkInMCJIT();
> diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
> index 55aa8b9..2fd85a8 100644
> --- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
> +++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
> @@ -456,7 +456,9 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT,
>            .setOptLevel((CodeGenOpt::Level)OptLevel);
>  
>     if (useMCJIT) {
> +#if HAVE_LLVM < 0x0306
>         builder.setUseMCJIT(true);
> +#endif
>  #ifdef _WIN32
>         /*
>          * MCJIT works on Windows, but currently only through ELF object format.
> 



More information about the mesa-dev mailing list