[Mesa-dev] [PATCH] Android: fix build break from nir/glsl move to compiler/

Rob Herring robh at kernel.org
Wed Feb 10 22:02:11 UTC 2016


Commits a39a8fbbaa12 ("nir: move to compiler/") and eb63640c1d38
("glsl: move to compiler/") broke Android builds. Fix them.

There is also a missing dependency between generated NIR headers and
several libraries. This isn't a new issue, but seems to have been
exposed by the NIR move.

Built with i915, i965, freedreno, r300g, r600g, vc4, and virgl enabled.

Cc: Emil Velikov <emil.velikov at collabora.com>
Cc: Mauro Rossi <issor.oruam at gmail.com>
Signed-off-by: Rob Herring <robh at kernel.org>
---
I incorporated some things I missed from Mauro's version. Also, I found 
a build dependency problem as well. I think we were just getting lucky 
before.

Rob

 Android.mk                               | 2 +-
 src/compiler/Android.gen.mk              | 4 ++++
 src/compiler/glsl/Android.gen.mk         | 2 +-
 src/compiler/glsl/Android.mk             | 3 +--
 src/gallium/auxiliary/Android.mk         | 6 ++++--
 src/gallium/drivers/freedreno/Android.mk | 4 +++-
 src/gallium/drivers/r300/Android.mk      | 1 -
 src/gallium/drivers/vc4/Android.mk       | 6 ++++--
 src/gallium/targets/dri/Android.mk       | 2 ++
 src/mesa/Android.libmesa_dricore.mk      | 1 -
 src/mesa/Android.libmesa_glsl_utils.mk   | 2 --
 src/mesa/Android.libmesa_st_mesa.mk      | 1 -
 src/mesa/Android.mesa_gen_matypes.mk     | 3 +--
 src/mesa/drivers/dri/Android.mk          | 2 ++
 src/mesa/drivers/dri/i915/Android.mk     | 3 ++-
 src/mesa/drivers/dri/i965/Android.mk     | 3 ++-
 src/mesa/program/Android.mk              | 5 +++--
 17 files changed, 30 insertions(+), 20 deletions(-)

diff --git a/Android.mk b/Android.mk
index 908078a..2c56b73 100644
--- a/Android.mk
+++ b/Android.mk
@@ -87,7 +87,7 @@ SUBDIRS := \
 	src/loader \
 	src/mapi \
 	src/compiler \
-	src/glsl \
+	src/compiler/glsl \
 	src/mesa \
 	src/util \
 	src/egl \
diff --git a/src/compiler/Android.gen.mk b/src/compiler/Android.gen.mk
index fcd5f94..96fc750 100644
--- a/src/compiler/Android.gen.mk
+++ b/src/compiler/Android.gen.mk
@@ -42,6 +42,10 @@ LOCAL_EXPORT_C_INCLUDE_DIRS += \
 LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/, \
 	$(NIR_GENERATED_FILES))
 
+# Modules using libmesa_nir must set LOCAL_GENERATED_SOURCES to this
+MESA_GEN_NIR_H := $(addprefix $(call local-generated-sources-dir)/, \
+	nir/nir_opcodes.h \
+	nir/nir_builder_opcodes.h)
 
 nir_builder_opcodes_gen := $(LOCAL_PATH)/nir/nir_builder_opcodes_h.py
 nir_builder_opcodes_deps := \
diff --git a/src/compiler/glsl/Android.gen.mk b/src/compiler/glsl/Android.gen.mk
index c5741b4..c0902b2 100644
--- a/src/compiler/glsl/Android.gen.mk
+++ b/src/compiler/glsl/Android.gen.mk
@@ -33,7 +33,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES)
 
 LOCAL_C_INCLUDES += \
 	$(intermediates)/glcpp \
-	$(MESA_TOP)/src/glsl/glcpp \
+	$(LOCAL_PATH)/glcpp \
 
 LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/, \
 	$(LIBGLCPP_GENERATED_FILES) \
