[Mesa-dev] [PATCH 4/8] android: fix llvmpipe build

Jose Fonseca jfonseca at vmware.com
Wed Jan 11 19:19:47 UTC 2017


On 10/01/17 15:54, Emil Velikov wrote:
> On 6 January 2017 at 17:35, Wu Zhen <wuzhen at jidemail.com> wrote:
>> From: WuZhen <wuzhen at jidemail.com>
>>
>> since (cf410574 gallivm: Make MCJIT a runtime optioni.), llvmpipe assume
>> MCJIT is available on x86(_64). this is not the case for android prior to M.
>>
> Wu Zhen, what exactly is the issue you're getting - build or link-time error ?
>
> Looking at the hunk [1] in the offending commit makes me wonder.
>  - Why do we call LLVMLinkInJIT() even if one selects MCJIT via the env var.
>  - Why do we always call LLVMLinkInMCJIT regardless of a) if we've
> build against old LLVM and b) the env var.
>
> Jose, shouldn't we honour the above ? One way that comes to mind is to
> have USE_MCJIT always as static variable. Then we can guard the
> debug_get_bool_option() override with the current LLVM_VERSION/ARCH
> heuristics while preserving original invocation.
>
> if (USE_MCJIT) // use lowercase name since it's not a macro ?
>    LLVMLinkInMCJIT();
> else
>    LLVMLinkInJIT();
>
>
> Thanks
> Emil
>
> [1]
> @@ -385,18 +382,18 @@ lp_build_init(void)
>    if (gallivm_initialized)
>       return TRUE;
>
> +   LLVMLinkInMCJIT();
> +#if !defined(USE_MCJIT)
> +   USE_MCJIT = debug_get_bool_option("GALLIVM_MCJIT", 0);
> +   LLVMLinkInJIT();
> +#endif
> +
> #ifdef DEBUG
>    gallivm_debug = debug_get_option_gallivm_debug();
> #endif
>
>    lp_set_target_options();
>
> -#if USE_MCJIT
> -   LLVMLinkInMCJIT();
> -#else
> -   LLVMLinkInJIT();
> -#endif
> -
>

USE_MCJIT used to be a statically define macro, but it's now it can also 
be runtime boolean.

We require LLVM 3.3, and MCJIT has been available since then, so there 
was no reason not to link.

Android seems a new beast: it has LLVM 3.3 but not MCJIT??

Jose


More information about the mesa-dev mailing list