wasi-libc/libc-top-half/musl
R a05277a680
Implement a stub pthreads library for THREAD_MODEL=single (#518)
~~This patch series first starts with a number of commits stubbing out
functions in the existing `THREAD_model=posix` code. According to "The
Open Group Base Specifications Issue 7, 2018 edition", there are a
number of mandatory functions which have not been provided. There are
also some optional functions that have been partially provided in a
not-useful way (e.g. get but no set function). For these, I have chosen
to clean them up and remove the get functions for consistency.~~ EDIT:
These have been split off into separate PRs and merged.

The remainder of the patches then build up a stub implementation of
pthreads for `THREAD_MODEL=single`. I have done my best to try to make
sure that all functions are as conforming as possible (under the
assumption that another thread cannot ever be launched). This means that
objects such as mutexes and rwlocks actually do update their state and
will correctly fail when locks cannot be acquired.

When an inevitable deadlock occurs, I have chosen to return EDEADLK when
it has been explicitly listed as a permissible return value, and to
invoke `__builtin_trap` otherwise.

I have tested this by rebuilding libc++ with threads enabled and then
smoke-testing Clang/LLVM-on-WASI to make sure that it can compile a
simple program. I have not run any more-extensive conformance testing.

Fixes #501
2024-10-10 09:27:48 -07:00
..
arch Add libsetjmp.a/so (#483) 2024-04-01 15:36:28 -07:00
compat/time32 Update to musl 1.2.0. 2020-02-26 10:23:05 -08:00
crt Update to musl 1.1.23. 2019-08-07 17:53:41 -07:00
dist WASI libc prototype implementation. 2019-03-27 07:59:55 -07:00
include Implement a stub pthreads library for THREAD_MODEL=single (#518) 2024-10-10 09:27:48 -07:00
ldso Update to musl 1.2.3. 2022-05-24 19:31:23 -07:00
src Implement a stub pthreads library for THREAD_MODEL=single (#518) 2024-10-10 09:27:48 -07:00
tools Update to musl 1.2.0. 2020-02-26 10:23:05 -08:00
.mailmap Update to musl 1.2.0. 2020-02-26 10:23:05 -08:00
configure Update to musl 1.2.3. 2022-05-24 19:31:23 -07:00
COPYRIGHT Update to musl 1.2.1. (#222) 2020-11-30 12:47:45 -08:00
dynamic.list WASI libc prototype implementation. 2019-03-27 07:59:55 -07:00
INSTALL Update to musl 1.2.2. 2021-03-18 11:18:41 -07:00
Makefile Update to musl 1.2.1. (#222) 2020-11-30 12:47:45 -08:00
README Update libc-top-half/musl/README 2020-04-01 11:25:51 -07:00
VERSION Update to musl 1.2.3. 2022-05-24 19:31:23 -07:00
WHATSNEW Update to musl 1.2.3. 2022-05-24 19:31:23 -07:00

    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:

    https://musl.libc.org/