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_SIG_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_SIG_H_
#include "libc/runtime/symbolic.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
@ -51,49 +50,73 @@ extern const int SIG_UNBLOCK;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define SIGABRT LITERALLY(6)
#define SIGALRM LITERALLY(14)
#define SIGFPE LITERALLY(8)
#define SIGHUP LITERALLY(1)
#define SIGILL LITERALLY(4)
#define SIGINT LITERALLY(2)
#define SIGIOT LITERALLY(6)
#define SIGKILL LITERALLY(9)
#define SIGPIPE LITERALLY(13)
#define SIGPROF LITERALLY(27)
#define SIGQUIT LITERALLY(3)
#define SIGSEGV LITERALLY(11)
#define SIGTERM LITERALLY(15)
#define SIGTRAP LITERALLY(5)
#define SIGTTIN LITERALLY(21)
#define SIGTTOU LITERALLY(22)
#define SIGVTALRM LITERALLY(26)
#define SIGWINCH LITERALLY(28)
#define SIGXCPU LITERALLY(24)
#define SIGXFSZ LITERALLY(25)
#define SIGABRT 6
#define SIGALRM 14
#define SIGFPE 8
#define SIGHUP 1
#define SIGILL 4
#define SIGINT 2
#define SIGIOT 6
#define SIGKILL 9
#define SIGPIPE 13
#define SIGPROF 27
#define SIGQUIT 3
#define SIGSEGV 11
#define SIGTERM 15
#define SIGTRAP 5
#define SIGTTIN 21
#define SIGTTOU 22
#define SIGVTALRM 26
#define SIGWINCH 28
#define SIGXCPU 24
#define SIGXFSZ 25
#define SIGBUS SYMBOLIC(SIGBUS)
#define SIGTHR SYMBOLIC(SIGTHR)
#define SIGCHLD SYMBOLIC(SIGCHLD)
#define SIGCONT SYMBOLIC(SIGCONT)
#define SIGEMT SYMBOLIC(SIGEMT)
#define SIGINFO SYMBOLIC(SIGINFO)
#define SIGIO SYMBOLIC(SIGIO)
#define SIGPOLL SYMBOLIC(SIGPOLL)
#define SIGPWR SYMBOLIC(SIGPWR)
#define SIGRTMAX SYMBOLIC(SIGRTMAX)
#define SIGRTMIN SYMBOLIC(SIGRTMIN)
#define SIGSTKFLT SYMBOLIC(SIGSTKFLT)
#define SIGSTOP SYMBOLIC(SIGSTOP)
#define SIGSYS SYMBOLIC(SIGSYS)
#define SIGTSTP SYMBOLIC(SIGTSTP)
#define SIGUNUSED SYMBOLIC(SIGUNUSED)
#define SIGURG SYMBOLIC(SIGURG)
#define SIGUSR1 SYMBOLIC(SIGUSR1)
#define SIGUSR2 SYMBOLIC(SIGUSR2)
#define SIGBUS SIGBUS
#define SIGTHR SIGTHR
#define SIGCHLD SIGCHLD
#define SIGCONT SIGCONT
#define SIGEMT SIGEMT
#define SIGINFO SIGINFO
#define SIGIO SIGIO
#define SIGPOLL SIGPOLL
#define SIGPWR SIGPWR
#define SIGRTMAX SIGRTMAX
#define SIGRTMIN SIGRTMIN
#define SIGSTKFLT SIGSTKFLT
#define SIGSTOP SIGSTOP
#define SIGSYS SIGSYS
#define SIGTSTP SIGTSTP
#define SIGUNUSED SIGUNUSED
#define SIGURG SIGURG
#define SIGUSR1 SIGUSR1
#define SIGUSR2 SIGUSR2
#define SIG_BLOCK SYMBOLIC(SIG_BLOCK)
#define SIG_SETMASK SYMBOLIC(SIG_SETMASK)
#define SIG_UNBLOCK SYMBOLIC(SIG_UNBLOCK)
#define SIG_BLOCK SIG_BLOCK
#define SIG_SETMASK SIG_SETMASK
#define SIG_UNBLOCK SIG_UNBLOCK
#define __tmpcosmo_SIGBUS -15824132
#define __tmpcosmo_SIGCHLD -15824036
#define __tmpcosmo_SIGCONT -15823836
#define __tmpcosmo_SIGEMT -15823972
#define __tmpcosmo_SIGINFO -15824086
#define __tmpcosmo_SIGIO -15823912
#define __tmpcosmo_SIGPOLL -15823854
#define __tmpcosmo_SIGPWR -15824114
#define __tmpcosmo_SIGRTMAX -15824040
#define __tmpcosmo_SIGRTMIN -15824134
#define __tmpcosmo_SIGSTKFLT -15823934
#define __tmpcosmo_SIGSTOP -15824158
#define __tmpcosmo_SIGSYS -15823922
#define __tmpcosmo_SIGTHR -15823902
#define __tmpcosmo_SIGTSTP -15823988
#define __tmpcosmo_SIGUNUSED -15823970
#define __tmpcosmo_SIGURG -15823952
#define __tmpcosmo_SIGUSR1 -15824018
#define __tmpcosmo_SIGUSR2 -15823998
#define __tmpcosmo_SIG_BLOCK -15823800
#define __tmpcosmo_SIG_SETMASK -15824090
#define __tmpcosmo_SIG_UNBLOCK -15824078
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_SIG_H_ */