mips64: compile with -mno-abicalls
authorJames Cowgill <james.cowgill@mips.com>
Fri, 2 Mar 2018 14:48:21 +0000 (14:48 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 19 Jul 2018 00:13:54 +0000 (01:13 +0100)
commitbf71ff470bcb844e6b676647c7fce1afa9c5673c
tree13c9fee170ff5973dc66ff446561fad7fa26998a
parent81337c265c31f9864813b52cee4c0c0471d4fd85
mips64: compile with -mno-abicalls

By default, the MIPS toolchain compiles all code as PIC. Since klibc
links everything at static addresses, we don't need PIC code so use
-mno-abicalls to disable it. To fix subsequent link errors, use
-Ttext-segment to adjust the base address of klibc to a more sensible
location.

This fixes a bug in the shared library form of klibc where programs
would segfault in the syscall handler because we tried to store into the
"errno" variable without setting up the gp register. This is only required
under the PIC ABI.

Signed-off-by: James Cowgill <james.cowgill@mips.com>
Gbp-Pq: Name mips64-compile-with-mno-abicalls.patch
usr/klibc/arch/mips64/MCONFIG