ucontext implementation featuring glibc-compatible ABI
 
 
 
 
Go to file
A. Wilcox 6046eb47e4
Reorder registers in other x86_64 assembler files
This fixes the previous commit which changed the register order in
swapcontext only, which caused setcontext to subtly corrupt the stack.
2018-07-19 17:18:19 -05:00
arch Reorder registers in other x86_64 assembler files 2018-07-19 17:18:19 -05:00
.gitignore build: add libucontext test program 2018-01-30 03:53:04 +00:00
LICENSE don't bother with glibc stuff afterall, kernel defines ABI to use 2018-01-29 21:50:49 +00:00
Makefile build: use -lucontext instead of libucontext.so in linker flags for test program 2018-02-15 04:41:22 +00:00
README.md README: we support s390x now 2018-02-15 05:55:26 +00:00
test_libucontext.c test_libucontext: explain the stack poisoning part 2018-01-31 23:23:45 +00: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.

supported architectures

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

Right now these archs are supported and should work on bare metal:

  • x86
  • x86_64
  • armv6+ (arm)
  • aarch64
  • s390x

These archs require kernel assistance and use a syscall (the only assembly is the trampoline):

  • ppc
  • ppc64 (ELFv2 ABI spec only, ELFv1 not supported)

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

support

libucontext is offered as part of the gcompat project. Accordingly, please address all questions and bug reports to gcompat@lists.adelielinux.org.