musl - an implementation of the standard library for Linux-based systems
Go to file
Rich Felker 370679ba98 fix mips setjmp/longjmp fpu state on r6, related issues
mips32 has two fpu register file variants: FR=0 with 32 32-bit
registers, where pairs of neighboring even/odd registers are used to
represent doubles, and FR=1 with 32 64-bit registers, each of which
can store a single or double.

up through r5 (our "mips" arch), the supported ABI uses FR=0, but
modern compilers generate "fpxx" model code that can safely operate
with either model. r6, which is an incompatible but similar ISA, drops
FR=0 and only provides the FR=1 model. as such, setjmp and longjmp,
which depended on being able to save and restore call-saved doubles by
storing and loading their 32-bit halves, were completely broken in the
presence of floating point code on mips r6.

to fix this, use the s.d and l.d mnemonics to store and load fpu
registers. these expand to the existing swc1 and lwc1 instructions for
pairs of 32-bit fpu registers on mips1, but on mips2 and later they
translate directly to the 64-bit sdc1 and ldc1.

with FR=0, sdc1 and ldc1 behave just like the pairs of swc1 and lwc1
instructions they replace, storing or loading the even/odd pair of fpu
registers that can be treated as separate single-precision floats or
as a unit representing a double. but with FR=1, they store/load
individual 64-bit registers. this yields the ABI-correct behavior on
mips r6, and should make linking of pre-r6 (plain "mips") code with
"fp64" model code workable, although this is and will likely remain
unsupported usage.

in addition to the mips r6 problem this change fixes, reportedly
clang's internal assembler refuses to assemble swc1 and lwc1
instructions for odd register indices when building for "fpxx" model
(the default). this caused setjmp and longjmp not to build. by using
the s.d and l.d forms, this problem is avoided too.

as a bonus, code size is reduced everywhere but mips1.
2019-09-26 23:46:09 -04:00
arch fix mips r6 syscall clobber lists not to include hi/lo registers 2019-09-26 19:14:36 -04:00
crt remove unnecessary and problematic _Noreturn from crt/ldso startup 2019-06-25 19:05:40 -04:00
dist
include fcntl.h: add AT_RECURSIVE from linux v5.2 2019-09-11 10:40:31 -04:00
ldso fix regression whereby main thread didn't get TLS relocations 2019-08-13 21:53:30 -04:00
src fix mips setjmp/longjmp fpu state on r6, related issues 2019-09-26 23:46:09 -04:00
tools fix musl-gcc wrapper to be compatible with default-pie gcc toolchains 2018-08-02 19:15:48 -04:00
.gitignore remove obsolete gitignore rules 2016-07-06 00:21:25 -04:00
COPYRIGHT update year in COPYRIGHT file 2019-07-15 18:28:43 -04:00
INSTALL mention mips64 n32 ABI support in INSTALL doc 2019-07-09 18:40:50 -04:00
Makefile overhaul internally-public declarations using wrapper headers 2018-09-12 14:34:33 -04:00
README
VERSION release 1.1.23 2019-07-16 15:30:39 -04:00
WHATSNEW release 1.1.23 2019-07-16 15:30:39 -04:00
configure configure: make AR and RANLIB customizable 2019-07-04 12:03:18 -04:00
dynamic.list fix regression in access to optopt object 2018-11-19 13:20:41 -05:00

README

    musl libc

musl, pronounced like the word "mussel", is an MIT-licensed
implementation of the standard C library targetting the Linux syscall
API, suitable for use in a wide range of deployment environments. musl
offers efficient static and dynamic linking support, lightweight code
and low runtime overhead, strong fail-safe guarantees under correct
usage, and correctness in the sense of standards conformance and
safety. musl is built on the principle that these goals are best
achieved through simple code that is easy to understand and maintain.

The 1.1 release series for musl features coverage for all interfaces
defined in ISO C99 and POSIX 2008 base, along with a number of
non-standardized interfaces for compatibility with Linux, BSD, and
glibc functionality.

For basic installation instructions, see the included INSTALL file.
Information on full musl-targeted compiler toolchains, system
bootstrapping, and Linux distributions built on musl can be found on
the project website:

    http://www.musl-libc.org/