Re: [PATCH] arm64: vdso32: force vdso32 to be compiled as -marm
From: Robin Murphy
Date: Wed May 27 2020 - 15:28:19 EST
On 2020-05-27 18:55, Nick Desaulniers wrote:
On Wed, May 27, 2020 at 6:45 AM Robin Murphy <robin.murphy@xxxxxxx> wrote:
On 2020-05-26 18:31, Nick Desaulniers wrote:
Custom toolchains that modify the default target to -mthumb cannot
compile the arm64 compat vdso32, as
contains assembly that's invalid in -mthumb. Force the use of -marm,
FWIW, this seems suspicious - the only assembly instructions I see there
are SWI(SVC), MRRC, and a MOV, all of which exist in Thumb for the
-march=armv7a baseline that we set.
On a hunch, I've just bodged "VDSO_CFLAGS += -mthumb" into my tree and
built a Thumb VDSO quite happily with Ubuntu 19.04's
gcc-arm-linux-gnueabihf. What was the actual failure you saw?
From the link in the commit message: `write to reserved register 'R7'`
IIUC r7 is reserved for the frame pointer in THUMB?
It can be, if you choose to build with frame pointers and the common
frame pointer ABI for Thumb code that uses r7. However it can also be
for other things like the syscall number in the Arm syscall ABI too. I
take it Clang has decided that writing syscall wrappers with minimal
inline asm is not a thing people deserve to do without arbitrary other
What is the implicit default of your gcc-arm-linux-gnueabihf at -O2?
-mthumb, or -marm?
As Dave pointed out, like the probable majority of users it's Thumb:
$ arm-linux-gnueabihf-gcc -v
Using built-in specs.
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro
--with-gcc-major-version-only --program-suffix=-8 --enable-shared
--without-included-gettext --enable-threads=posix --libdir=/usr/lib
--enable-nls --with-sysroot=/ --enable-clocale=gnu
--disable-libitm --disable-libquadmath --disable-libquadmath-support
--enable-plugin --enable-default-pie --with-system-zlib
--with-target-system-zlib --enable-multiarch --enable-multilib
--disable-sjlj-exceptions --with-arch=armv7-a --with-fpu=vfpv3-d16
--with-float=hard --with-mode=thumb --disable-werror --enable-multilib
Thread model: posix
gcc version 8.3.0 (Ubuntu/Linaro 8.3.0-6ubuntu1)
(yeah, I didn't actually need to hack my makefile at all)