musl/arch
Rich Felker e3c682ab52 work around arm gcc's rejection of r7 asm constraints in thumb mode
in thumb mode, r7 is the ABI frame pointer register, and unless frame
pointer is disabled, gcc insists on treating it as a fixed register,
refusing to spill it to satisfy constraints. unfortunately, r7 is also
used in the syscall ABI for passing the syscall number.

up til now we just treated this as a requirement to disable frame
pointer when generating code as thumb, but it turns out gcc forcibly
enables frame pointer, and the fixed register constraint that goes
with it, for functions which contain VLAs. this produces an
unacceptable arch-specific constraint that (non-arm-specific) source
files making syscalls cannot use VLAs.

as a workaround, avoid r7 register constraints when producing thumb
code and instead save/restore r7 in a temp register as part of the asm
block. at some point we may want/need to support armv6-m/thumb1, so
the asm has been tweaked to be thumb1-compatible while also
near-optimal for thumb2: it allows the temp and/or syscall number to
be in high registers (necessary since r0-r5 may all be used for
syscalll args) and in thumb2 mode allows the syscall number to be an
8-bit immediate.
2018-05-01 14:34:22 -04:00
..
aarch64 aarch64: add sve_context struct and related defines from linux v4.15 2018-02-22 18:51:32 -05:00
arm work around arm gcc's rejection of r7 asm constraints in thumb mode 2018-05-01 14:34:22 -04:00
generic/bits fix minor namespace issues in termios.h 2018-03-10 18:19:41 -05:00
i386 remove a_ctz_l from arch specific atomic_arch.h 2018-04-19 12:23:17 -04:00
microblaze microblaze: add statx syscall from linux v4.13 2017-11-05 18:41:29 -05:00
mips fix minor namespace issues in termios.h 2018-03-10 18:19:41 -05:00
mips64 fix minor namespace issues in termios.h 2018-03-10 18:19:41 -05:00
mipsn32 fix minor namespace issues in termios.h 2018-03-10 18:19:41 -05:00
or1k reverse definition dependency between PAGESIZE and PAGE_SIZE 2018-03-10 17:47:14 -05:00
powerpc fix minor namespace issues in termios.h 2018-03-10 18:19:41 -05:00
powerpc64 fix minor namespace issues in termios.h 2018-03-10 18:19:41 -05:00
s390x use PAGESIZE rather than PAGE_SIZE in user.h bits 2018-03-10 17:49:23 -05:00
sh reverse definition dependency between PAGESIZE and PAGE_SIZE 2018-03-10 17:47:14 -05:00
x32 remove a_ctz_l from arch specific atomic_arch.h 2018-04-19 12:23:17 -04:00
x86_64 use PAGESIZE rather than PAGE_SIZE in user.h bits 2018-03-10 17:49:23 -05:00