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>
Sun, 6 Jan 2019 19:33:01 +0000 (19:33 +0000)
commitdfa1588fd2340cf1278d1382fb6cbddc1167665b
tree62828144e923be19af88b754981daec77022add0
parent72595918ee7f4fa9fb52c2c9a5a061fbba712d30
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