ucontext implementation featuring glibc-compatible ABI
 
 
 
 
Go to file
Ariadne Conill a04dc12d72 aarch64: add freestanding port 2020-12-06 13:50:50 +00:00
arch aarch64: add freestanding port 2020-12-06 13:50:50 +00:00
include/libucontext include: add public libucontext/libucontext.h header 2020-12-06 03:53:58 -06:00
.gitignore build: generate libucontext pkg-config file 2020-12-06 04:10:14 -06:00
.mailmap update copyright statements, add mailmap 2020-03-27 09:23:49 +00:00
LICENSE update copyright statements, add mailmap 2020-03-27 09:23:49 +00:00
Makefile ppc64: chase API changes related to freestanding stuff 2020-12-06 12:23:09 +00:00
NEWS NEWS: not all ports have freestanding yet 2020-12-06 03:45:05 -07:00
README.md aarch64: add freestanding port 2020-12-06 13:50:50 +00:00
libucontext.pc.in build: generate libucontext pkg-config file 2020-12-06 04:10:14 -06:00
test_libucontext.c test program: use libucontext-prefixed symbols 2020-12-06 03:32:09 -06:00

README.md

libucontext

libucontext is a library which provides the ucontext.h C API. Unlike other implementations, it faithfully follows the kernel process ABI when doing context swaps.

Notably, when combined with gcompat, it provides a fully compatible implementation of the ucontext functions that are ABI compatible with glibc.

Since version 0.13, for some architectures, you can deploy to bare metal using newlib via the FREESTANDING=yes make option. Systems which use a syscall cannot work this way. The table below shows which architecture ports have been adapted to build with FREESTANDING=yes.

supported architectures

Adding support for new architectures is easy, but you need to know assembly language to do it.

Architecture Works on musl Syscall Supports FREESTANDING
aarch64
arm
m68k
mips
mips64
ppc
ppc64
riscv64
s390x
x86
x86_64

building

libucontext uses a simple makefile build system. You should define ARCH= at build time, otherwise the build system will attempt to guess using uname -m.

$ make ARCH=x86_64
$ make ARCH=x86_64 check
$ make ARCH=x86_64 DESTDIR=out install