<div dir="ltr"><div dir="ltr">Hi,</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Aug 13, 2019 at 3:51 PM Tapani Pälli <<a href="mailto:tapani.palli@intel.com">tapani.palli@intel.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
On 8/13/19 3:32 PM, Mauro Rossi wrote:<br>
> Hi,<br>
> <br>
> On Tue, Aug 13, 2019 at 2:03 PM Tapani Pälli <<a href="mailto:tapani.palli@intel.com" target="_blank">tapani.palli@intel.com</a> <br>
> <mailto:<a href="mailto:tapani.palli@intel.com" target="_blank">tapani.palli@intel.com</a>>> wrote:<br>
> <br>
>     Hi;<br>
> <br>
>     On 8/13/19 2:43 PM, Mauro Rossi wrote:<br>
>      > Hi Tapani,<br>
>      ><br>
>      > On Sat, Jul 27, 2019 at 2:56 PM Mauro Rossi<br>
>     <<a href="mailto:issor.oruam@gmail.com" target="_blank">issor.oruam@gmail.com</a> <mailto:<a href="mailto:issor.oruam@gmail.com" target="_blank">issor.oruam@gmail.com</a>><br>
>      > <mailto:<a href="mailto:issor.oruam@gmail.com" target="_blank">issor.oruam@gmail.com</a> <mailto:<a href="mailto:issor.oruam@gmail.com" target="_blank">issor.oruam@gmail.com</a>>>> wrote:<br>
>      ><br>
>      >     On Sat, Jul 27, 2019 at 2:56 PM Mauro Rossi<br>
>     <<a href="mailto:issor.oruam@gmail.com" target="_blank">issor.oruam@gmail.com</a> <mailto:<a href="mailto:issor.oruam@gmail.com" target="_blank">issor.oruam@gmail.com</a>><br>
>      >     <mailto:<a href="mailto:issor.oruam@gmail.com" target="_blank">issor.oruam@gmail.com</a><br>
>     <mailto:<a href="mailto:issor.oruam@gmail.com" target="_blank">issor.oruam@gmail.com</a>>>> wrote:<br>
>      >      ><br>
>      >      > On Thu, Jul 18, 2019 at 1:07 PM Chih-Wei Huang<br>
>      >     <<a href="mailto:cwhuang@android-x86.org" target="_blank">cwhuang@android-x86.org</a> <mailto:<a href="mailto:cwhuang@android-x86.org" target="_blank">cwhuang@android-x86.org</a>><br>
>     <mailto:<a href="mailto:cwhuang@android-x86.org" target="_blank">cwhuang@android-x86.org</a> <mailto:<a href="mailto:cwhuang@android-x86.org" target="_blank">cwhuang@android-x86.org</a>>>><br>
>     wrote:<br>
>      >      > ><br>
>      >      > > Mauro Rossi <<a href="mailto:issor.oruam@gmail.com" target="_blank">issor.oruam@gmail.com</a><br>
>     <mailto:<a href="mailto:issor.oruam@gmail.com" target="_blank">issor.oruam@gmail.com</a>><br>
>      >     <mailto:<a href="mailto:issor.oruam@gmail.com" target="_blank">issor.oruam@gmail.com</a><br>
>     <mailto:<a href="mailto:issor.oruam@gmail.com" target="_blank">issor.oruam@gmail.com</a>>>> 於 2019年7月14日 週日 下午5:17寫道:<br>
>      >      > > ><br>
>      >      > > > This patch partially reverts 20294dc ("mesa: Enable asm<br>
>      >     unconditionally, ...")<br>
>      >      > > ><br>
>      >      > > > Android makefile build logic needs to disable assembler<br>
>      >     optimization<br>
>      >      > > > in 32bit builds to avoid text relocations for<br>
>     libglapi.so shared<br>
>      >      > > ><br>
>      >      > > > Fixes the following build error with Android x86 32bit<br>
>     target:<br>
>      >      > > ><br>
>      >      > > > [  0% 4/477] target SharedLib: libglapi<br>
>      >   <br>
>       (out/target/product/x86/obj/SHARED_LIBRARIES/libglapi_intermediates/LINKED/libglapi.so)<br>
>      >      > > > FAILED:<br>
>      >   <br>
>       out/target/product/x86/obj/SHARED_LIBRARIES/libglapi_intermediates/LINKED/libglapi.so<br>
>      >      > > > ...<br>
>      >      > > ><br>
>      >   <br>
>       prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9/x86_64-linux-android/bin/ld:<br>
>      >     warning: shared library text segment is not shareable<br>
>      >      > > ><br>
>      >   <br>
>       prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9/x86_64-linux-android/bin/ld:<br>
>      >     error: treating warnings as errors<br>
>      >      > > > clang-6.0: error: linker command failed with exit code<br>
>     1 (use<br>
>      >     -v to see invocation)<br>
>      >      > > ><br>
>      >      > > > Fixes: 20294dc ("mesa: Enable asm unconditionally, now<br>
>     that<br>
>      >     gen_matypes is gone.")<br>
>      >      > > > Signed-off-by: Mauro Rossi <<a href="mailto:issor.oruam@gmail.com" target="_blank">issor.oruam@gmail.com</a><br>
>     <mailto:<a href="mailto:issor.oruam@gmail.com" target="_blank">issor.oruam@gmail.com</a>><br>
>      >     <mailto:<a href="mailto:issor.oruam@gmail.com" target="_blank">issor.oruam@gmail.com</a> <mailto:<a href="mailto:issor.oruam@gmail.com" target="_blank">issor.oruam@gmail.com</a>>>><br>
>      >      > > > ---<br>
>      >      > > > <a href="http://Android.common.mk" rel="noreferrer" target="_blank">Android.common.mk</a> <<a href="http://Android.common.mk" rel="noreferrer" target="_blank">http://Android.common.mk</a>><br>
>     <<a href="http://Android.common.mk" rel="noreferrer" target="_blank">http://Android.common.mk</a>><br>
>      >       | 3 +++<br>
>      >      > > >  Android.mk                          | 7 +++++++<br>
>      >      > > >  src/mesa/<a href="http://Android.libmesa_dricore.mk" rel="noreferrer" target="_blank">Android.libmesa_dricore.mk</a><br>
>     <<a href="http://Android.libmesa_dricore.mk" rel="noreferrer" target="_blank">http://Android.libmesa_dricore.mk</a>><br>
>      >     <<a href="http://Android.libmesa_dricore.mk" rel="noreferrer" target="_blank">http://Android.libmesa_dricore.mk</a>> | 2 ++<br>
>      >      > > >  src/mesa/<a href="http://Android.libmesa_st_mesa.mk" rel="noreferrer" target="_blank">Android.libmesa_st_mesa.mk</a><br>
>     <<a href="http://Android.libmesa_st_mesa.mk" rel="noreferrer" target="_blank">http://Android.libmesa_st_mesa.mk</a>><br>
>      >     <<a href="http://Android.libmesa_st_mesa.mk" rel="noreferrer" target="_blank">http://Android.libmesa_st_mesa.mk</a>> | 2 ++<br>
>      >      > > >  4 files changed, 14 insertions(+)<br>
>      >      > > ><br>
>      >      > > > diff --git a/<a href="http://Android.common.mk" rel="noreferrer" target="_blank">Android.common.mk</a><br>
>     <<a href="http://Android.common.mk" rel="noreferrer" target="_blank">http://Android.common.mk</a>> <<a href="http://Android.common.mk" rel="noreferrer" target="_blank">http://Android.common.mk</a>><br>
>      >     b/<a href="http://Android.common.mk" rel="noreferrer" target="_blank">Android.common.mk</a> <<a href="http://Android.common.mk" rel="noreferrer" target="_blank">http://Android.common.mk</a>><br>
>     <<a href="http://Android.common.mk" rel="noreferrer" target="_blank">http://Android.common.mk</a>><br>
>      >      > > > index 8a1c734353..209654bb75 100644<br>
>      >      > > > --- a/<a href="http://Android.common.mk" rel="noreferrer" target="_blank">Android.common.mk</a> <<a href="http://Android.common.mk" rel="noreferrer" target="_blank">http://Android.common.mk</a>><br>
>     <<a href="http://Android.common.mk" rel="noreferrer" target="_blank">http://Android.common.mk</a>><br>
>      >      > > > +++ b/<a href="http://Android.common.mk" rel="noreferrer" target="_blank">Android.common.mk</a> <<a href="http://Android.common.mk" rel="noreferrer" target="_blank">http://Android.common.mk</a>><br>
>     <<a href="http://Android.common.mk" rel="noreferrer" target="_blank">http://Android.common.mk</a>><br>
>      >      > > > @@ -106,9 +106,12 @@ ifeq ($(shell test<br>
>      >     $(PLATFORM_SDK_VERSION) -ge 26 && echo true),true)<br>
>      >      > > >  LOCAL_CFLAGS += -DHAVE_SYS_SHM_H<br>
>      >      > > >  endif<br>
>      >      > > ><br>
>      >      > > > +ifeq ($(strip $(MESA_ENABLE_ASM)),true)<br>
>      >      > > >  ifeq ($(TARGET_ARCH),x86)<br>
>      >      > > >  LOCAL_CFLAGS += \<br>
>      >      > > >         -DUSE_X86_ASM<br>
>      >      > > > +<br>
>      >      > > > +endif<br>
>      >      > > >  endif<br>
>      >      > > >  ifeq ($(ARCH_ARM_HAVE_NEON),true)<br>
>      >      > > >  LOCAL_CFLAGS_arm += -DUSE_ARM_ASM<br>
>      >      > > > diff --git a/Android.mk b/Android.mk<br>
>      >      > > > index 57613eccfc..4a2a003ea3 100644<br>
>      >      > > > --- a/Android.mk<br>
>      >      > > > +++ b/Android.mk<br>
>      >      > > > @@ -83,6 +83,13 @@ endif<br>
>      >      > > ><br>
>      >      > > >  $(foreach d, $(MESA_BUILD_CLASSIC) $(MESA_BUILD_GALLIUM),<br>
>      >     $(eval $(d) := true))<br>
>      >      > > ><br>
>      >      > > > +# host and target must be the same arch to generate<br>
>     matypes.h<br>
>      >      > > > +ifeq ($(TARGET_ARCH),$(HOST_ARCH))<br>
>      >      > > > +MESA_ENABLE_ASM := true<br>
>      >      > > > +else<br>
>      >      > > > +MESA_ENABLE_ASM := false<br>
>      >      > > > +endif<br>
>      >      > > > +<br>
>      >      > > >  ifneq ($(filter true, $(HAVE_GALLIUM_RADEONSI)),)<br>
>      >      > > >  MESA_ENABLE_LLVM := true<br>
>      >      > > >  endif<br>
>      >      > > > diff --git a/src/mesa/<a href="http://Android.libmesa_dricore.mk" rel="noreferrer" target="_blank">Android.libmesa_dricore.mk</a><br>
>     <<a href="http://Android.libmesa_dricore.mk" rel="noreferrer" target="_blank">http://Android.libmesa_dricore.mk</a>><br>
>      >     <<a href="http://Android.libmesa_dricore.mk" rel="noreferrer" target="_blank">http://Android.libmesa_dricore.mk</a>><br>
>      >     b/src/mesa/<a href="http://Android.libmesa_dricore.mk" rel="noreferrer" target="_blank">Android.libmesa_dricore.mk</a><br>
>     <<a href="http://Android.libmesa_dricore.mk" rel="noreferrer" target="_blank">http://Android.libmesa_dricore.mk</a>><br>
>      >     <<a href="http://Android.libmesa_dricore.mk" rel="noreferrer" target="_blank">http://Android.libmesa_dricore.mk</a>><br>
>      >      > > > index 8eb6aabe83..792117767b 100644<br>
>      >      > > > --- a/src/mesa/<a href="http://Android.libmesa_dricore.mk" rel="noreferrer" target="_blank">Android.libmesa_dricore.mk</a><br>
>     <<a href="http://Android.libmesa_dricore.mk" rel="noreferrer" target="_blank">http://Android.libmesa_dricore.mk</a>><br>
>      >     <<a href="http://Android.libmesa_dricore.mk" rel="noreferrer" target="_blank">http://Android.libmesa_dricore.mk</a>><br>
>      >      > > > +++ b/src/mesa/<a href="http://Android.libmesa_dricore.mk" rel="noreferrer" target="_blank">Android.libmesa_dricore.mk</a><br>
>     <<a href="http://Android.libmesa_dricore.mk" rel="noreferrer" target="_blank">http://Android.libmesa_dricore.mk</a>><br>
>      >     <<a href="http://Android.libmesa_dricore.mk" rel="noreferrer" target="_blank">http://Android.libmesa_dricore.mk</a>><br>
>      >      > > > @@ -39,9 +39,11 @@ LOCAL_MODULE_CLASS := STATIC_LIBRARIES<br>
>      >      > > >  LOCAL_SRC_FILES := \<br>
>      >      > > >         $(MESA_FILES)<br>
>      >      > > ><br>
>      >      > > > +ifeq ($(strip $(MESA_ENABLE_ASM)),true)<br>
>      >      > > >  ifeq ($(TARGET_ARCH),x86)<br>
>      >      > > >         LOCAL_SRC_FILES += $(X86_FILES)<br>
>      >      > > >  endif # x86<br>
>      >      > > > +endif # MESA_ENABLE_ASM<br>
>      >      > > ><br>
>      >      > > >  ifeq ($(ARCH_X86_HAVE_SSE4_1),true)<br>
>      >      > > >  LOCAL_WHOLE_STATIC_LIBRARIES := \<br>
>      >      > > > diff --git a/src/mesa/<a href="http://Android.libmesa_st_mesa.mk" rel="noreferrer" target="_blank">Android.libmesa_st_mesa.mk</a><br>
>     <<a href="http://Android.libmesa_st_mesa.mk" rel="noreferrer" target="_blank">http://Android.libmesa_st_mesa.mk</a>><br>
>      >     <<a href="http://Android.libmesa_st_mesa.mk" rel="noreferrer" target="_blank">http://Android.libmesa_st_mesa.mk</a>><br>
>      >     b/src/mesa/<a href="http://Android.libmesa_st_mesa.mk" rel="noreferrer" target="_blank">Android.libmesa_st_mesa.mk</a><br>
>     <<a href="http://Android.libmesa_st_mesa.mk" rel="noreferrer" target="_blank">http://Android.libmesa_st_mesa.mk</a>><br>
>      >     <<a href="http://Android.libmesa_st_mesa.mk" rel="noreferrer" target="_blank">http://Android.libmesa_st_mesa.mk</a>><br>
>      >      > > > index 16153a3c5b..ddfd03059c 100644<br>
>      >      > > > --- a/src/mesa/<a href="http://Android.libmesa_st_mesa.mk" rel="noreferrer" target="_blank">Android.libmesa_st_mesa.mk</a><br>
>     <<a href="http://Android.libmesa_st_mesa.mk" rel="noreferrer" target="_blank">http://Android.libmesa_st_mesa.mk</a>><br>
>      >     <<a href="http://Android.libmesa_st_mesa.mk" rel="noreferrer" target="_blank">http://Android.libmesa_st_mesa.mk</a>><br>
>      >      > > > +++ b/src/mesa/<a href="http://Android.libmesa_st_mesa.mk" rel="noreferrer" target="_blank">Android.libmesa_st_mesa.mk</a><br>
>     <<a href="http://Android.libmesa_st_mesa.mk" rel="noreferrer" target="_blank">http://Android.libmesa_st_mesa.mk</a>><br>
>      >     <<a href="http://Android.libmesa_st_mesa.mk" rel="noreferrer" target="_blank">http://Android.libmesa_st_mesa.mk</a>><br>
>      >      > > > @@ -42,9 +42,11 @@ LOCAL_GENERATED_SOURCES := \<br>
>      >      > > >         $(MESA_GEN_GLSL_H) \<br>
>      >      > > >         $(MESA_GEN_NIR_H)<br>
>      >      > > ><br>
>      >      > > > +ifeq ($(strip $(MESA_ENABLE_ASM)),true)<br>
>      >      > > >  ifeq ($(TARGET_ARCH),x86)<br>
>      >      > > >         LOCAL_SRC_FILES += $(X86_FILES)<br>
>      >      > > >  endif # x86<br>
>      >      > > > +endif # MESA_ENABLE_ASM<br>
>      >      > > ><br>
>      >      > > >  ifeq ($(ARCH_X86_HAVE_SSE4_1),true)<br>
>      >      > > >  LOCAL_WHOLE_STATIC_LIBRARIES := \<br>
>      >      > > > --<br>
>      >      > ><br>
>      >      > > Looks good to me.<br>
>      >      > ><br>
>      >      > > Review-by: Chih-Wei Huang <<a href="mailto:cwhuang@linux.org.tw" target="_blank">cwhuang@linux.org.tw</a><br>
>     <mailto:<a href="mailto:cwhuang@linux.org.tw" target="_blank">cwhuang@linux.org.tw</a>><br>
>      >     <mailto:<a href="mailto:cwhuang@linux.org.tw" target="_blank">cwhuang@linux.org.tw</a> <mailto:<a href="mailto:cwhuang@linux.org.tw" target="_blank">cwhuang@linux.org.tw</a>>>><br>
>      >      ><br>
>      >      > Added Tapani who should one of the users of 32bit mesa,<br>
>      >      > please provide feedback to proceed.<br>
>      >      > Mauro<br>
>      ><br>
>      >     Tapani added now<br>
>      >     M.<br>
>      ><br>
>      ><br>
>      > did you had the chance to have a look<br>
>      > and provide Reviewed-by ?<br>
>      ><br>
> <br>
>     Sorry I've managed to miss this one. I'm not hitting any problems after<br>
>     mentioned changes though. Does this happen only if you compile on a<br>
>     32bit machine? I'm compiling both 64bit and 32bit but on a 64bit<br>
>     machine.<br>
> <br>
> <br>
> <br>
>     // Tapani<br>
> <br>
> <br>
> It happens when compiling on a 64 bit build machine,<br>
> the assembler parts of mesa have text relocation when mesa libglapi <br>
> 32bit target is compiled.<br>
> <br>
> How do you avoid the linker error?<br>
<br>
I'm not getting any linker error. Today I've compiled and tested both <br>
i965 and iris with some patches rebased on top of commit b594796f1b8.<br>
<br>
Does this happen with a particular version of Android?<br>
<br>
// Tapani<br></blockquote><div><br></div><div>It happens with oreo-x86 (Android 8.1) and pie-x86 (Android 9),</div><div>but we histocally know since Lollipop that building mesa </div><div>with asm optimization induces text relocations in libglapi shared library</div><div>and the specific problem affects 32bit builds</div><div><br></div><div>Here is the build log where '--warn-shared-textrel' is visible for target libglapi.so,</div><div>please Tapani could you provide the corresponding section of your build log?</div><div>(There may be clues about the reason you are not getting the error)</div><div><br></div><div>[  1% 5/326] target SharedLib: libglapi (out/target/product/x86/obj/SHARED_LIBRARIES/libglapi_intermediates/LINKED/libglapi.so)<br>FAILED: out/target/product/x86/obj/SHARED_LIBRARIES/libglapi_intermediates/LINKED/libglapi.so <br>/bin/bash -c "prebuilts/clang/host/linux-x86/clang-4691093/bin/clang++ -nostdlib -Wl,-soname,libglapi.so -Wl,--gc-sections -shared out/target/product/x86/obj/lib/crtbegin_so.o out/target/product/x86/obj/SHARED_LIBRARIES/libglapi_intermediates/entry.o out/target/product/x86/obj/SHARED_LIBRARIES/libglapi_intermediates/mapi_glapi.o out/target/product/x86/obj/SHARED_LIBRARIES/libglapi_intermediates/stub.o out/target/product/x86/obj/SHARED_LIBRARIES/libglapi_intermediates/table.o out/target/product/x86/obj/SHARED_LIBRARIES/libglapi_intermediates/u_current.o out/target/product/x86/obj/SHARED_LIBRARIES/libglapi_intermediates/u_execmem.o -Wl,--whole-archive  -Wl,--no-whole-archive   out/target/product/x86/obj/STATIC_LIBRARIES/libclang_rt.ubsan_minimal-i686-android_intermediates/libclang_rt.ubsan_minimal-i686-android.a  out/target/product/x86/obj/STATIC_LIBRARIES/libcompiler_rt-extras_intermediates/libcompiler_rt-extras.a   out/target/product/x86/obj/STATIC_LIBRARIES/libatomic_intermediates/libatomic.a out/target/product/x86/obj/STATIC_LIBRARIES/libgcc_intermediates/libgcc.a -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--build-id=md5 -Wl,<b>--warn-shared-textrel </b>-Wl,--fatal-warnings -Wl,--no-undefined-version -Wl,--hash-style=gnu -m32  -target i686-linux-android -Bprebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9/x86_64-linux-android/bin -Wl,--exclude-libs,libclang_rt.ubsan_minimal-i686-android.a -Wl,--no-undefined out/target/product/x86/obj/lib/libdrm.so out/target/product/x86/obj/lib/libc++.so out/target/product/x86/obj/lib/libc.so out/target/product/x86/obj/lib/libm.so out/target/product/x86/obj/lib/libdl.so -o out/target/product/x86/obj/SHARED_LIBRARIES/libglapi_intermediates/LINKED/libglapi.so out/target/product/x86/obj/lib/crtend_so.o"<br>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<br>prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9/x86_64-linux-android/bin/ld: error: treating warnings as errors<br>clang-6.0: error: linker command failed with exit code 1 (use -v to see invocation)<br></div></div></div>