A minimal C runtime for Linux on i386 & x86_64
argc
, argv
, envp
, __environ
, errno
, _exit
, _end
, _edata
, _etext
, __executable_start
and syscall0/1/2/3/4/5/6
sys_brk
, brk
, and sbrk
See STATS.md to see how rt0 fares. See the musl libc comparison to see how other libc's fare.
You might be interested in Linux native/built-in and fairly portable nolibc header.
Try:
make
make librt0.a
make test
make runtest
make DESTDIR=/usr/local install
, or simply, make install
make uninstall
WITH_FAST_SYSCALL=1
, e.g., make WITH_FAST_SYSCALL=1
rt0/rt0.h
for __environ
, _exit
rt0/syscall.h
for SYS_*
, syscall0/1/2/3/4/5/6
main
as int main( int, char**, char** )
-nostdlib
, e.g., cc -c prog.c -nostdlib -o prog.o
cc prog.o -nostdlib -lrt0 -o prog
cc prog.o -Wl,-u_start -nostdlib -lrt0 -o prog
make LD=gold
make LD=ld
(default)make WITH_FAST_SYSCALL=1
-fdata-sections -ffunction-sections
, type make WITH_SECTIONS=1
make WITH_DEBUG=1