diff --git a/src/compiler/glsl/Android.mk b/src/compiler/glsl/Android.mk
index 9cbb9a3..f5d96b3 100644
--- a/src/compiler/glsl/Android.mk
+++ b/src/compiler/glsl/Android.mk
@@ -36,7 +36,6 @@ include $(CLEAR_VARS)
 LOCAL_SRC_FILES := \
 	$(LIBGLCPP_FILES) \
 	$(LIBGLSL_FILES) \
-	$(NIR_FILES)
 
 LOCAL_C_INCLUDES := \
 	$(MESA_TOP)/src/mapi \
@@ -67,7 +66,7 @@ LOCAL_C_INCLUDES := \
 	$(MESA_TOP)/src/gallium/include \
 	$(MESA_TOP)/src/gallium/auxiliary
 
-LOCAL_STATIC_LIBRARIES := libmesa_glsl libmesa_glsl_utils libmesa_util
+LOCAL_STATIC_LIBRARIES := libmesa_glsl libmesa_glsl_utils libmesa_util libmesa_compiler
 
 LOCAL_MODULE_TAGS := eng
 LOCAL_MODULE := glsl_compiler
diff --git a/src/gallium/auxiliary/Android.mk b/src/gallium/auxiliary/Android.mk
index 86430eb..f5b5a0c 100644
--- a/src/gallium/auxiliary/Android.mk
+++ b/src/gallium/auxiliary/Android.mk
@@ -44,9 +44,9 @@ LOCAL_SRC_FILES += \
 LOCAL_CPPFLAGS := -std=c++11
 endif
 
-# We need libmesa_glsl to get NIR's generated include directories.
+# We need libmesa_nir to get NIR's generated include directories.
 LOCAL_MODULE := libmesa_gallium
-LOCAL_STATIC_LIBRARIES += libmesa_glsl
+LOCAL_STATIC_LIBRARIES += libmesa_nir
 
 # generate sources
 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
@@ -64,5 +64,7 @@ $(intermediates)/util/u_format_srgb.c: $(intermediates)/%.c: $(LOCAL_PATH)/%.py
 $(intermediates)/util/u_format_table.c: $(intermediates)/%.c: $(LOCAL_PATH)/%.py $(LOCAL_PATH)/util/u_format.csv
 	$(transform-generated-source)
 
+LOCAL_GENERATED_SOURCES += $(MESA_GEN_NIR_H)
+
 include $(GALLIUM_COMMON_MK)
 include $(BUILD_STATIC_LIBRARY)
diff --git a/src/gallium/drivers/freedreno/Android.mk b/src/gallium/drivers/freedreno/Android.mk
index ed51835..8c1ab08 100644
--- a/src/gallium/drivers/freedreno/Android.mk
+++ b/src/gallium/drivers/freedreno/Android.mk
@@ -38,8 +38,10 @@ LOCAL_CFLAGS := \
 LOCAL_C_INCLUDES := \
 	$(LOCAL_PATH)/ir3
 
+LOCAL_GENERATED_SOURCES := $(MESA_GEN_NIR_H)
+
 LOCAL_SHARED_LIBRARIES := libdrm libdrm_freedreno
-LOCAL_STATIC_LIBRARIES := libmesa_glsl
+LOCAL_STATIC_LIBRARIES := libmesa_glsl libmesa_nir
 LOCAL_MODULE := libmesa_pipe_freedreno
 
 include $(GALLIUM_COMMON_MK)
diff --git a/src/gallium/drivers/r300/Android.mk b/src/gallium/drivers/r300/Android.mk
index 7ff4f86..bb31519 100644
--- a/src/gallium/drivers/r300/Android.mk
+++ b/src/gallium/drivers/r300/Android.mk
@@ -32,7 +32,6 @@ LOCAL_SRC_FILES := $(C_SOURCES)
 
 LOCAL_C_INCLUDES := \
 	$(MESA_TOP)/src/mapi \
-	$(MESA_TOP)/src/glsl \
 	$(MESA_TOP)/src/mesa
 
 
diff --git a/src/gallium/drivers/vc4/Android.mk b/src/gallium/drivers/vc4/Android.mk
index f42a152..2efb472 100644
--- a/src/gallium/drivers/vc4/Android.mk
+++ b/src/gallium/drivers/vc4/Android.mk
@@ -28,9 +28,11 @@ include $(CLEAR_VARS)
 LOCAL_SRC_FILES := \
 	$(C_SOURCES)
 
