Android stopped supporting non-pie binaries with L-preview. The attached patch replaces movw/t instructions with ldr to prevent compiler from generating incompatible elf relocs Reproducible: Always
Created attachment 89086 [details] v6intThumb.patch
I am seeing something similar on debian-armhf: gcc -Winline -Wall -Wshadow -Wno-long-long -g -fno-stack-protector -g -O0 -mcpu=cortex-a8 -mthumb -o v6intThumb v6intThumb-v6intThumb.o /usr/bin/ld: v6intThumb-v6intThumb.o: relocation R_ARM_THM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC v6intThumb-v6intThumb.o: error adding symbols: Bad value Note that it isn't exactly the same issue, because it isn't build with -fPIC or -pie, but using either -fPIC or -pie will produce the same issue. The proposed patch doesn't work though. The assembler will then complain: /tmp/ccveFwf0.s: Assembler messages: /tmp/ccveFwf0.s:140: Error: offset out of range It does seem to build on fedora-arm, so there are at least some configurations that do work. But it would be nice to see if this test could be written without relying on trying to load the address of a label.
For now I have disabled this test: commit ae32e44d1e891dd2adbb056b0bb127b21efc1b67 (HEAD -> master) Author: Mark Wielaard <mark@klomp.org> Date: Sat Mar 29 21:21:45 2025 +0100 arm/v6intThumb: Disable tests for instructions modifying pc (ldr pc, add pc) The test doesn't compile. /usr/bin/ld: v6intThumb-v6intThumb.o(.text+0xf2): unresolvable R_ARM_THM_CALL relocation against symbol `printf@@GLIBC_2.4' Changing the movw and movt into a ldr as suggested in https://bugs.kde.org/show_bug.cgi?id=339862#c1 Causes a different compile error. /tmp/ccveFwf0.s:140: Error: offset out of range So disable it for now.