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

Wu Zhen wuzhen at jidemail.com
Fri Jan 6 17:35:05 UTC 2017


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.

Change-Id: I6c82915b043f65e15ffc73aecff6779a1d02f1f1
Reviewed-by: Mauro Rossi <issor.oruam at gmail.com>
Reviewed-by: Chih-Wei Huang <cwhuang at linux.org.tw>
---
 Android.common.mk                           |  1 +
 src/gallium/auxiliary/gallivm/lp_bld_init.c | 12 ++++++++++--
 src/mesa/Android.libmesa_st_mesa.mk         |  9 ++++++++-
 3 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/Android.common.mk b/Android.common.mk
index 7ab3942ee2..cb2a4e6104 100644
--- a/Android.common.mk
+++ b/Android.common.mk
@@ -59,6 +59,7 @@ LOCAL_CFLAGS += \
 	-DHAVE___BUILTIN_UNREACHABLE \
 	-DHAVE_PTHREAD=1 \
 	-DHAVE_DLOPEN \
+	-DHAVE_ANDROID_PLATFORM \
 	-fvisibility=hidden \
 	-Wno-sign-compare
 
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c
index d1b2369f34..a378f0c850 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_init.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c
@@ -46,6 +46,8 @@
 /* Only MCJIT is available as of LLVM SVN r216982 */
 #if HAVE_LLVM >= 0x0306
 #  define USE_MCJIT 1
+#elif defined(HAVE_ANDROID_PLATFORM)
+#  define USE_MCJIT 0
 #elif defined(PIPE_ARCH_PPC_64) || defined(PIPE_ARCH_S390) || defined(PIPE_ARCH_ARM) || defined(PIPE_ARCH_AARCH64)
 #  define USE_MCJIT 1
 #else
@@ -395,9 +397,15 @@ lp_build_init(void)
    if (gallivm_initialized)
       return TRUE;
 
-   LLVMLinkInMCJIT();
-#if !defined(USE_MCJIT)
+#ifdef USE_MCJIT
+   #if USE_MCJIT
+      LLVMLinkInMCJIT();
+   #else
+      LLVMLinkInJIT();
+   #endif
+#else
    USE_MCJIT = debug_get_bool_option("GALLIVM_MCJIT", 0);
+   LLVMLinkInMCJIT();
    LLVMLinkInJIT();
 #endif
 
diff --git a/src/mesa/Android.libmesa_st_mesa.mk b/src/mesa/Android.libmesa_st_mesa.mk
index 90e4ccd210..d9b4129315 100644
--- a/src/mesa/Android.libmesa_st_mesa.mk
+++ b/src/mesa/Android.libmesa_st_mesa.mk
@@ -67,7 +67,14 @@ LOCAL_WHOLE_STATIC_LIBRARIES += \
 
 LOCAL_STATIC_LIBRARIES += libmesa_nir libmesa_glsl
 
-include external/libcxx/libcxx.mk
+ifeq ($(MESA_LOLLIPOP_BUILD),true)
+-include external/libcxx/libcxx.mk
+LOCAL_CXX_STL := libc++
+else
+include external/stlport/libstlport.mk
+endif
+
+
 include $(LOCAL_PATH)/Android.gen.mk
 include $(MESA_COMMON_MK)
 include $(BUILD_STATIC_LIBRARY)
-- 
2.11.0



More information about the mesa-dev mailing list