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_CALLS_AUXV_H_
#define COSMOPOLITAN_LIBC_CALLS_AUXV_H_
#include "libc/runtime/symbolic.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
@ -46,43 +45,82 @@ extern const unsigned long AT_UID;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define AT_BASE SYMBOLIC(AT_BASE)
#define AT_BASE_PLATFORM SYMBOLIC(AT_BASE_PLATFORM)
#define AT_CANARY SYMBOLIC(AT_CANARY)
#define AT_CANARYLEN SYMBOLIC(AT_CANARYLEN)
#define AT_CLKTCK SYMBOLIC(AT_CLKTCK)
#define AT_DCACHEBSIZE SYMBOLIC(AT_DCACHEBSIZE)
#define AT_EGID SYMBOLIC(AT_EGID)
#define AT_EHDRFLAGS SYMBOLIC(AT_EHDRFLAGS)
#define AT_ENTRY SYMBOLIC(AT_ENTRY)
#define AT_EUID SYMBOLIC(AT_EUID)
#define AT_EXECFD SYMBOLIC(AT_EXECFD)
#define AT_EXECFN SYMBOLIC(AT_EXECFN)
#define AT_EXECPATH SYMBOLIC(AT_EXECPATH)
#define AT_FLAGS SYMBOLIC(AT_FLAGS)
#define AT_GID SYMBOLIC(AT_GID)
#define AT_HWCAP SYMBOLIC(AT_HWCAP)
#define AT_HWCAP2 SYMBOLIC(AT_HWCAP2)
#define AT_ICACHEBSIZE SYMBOLIC(AT_ICACHEBSIZE)
#define AT_MINSIGSTKSZ SYMBOLIC(AT_MINSIGSTKSZ)
#define AT_NCPUS SYMBOLIC(AT_NCPUS)
#define AT_NOTELF SYMBOLIC(AT_NOTELF)
#define AT_NO_AUTOMOUNT SYMBOLIC(AT_NO_AUTOMOUNT)
#define AT_OSRELDATE SYMBOLIC(AT_OSRELDATE)
#define AT_PAGESIZES SYMBOLIC(AT_PAGESIZES)
#define AT_PAGESIZESLEN SYMBOLIC(AT_PAGESIZESLEN)
#define AT_PAGESZ SYMBOLIC(AT_PAGESZ)
#define AT_PHDR SYMBOLIC(AT_PHDR)
#define AT_PHENT SYMBOLIC(AT_PHENT)
#define AT_PHNUM SYMBOLIC(AT_PHNUM)
#define AT_PLATFORM SYMBOLIC(AT_PLATFORM)
#define AT_RANDOM SYMBOLIC(AT_RANDOM)
#define AT_SECURE SYMBOLIC(AT_SECURE)
#define AT_STACKBASE SYMBOLIC(AT_STACKBASE)
#define AT_STACKPROT SYMBOLIC(AT_STACKPROT)
#define AT_SYSINFO_EHDR SYMBOLIC(AT_SYSINFO_EHDR)
#define AT_TIMEKEEP SYMBOLIC(AT_TIMEKEEP)
#define AT_UCACHEBSIZE SYMBOLIC(AT_UCACHEBSIZE)
#define AT_UID SYMBOLIC(AT_UID)
#define AT_BASE AT_BASE
#define AT_BASE_PLATFORM AT_BASE_PLATFORM
#define AT_CANARY AT_CANARY
#define AT_CANARYLEN AT_CANARYLEN
#define AT_CLKTCK AT_CLKTCK
#define AT_DCACHEBSIZE AT_DCACHEBSIZE
#define AT_EGID AT_EGID
#define AT_EHDRFLAGS AT_EHDRFLAGS
#define AT_ENTRY AT_ENTRY
#define AT_EUID AT_EUID
#define AT_EXECFD AT_EXECFD
#define AT_EXECFN AT_EXECFN
#define AT_EXECPATH AT_EXECPATH
#define AT_FLAGS AT_FLAGS
#define AT_GID AT_GID
#define AT_HWCAP AT_HWCAP
#define AT_HWCAP2 AT_HWCAP2
#define AT_ICACHEBSIZE AT_ICACHEBSIZE
#define AT_MINSIGSTKSZ AT_MINSIGSTKSZ
#define AT_NCPUS AT_NCPUS
#define AT_NOTELF AT_NOTELF
#define AT_NO_AUTOMOUNT AT_NO_AUTOMOUNT
#define AT_OSRELDATE AT_OSRELDATE
#define AT_PAGESIZES AT_PAGESIZES
#define AT_PAGESIZESLEN AT_PAGESIZESLEN
#define AT_PAGESZ AT_PAGESZ
#define AT_PHDR AT_PHDR
#define AT_PHENT AT_PHENT
#define AT_PHNUM AT_PHNUM
#define AT_PLATFORM AT_PLATFORM
#define AT_RANDOM AT_RANDOM
#define AT_SECURE AT_SECURE
#define AT_STACKBASE AT_STACKBASE
#define AT_STACKPROT AT_STACKPROT
#define AT_SYSINFO_EHDR AT_SYSINFO_EHDR
#define AT_TIMEKEEP AT_TIMEKEEP
#define AT_UCACHEBSIZE AT_UCACHEBSIZE
#define AT_UID AT_UID
#define __tmpcosmo_AT_BASE -1855992398
#define __tmpcosmo_AT_BASE_PLATFORM 1808921239
#define __tmpcosmo_AT_CANARY 970484702
#define __tmpcosmo_AT_CANARYLEN -1519746688
#define __tmpcosmo_AT_CLKTCK 1992240562
#define __tmpcosmo_AT_DCACHEBSIZE 863586363
#define __tmpcosmo_AT_EGID 1532201139
#define __tmpcosmo_AT_EHDRFLAGS 1117498191
#define __tmpcosmo_AT_ENTRY -881318004
#define __tmpcosmo_AT_EUID -94994583
#define __tmpcosmo_AT_EXECFD 1401411855
#define __tmpcosmo_AT_EXECFN -1457019650
#define __tmpcosmo_AT_EXECPATH 887479731
#define __tmpcosmo_AT_FLAGS 1235860257
#define __tmpcosmo_AT_GID -9520266
#define __tmpcosmo_AT_HWCAP -1179314026
#define __tmpcosmo_AT_HWCAP2 -1420265774
#define __tmpcosmo_AT_ICACHEBSIZE 1580363101
#define __tmpcosmo_AT_MINSIGSTKSZ -75267465
#define __tmpcosmo_AT_NCPUS -995438071
#define __tmpcosmo_AT_NOTELF 1219739005
#define __tmpcosmo_AT_NO_AUTOMOUNT -76603664
#define __tmpcosmo_AT_OSRELDATE 1821203372
#define __tmpcosmo_AT_PAGESIZES 569939040
#define __tmpcosmo_AT_PAGESIZESLEN 164991034
#define __tmpcosmo_AT_PAGESZ 712839957
#define __tmpcosmo_AT_PHDR -392168925
#define __tmpcosmo_AT_PHENT 1997583295
#define __tmpcosmo_AT_PHNUM 965878207
#define __tmpcosmo_AT_PLATFORM -1302967068
#define __tmpcosmo_AT_RANDOM 41281473
#define __tmpcosmo_AT_SECURE -197675851
#define __tmpcosmo_AT_STACKBASE -1736872741
#define __tmpcosmo_AT_STACKPROT 217825885
#define __tmpcosmo_AT_SYSINFO_EHDR -473176894
#define __tmpcosmo_AT_TIMEKEEP -1193655847
#define __tmpcosmo_AT_UCACHEBSIZE 1555124849
#define __tmpcosmo_AT_UID 1722564595
#endif /* COSMOPOLITAN_LIBC_CALLS_AUXV_H_ */