+LOCAL_GENERATED_SOURCES := $(MESA_GEN_NIR_H)
+
 LOCAL_SHARED_LIBRARIES := libdrm
-# We need libmesa_glsl to get NIR's generated include directories.
-LOCAL_STATIC_LIBRARIES := libmesa_glsl
+# We need libmesa_nir to get NIR's generated include directories.
+LOCAL_STATIC_LIBRARIES := libmesa_nir
 LOCAL_MODULE := libmesa_pipe_vc4
 
 include $(GALLIUM_COMMON_MK)
diff --git a/src/gallium/targets/dri/Android.mk b/src/gallium/targets/dri/Android.mk
index 2a7738e..4acd093 100644
--- a/src/gallium/targets/dri/Android.mk
+++ b/src/gallium/targets/dri/Android.mk
@@ -109,6 +109,8 @@ LOCAL_WHOLE_STATIC_LIBRARIES := \
 	libmesa_st_dri \
 	libmesa_st_mesa \
 	libmesa_glsl \
+	libmesa_compiler \
+	libmesa_nir \
 	libmesa_dri_common \
 	libmesa_megadriver_stub \
 	libmesa_gallium \
diff --git a/src/mesa/Android.libmesa_dricore.mk b/src/mesa/Android.libmesa_dricore.mk
index ba952da..a3e6c6d 100644
--- a/src/mesa/Android.libmesa_dricore.mk
+++ b/src/mesa/Android.libmesa_dricore.mk
@@ -59,7 +59,6 @@ endif
 LOCAL_C_INCLUDES := \
 	$(MESA_TOP)/src/mapi \
 	$(MESA_TOP)/src/mesa/main \
-	$(MESA_TOP)/src/glsl \
 	$(MESA_TOP)/src/compiler/nir \
 	$(MESA_TOP)/src/gallium/include \
 	$(MESA_TOP)/src/gallium/auxiliary
diff --git a/src/mesa/Android.libmesa_glsl_utils.mk b/src/mesa/Android.libmesa_glsl_utils.mk
index 894ae20..5a80f22 100644
--- a/src/mesa/Android.libmesa_glsl_utils.mk
+++ b/src/mesa/Android.libmesa_glsl_utils.mk
@@ -36,7 +36,6 @@ include $(CLEAR_VARS)
 LOCAL_MODULE := libmesa_glsl_utils
 
 LOCAL_C_INCLUDES := \
-	$(MESA_TOP)/src/glsl \
 	$(MESA_TOP)/src/compiler/nir \
 	$(MESA_TOP)/src/mapi \
 	$(MESA_TOP)/src/gallium/include \
@@ -62,7 +61,6 @@ LOCAL_IS_HOST_MODULE := true
 LOCAL_CFLAGS := -D_POSIX_C_SOURCE=199309L
 
 LOCAL_C_INCLUDES := \
-	$(MESA_TOP)/src/glsl \
 	$(MESA_TOP)/src/compiler/nir \
 	$(MESA_TOP)/src/mapi \
 	$(MESA_TOP)/src/gallium/include \
diff --git a/src/mesa/Android.libmesa_st_mesa.mk b/src/mesa/Android.libmesa_st_mesa.mk
index ee8887b..9fd9460 100644
--- a/src/mesa/Android.libmesa_st_mesa.mk
+++ b/src/mesa/Android.libmesa_st_mesa.mk
@@ -54,7 +54,6 @@ endif
 LOCAL_C_INCLUDES := \
 	$(MESA_TOP)/src/mapi \
 	$(MESA_TOP)/src/mesa/main \
-	$(MESA_TOP)/src/glsl \
 	$(MESA_TOP)/src/compiler/nir \
 	$(MESA_TOP)/src/gallium/auxiliary \
 	$(MESA_TOP)/src/gallium/include
