Fix bugs in cosmocc toolchain

This change integrates e58abc1110b335a3341e8ad5821ad8e3880d9bb2 from
https://github.com/ahgamut/musl-cross-make/ which fixes the issues we
were having with our C language extension for symbolic constants. This
change also performs some code cleanup and bug fixes to getaddrinfo().
It's now possible to compile projects like ncurses, readline and python
without needing to patch anything upstream, except maybe a line or two.
Pretty soon it should be possible to build a Linux distro on Cosmo.
This commit is contained in:
Justine Tunney 2023-06-08 23:44:03 -07:00
parent 22f81a8d50
commit 23e235b7a5
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
272 changed files with 3491 additions and 4350 deletions

View file

@ -1,6 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_PTRACE_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_PTRACE_H_
#include "libc/runtime/symbolic.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
@ -57,54 +56,54 @@ extern const int PTRACE_EVENT_SECCOMP;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define PTRACE_TRACEME SYMBOLIC(PTRACE_TRACEME)
#define PTRACE_PEEKTEXT SYMBOLIC(PTRACE_PEEKTEXT)
#define PTRACE_PEEKDATA SYMBOLIC(PTRACE_PEEKDATA)
#define PTRACE_PEEKUSER SYMBOLIC(PTRACE_PEEKUSER)
#define PTRACE_POKETEXT SYMBOLIC(PTRACE_POKETEXT)
#define PTRACE_POKEDATA SYMBOLIC(PTRACE_POKEDATA)
#define PTRACE_POKEUSER SYMBOLIC(PTRACE_POKEUSER)
#define PTRACE_CONT SYMBOLIC(PTRACE_CONT)
#define PTRACE_KILL SYMBOLIC(PTRACE_KILL)
#define PTRACE_SINGLESTEP SYMBOLIC(PTRACE_SINGLESTEP)
#define PTRACE_GETREGS SYMBOLIC(PTRACE_GETREGS)
#define PTRACE_SETREGS SYMBOLIC(PTRACE_SETREGS)
#define PTRACE_GETFPREGS SYMBOLIC(PTRACE_GETFPREGS)
#define PTRACE_SETFPREGS SYMBOLIC(PTRACE_SETFPREGS)
#define PTRACE_ATTACH SYMBOLIC(PTRACE_ATTACH)
#define PTRACE_DETACH SYMBOLIC(PTRACE_DETACH)
#define PTRACE_GETFPXREGS SYMBOLIC(PTRACE_GETFPXREGS)
#define PTRACE_SETFPXREGS SYMBOLIC(PTRACE_SETFPXREGS)
#define PTRACE_SYSCALL SYMBOLIC(PTRACE_SYSCALL)
#define PTRACE_GETEVENTMSG SYMBOLIC(PTRACE_GETEVENTMSG)
#define PTRACE_GETSIGINFO SYMBOLIC(PTRACE_GETSIGINFO)
#define PTRACE_SETOPTIONS SYMBOLIC(PTRACE_SETOPTIONS)
#define PTRACE_SETSIGINFO SYMBOLIC(PTRACE_SETSIGINFO)
#define PTRACE_GETREGSET SYMBOLIC(PTRACE_GETREGSET)
#define PTRACE_GETSIGMASK SYMBOLIC(PTRACE_GETSIGMASK)
#define PTRACE_INTERRUPT SYMBOLIC(PTRACE_INTERRUPT)
#define PTRACE_LISTEN SYMBOLIC(PTRACE_LISTEN)
#define PTRACE_PEEKSIGINFO SYMBOLIC(PTRACE_PEEKSIGINFO)
#define PTRACE_SECCOMP_GET_FILTER SYMBOLIC(PTRACE_SECCOMP_GET_FILTER)
#define PTRACE_SEIZE SYMBOLIC(PTRACE_SEIZE)
#define PTRACE_SETREGSET SYMBOLIC(PTRACE_SETREGSET)
#define PTRACE_SETSIGMASK SYMBOLIC(PTRACE_SETSIGMASK)
#define PTRACE_O_TRACESYSGOOD SYMBOLIC(PTRACE_O_TRACESYSGOOD)
#define PTRACE_O_TRACEFORK SYMBOLIC(PTRACE_O_TRACEFORK)
#define PTRACE_O_TRACEVFORK SYMBOLIC(PTRACE_O_TRACEVFORK)
#define PTRACE_O_TRACECLONE SYMBOLIC(PTRACE_O_TRACECLONE)
#define PTRACE_O_TRACEEXEC SYMBOLIC(PTRACE_O_TRACEEXEC)
#define PTRACE_O_TRACEVFORKDONE SYMBOLIC(PTRACE_O_TRACEVFORKDONE)
#define PTRACE_O_TRACEEXIT SYMBOLIC(PTRACE_O_TRACEEXIT)
#define PTRACE_O_TRACESECCOMP SYMBOLIC(PTRACE_O_TRACESECCOMP)
#define PTRACE_O_MASK SYMBOLIC(PTRACE_O_MASK)
#define PTRACE_EVENT_FORK SYMBOLIC(PTRACE_EVENT_FORK)
#define PTRACE_EVENT_VFORK SYMBOLIC(PTRACE_EVENT_VFORK)
#define PTRACE_EVENT_CLONE SYMBOLIC(PTRACE_EVENT_CLONE)
#define PTRACE_EVENT_EXEC SYMBOLIC(PTRACE_EVENT_EXEC)
#define PTRACE_EVENT_VFORK_DONE SYMBOLIC(PTRACE_EVENT_VFORK_DONE)
#define PTRACE_EVENT_EXIT SYMBOLIC(PTRACE_EVENT_EXIT)
#define PTRACE_EVENT_STOP SYMBOLIC(PTRACE_EVENT_STOP)
#define PTRACE_EVENT_SECCOMP SYMBOLIC(PTRACE_EVENT_SECCOMP)
#define PTRACE_TRACEME PTRACE_TRACEME
#define PTRACE_PEEKTEXT PTRACE_PEEKTEXT
#define PTRACE_PEEKDATA PTRACE_PEEKDATA
#define PTRACE_PEEKUSER PTRACE_PEEKUSER
#define PTRACE_POKETEXT PTRACE_POKETEXT
#define PTRACE_POKEDATA PTRACE_POKEDATA
#define PTRACE_POKEUSER PTRACE_POKEUSER
#define PTRACE_CONT PTRACE_CONT
#define PTRACE_KILL PTRACE_KILL
#define PTRACE_SINGLESTEP PTRACE_SINGLESTEP
#define PTRACE_GETREGS PTRACE_GETREGS
#define PTRACE_SETREGS PTRACE_SETREGS
#define PTRACE_GETFPREGS PTRACE_GETFPREGS
#define PTRACE_SETFPREGS PTRACE_SETFPREGS
#define PTRACE_ATTACH PTRACE_ATTACH
#define PTRACE_DETACH PTRACE_DETACH
#define PTRACE_GETFPXREGS PTRACE_GETFPXREGS
#define PTRACE_SETFPXREGS PTRACE_SETFPXREGS
#define PTRACE_SYSCALL PTRACE_SYSCALL
#define PTRACE_GETEVENTMSG PTRACE_GETEVENTMSG
#define PTRACE_GETSIGINFO PTRACE_GETSIGINFO
#define PTRACE_SETOPTIONS PTRACE_SETOPTIONS
#define PTRACE_SETSIGINFO PTRACE_SETSIGINFO
#define PTRACE_GETREGSET PTRACE_GETREGSET
#define PTRACE_GETSIGMASK PTRACE_GETSIGMASK
#define PTRACE_INTERRUPT PTRACE_INTERRUPT
#define PTRACE_LISTEN PTRACE_LISTEN
#define PTRACE_PEEKSIGINFO PTRACE_PEEKSIGINFO
#define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
#define PTRACE_SEIZE PTRACE_SEIZE
#define PTRACE_SETREGSET PTRACE_SETREGSET
#define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
#define PTRACE_O_TRACESYSGOOD PTRACE_O_TRACESYSGOOD
#define PTRACE_O_TRACEFORK PTRACE_O_TRACEFORK
#define PTRACE_O_TRACEVFORK PTRACE_O_TRACEVFORK
#define PTRACE_O_TRACECLONE PTRACE_O_TRACECLONE
#define PTRACE_O_TRACEEXEC PTRACE_O_TRACEEXEC
#define PTRACE_O_TRACEVFORKDONE PTRACE_O_TRACEVFORKDONE
#define PTRACE_O_TRACEEXIT PTRACE_O_TRACEEXIT
#define PTRACE_O_TRACESECCOMP PTRACE_O_TRACESECCOMP
#define PTRACE_O_MASK PTRACE_O_MASK
#define PTRACE_EVENT_FORK PTRACE_EVENT_FORK
#define PTRACE_EVENT_VFORK PTRACE_EVENT_VFORK
#define PTRACE_EVENT_CLONE PTRACE_EVENT_CLONE
#define PTRACE_EVENT_EXEC PTRACE_EVENT_EXEC
#define PTRACE_EVENT_VFORK_DONE PTRACE_EVENT_VFORK_DONE
#define PTRACE_EVENT_EXIT PTRACE_EVENT_EXIT
#define PTRACE_EVENT_STOP PTRACE_EVENT_STOP
#define PTRACE_EVENT_SECCOMP PTRACE_EVENT_SECCOMP
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_PTRACE_H_ */