android: mesa: revert "Enable asm unconditionally"
authorMauro Rossi <issor.oruam@gmail.com>
Sun, 14 Jul 2019 08:53:19 +0000 (10:53 +0200)
committerMauro Rossi <issor.oruam@gmail.com>
Fri, 6 Sep 2019 06:48:28 +0000 (08:48 +0200)
This patch partially reverts 20294dc ("mesa: Enable asm unconditionally, ...")

Android makefile build logic needs to disable assembler optimization
in 32bit builds to avoid text relocations for libglapi.so shared

Fixes the following build error with Android x86 32bit target:

[  0% 4/477] target SharedLib: libglapi (out/target/product/x86/obj/SHARED_LIBRARIES/libglapi_intermediates/LINKED/libglapi.so)
FAILED: out/target/product/x86/obj/SHARED_LIBRARIES/libglapi_intermediates/LINKED/libglapi.so
...
prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9/x86_64-linux-android/bin/ld: warning: shared library text segment is not shareable
prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9/x86_64-linux-android/bin/ld: error: treating warnings as errors
clang-6.0: error: linker command failed with exit code 1 (use -v to see invocation)

Fixes: 20294dc ("mesa: Enable asm unconditionally, now that gen_matypes is gone.")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Acked-by: Eric Engestrom <eric@engestrom.ch>
Android.common.mk
Android.mk
src/mesa/Android.libmesa_dricore.mk
src/mesa/Android.libmesa_st_mesa.mk

index 825b60381d0832bce1cdf4c7fb0ca9283a3e967c..327f13f5a38047300f7431bd0f4d0cef1b2f1ded 100644 (file)
@@ -103,9 +103,12 @@ ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 26 && echo true),true)
 LOCAL_CFLAGS += -DHAVE_SYS_SHM_H
 endif
 
+ifeq ($(strip $(MESA_ENABLE_ASM)),true)
 ifeq ($(TARGET_ARCH),x86)
 LOCAL_CFLAGS += \
        -DUSE_X86_ASM
+
+endif
 endif
 ifeq ($(ARCH_ARM_HAVE_NEON),true)
 LOCAL_CFLAGS_arm += -DUSE_ARM_ASM
index 76d26f9bd83043dfad624fd4887dac118fefaf59..e86c9bd510a5519ae59998d0ab3457f14317d76e 100644 (file)
@@ -83,6 +83,13 @@ endif
 
 $(foreach d, $(MESA_BUILD_CLASSIC) $(MESA_BUILD_GALLIUM), $(eval $(d) := true))
 
+# host and target must be the same arch to generate matypes.h
+ifeq ($(TARGET_ARCH),$(HOST_ARCH))
+MESA_ENABLE_ASM := true
+else
+MESA_ENABLE_ASM := false
+endif
+
 ifneq ($(filter true, $(HAVE_GALLIUM_RADEONSI)),)
 MESA_ENABLE_LLVM := true
 endif
index 8eb6aabe836f35f2c9bcc14112583ef0bb4e0bec..792117767b46abbdfed7b0cc1be0a9b5b3dbe759 100644 (file)
@@ -39,9 +39,11 @@ LOCAL_MODULE_CLASS := STATIC_LIBRARIES
 LOCAL_SRC_FILES := \
        $(MESA_FILES)
 
+ifeq ($(strip $(MESA_ENABLE_ASM)),true)
 ifeq ($(TARGET_ARCH),x86)
        LOCAL_SRC_FILES += $(X86_FILES)
 endif # x86
+endif # MESA_ENABLE_ASM
 
 ifeq ($(ARCH_X86_HAVE_SSE4_1),true)
 LOCAL_WHOLE_STATIC_LIBRARIES := \
index 16153a3c5bde01b1533350cffd5df6bc96c0fff5..ddfd03059c59ed77e49ee4218f00efc84dcd8c8a 100644 (file)
@@ -42,9 +42,11 @@ LOCAL_GENERATED_SOURCES := \
        $(MESA_GEN_GLSL_H) \
        $(MESA_GEN_NIR_H)
 
+ifeq ($(strip $(MESA_ENABLE_ASM)),true)
 ifeq ($(TARGET_ARCH),x86)
        LOCAL_SRC_FILES += $(X86_FILES)
 endif # x86
+endif # MESA_ENABLE_ASM
 
 ifeq ($(ARCH_X86_HAVE_SSE4_1),true)
 LOCAL_WHOLE_STATIC_LIBRARIES := \