diff --git a/src/mesa/Android.mesa_gen_matypes.mk b/src/mesa/Android.mesa_gen_matypes.mk
index 6e301f9..4fcf73a 100644
--- a/src/mesa/Android.mesa_gen_matypes.mk
+++ b/src/mesa/Android.mesa_gen_matypes.mk
@@ -35,8 +35,7 @@ LOCAL_MODULE := mesa_gen_matypes
 LOCAL_IS_HOST_MODULE := true
 
 LOCAL_C_INCLUDES := \
-	$(MESA_TOP)/src/mapi \
-	$(MESA_TOP)/src/glsl
+	$(MESA_TOP)/src/mapi
 
 LOCAL_SRC_FILES := \
 	x86/gen_matypes.c
diff --git a/src/mesa/drivers/dri/Android.mk b/src/mesa/drivers/dri/Android.mk
index 42bfd77..1789762 100644
--- a/src/mesa/drivers/dri/Android.mk
+++ b/src/mesa/drivers/dri/Android.mk
@@ -42,6 +42,8 @@ MESA_DRI_C_INCLUDES := \
 
 MESA_DRI_WHOLE_STATIC_LIBRARIES := \
 	libmesa_glsl \
+	libmesa_compiler \
+	libmesa_nir \
 	libmesa_megadriver_stub \
 	libmesa_dri_common \
 	libmesa_dricore \
diff --git a/src/mesa/drivers/dri/i915/Android.mk b/src/mesa/drivers/dri/i915/Android.mk
index 741ea26..b95d5c1 100644
--- a/src/mesa/drivers/dri/i915/Android.mk
+++ b/src/mesa/drivers/dri/i915/Android.mk
@@ -54,7 +54,8 @@ LOCAL_SHARED_LIBRARIES := \
 	libdrm_intel
 
 LOCAL_GENERATED_SOURCES := \
-	$(MESA_DRI_OPTIONS_H)
+	$(MESA_DRI_OPTIONS_H) \
+	$(MESA_GEN_NIR_H)
 
 include $(MESA_COMMON_MK)
 include $(BUILD_SHARED_LIBRARY)
diff --git a/src/mesa/drivers/dri/i965/Android.mk b/src/mesa/drivers/dri/i965/Android.mk
index d30a053..4f2e6db 100644
--- a/src/mesa/drivers/dri/i965/Android.mk
+++ b/src/mesa/drivers/dri/i965/Android.mk
@@ -59,7 +59,8 @@ LOCAL_SHARED_LIBRARIES := \
 	libdrm_intel
 
 LOCAL_GENERATED_SOURCES := \
-	$(MESA_DRI_OPTIONS_H)
+	$(MESA_DRI_OPTIONS_H) \
+	$(MESA_GEN_NIR_H)
 
 include $(MESA_COMMON_MK)
 include $(BUILD_SHARED_LIBRARY)
diff --git a/src/mesa/program/Android.mk b/src/mesa/program/Android.mk
index 0bc97a6..6f48543 100644
--- a/src/mesa/program/Android.mk
+++ b/src/mesa/program/Android.mk
@@ -44,7 +44,7 @@ include $(CLEAR_VARS)
 
 LOCAL_MODULE := libmesa_program
 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
-LOCAL_STATIC_LIBRARIES := libmesa_glsl
+LOCAL_STATIC_LIBRARIES := libmesa_nir
 
 intermediates := $(call local-generated-sources-dir)
 
@@ -74,12 +74,13 @@ $(intermediates)/program/lex.yy.c: $(LOCAL_PATH)/program_lexer.l
 LOCAL_C_INCLUDES := \
 	$(MESA_TOP)/src/mapi \
 	$(MESA_TOP)/src/mesa \
-	$(MESA_TOP)/src/glsl \
 	$(MESA_TOP)/src/compiler/nir \
 	$(MESA_TOP)/src/gallium/auxiliary \
 	$(MESA_TOP)/src/gallium/include
 
 LOCAL_EXPORT_C_INCLUDE_DIRS := $(intermediates)
 
+LOCAL_GENERATED_SOURCES += $(MESA_GEN_NIR_H)
+
 include $(MESA_COMMON_MK)
 include $(BUILD_STATIC_LIBRARY)
-- 
2.5.0



More information about the mesa-dev mailing list