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_AF_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_AF_H_
#include "libc/runtime/symbolic.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
@ -50,53 +49,95 @@ extern const int AF_VSOCK;
extern const int AF_WANPIPE;
extern const int AF_X25;
#define AF_ALG AF_ALG
#define AF_LINK AF_LINK
#define AF_APPLETALK AF_APPLETALK
#define AF_ASH AF_ASH
#define AF_ATMPVC AF_ATMPVC
#define AF_ATMSVC AF_ATMSVC
#define AF_AX25 AF_AX25
#define AF_BLUETOOTH AF_BLUETOOTH
#define AF_BRIDGE AF_BRIDGE
#define AF_CAIF AF_CAIF
#define AF_CAN AF_CAN
#define AF_ECONET AF_ECONET
#define AF_FILE AF_FILE
#define AF_IB AF_IB
#define AF_IEEE802154 AF_IEEE802154
#define AF_INET 2
#define AF_INET6 AF_INET6
#define AF_IPX AF_IPX
#define AF_IRDA AF_IRDA
#define AF_ISDN AF_ISDN
#define AF_IUCV AF_IUCV
#define AF_KCM AF_KCM
#define AF_KEY AF_KEY
#define AF_LLC AF_LLC
#define AF_LOCAL AF_LOCAL
#define AF_MAX AF_MAX
#define AF_MPLS AF_MPLS
#define AF_NETBEUI AF_NETBEUI
#define AF_NETLINK AF_NETLINK
#define AF_NETROM AF_NETROM
#define AF_NFC AF_NFC
#define AF_PACKET AF_PACKET
#define AF_PHONET AF_PHONET
#define AF_PPPOX AF_PPPOX
#define AF_ROSE AF_ROSE
#define AF_ROUTE AF_ROUTE
#define AF_RXRPC AF_RXRPC
#define AF_SECURITY AF_SECURITY
#define AF_SNA AF_SNA
#define AF_TIPC AF_TIPC
#define AF_UNIX 1
#define AF_UNSPEC 0
#define AF_VSOCK AF_VSOCK
#define AF_WANPIPE AF_WANPIPE
#define AF_X25 AF_X25
#define __tmpcosmo_AF_ALG -15823936
#define __tmpcosmo_AF_APPLETALK -15823820
#define __tmpcosmo_AF_ASH -15823924
#define __tmpcosmo_AF_ATMPVC -15824070
#define __tmpcosmo_AF_ATMSVC -15824056
#define __tmpcosmo_AF_AX25 -15824014
#define __tmpcosmo_AF_BLUETOOTH -15823992
#define __tmpcosmo_AF_BRIDGE -15823812
#define __tmpcosmo_AF_CAIF -15823850
#define __tmpcosmo_AF_CAN -15823868
#define __tmpcosmo_AF_ECONET -15823852
#define __tmpcosmo_AF_FILE -15824118
#define __tmpcosmo_AF_IB -15823966
#define __tmpcosmo_AF_IEEE802154 -15823906
#define __tmpcosmo_AF_IPX -15824002
#define __tmpcosmo_AF_IRDA -15823860
#define __tmpcosmo_AF_ISDN -15823978
#define __tmpcosmo_AF_IUCV -15824106
#define __tmpcosmo_AF_KCM -15824024
#define __tmpcosmo_AF_KEY -15823948
#define __tmpcosmo_AF_LINK -15823878
#define __tmpcosmo_AF_LLC -15823824
#define __tmpcosmo_AF_LOCAL -15823928
#define __tmpcosmo_AF_MAX -15824082
#define __tmpcosmo_AF_MPLS -15824026
#define __tmpcosmo_AF_NETBEUI -15824124
#define __tmpcosmo_AF_NETLINK -15824004
#define __tmpcosmo_AF_NETROM -15823886
#define __tmpcosmo_AF_NFC -15824142
#define __tmpcosmo_AF_PACKET -15824028
#define __tmpcosmo_AF_PHONET -15823830
#define __tmpcosmo_AF_PPPOX -15823876
#define __tmpcosmo_AF_ROSE -15824016
#define __tmpcosmo_AF_ROUTE -15824100
#define __tmpcosmo_AF_RXRPC -15823926
#define __tmpcosmo_AF_SECURITY -15824136
#define __tmpcosmo_AF_SNA -15823950
#define __tmpcosmo_AF_TIPC -15824034
#define __tmpcosmo_AF_VSOCK -15824146
#define __tmpcosmo_AF_WANPIPE -15823960
#define __tmpcosmo_AF_X25 -15823864
#define __tmpcosmo_AF_INET6 1498323847
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define AF_ALG SYMBOLIC(AF_ALG)
#define AF_LINK SYMBOLIC(AF_LINK)
#define AF_APPLETALK SYMBOLIC(AF_APPLETALK)
#define AF_ASH SYMBOLIC(AF_ASH)
#define AF_ATMPVC SYMBOLIC(AF_ATMPVC)
#define AF_ATMSVC SYMBOLIC(AF_ATMSVC)
#define AF_AX25 SYMBOLIC(AF_AX25)
#define AF_BLUETOOTH SYMBOLIC(AF_BLUETOOTH)
#define AF_BRIDGE SYMBOLIC(AF_BRIDGE)
#define AF_CAIF SYMBOLIC(AF_CAIF)
#define AF_CAN SYMBOLIC(AF_CAN)
#define AF_ECONET SYMBOLIC(AF_ECONET)
#define AF_FILE SYMBOLIC(AF_FILE)
#define AF_IB SYMBOLIC(AF_IB)
#define AF_IEEE802154 SYMBOLIC(AF_IEEE802154)
#define AF_INET LITERALLY(2)
#define AF_INET6 SYMBOLIC(AF_INET6)
#define AF_IPX SYMBOLIC(AF_IPX)
#define AF_IRDA SYMBOLIC(AF_IRDA)
#define AF_ISDN SYMBOLIC(AF_ISDN)
#define AF_IUCV SYMBOLIC(AF_IUCV)
#define AF_KCM SYMBOLIC(AF_KCM)
#define AF_KEY SYMBOLIC(AF_KEY)
#define AF_LLC SYMBOLIC(AF_LLC)
#define AF_LOCAL SYMBOLIC(AF_LOCAL)
#define AF_MAX SYMBOLIC(AF_MAX)
#define AF_MPLS SYMBOLIC(AF_MPLS)
#define AF_NETBEUI SYMBOLIC(AF_NETBEUI)
#define AF_NETLINK SYMBOLIC(AF_NETLINK)
#define AF_NETROM SYMBOLIC(AF_NETROM)
#define AF_NFC SYMBOLIC(AF_NFC)
#define AF_PACKET SYMBOLIC(AF_PACKET)
#define AF_PHONET SYMBOLIC(AF_PHONET)
#define AF_PPPOX SYMBOLIC(AF_PPPOX)
#define AF_ROSE SYMBOLIC(AF_ROSE)
#define AF_ROUTE SYMBOLIC(AF_ROUTE)
#define AF_RXRPC SYMBOLIC(AF_RXRPC)
#define AF_SECURITY SYMBOLIC(AF_SECURITY)
#define AF_SNA SYMBOLIC(AF_SNA)
#define AF_TIPC SYMBOLIC(AF_TIPC)
#define AF_UNIX LITERALLY(1)
#define AF_UNSPEC LITERALLY(0)
#define AF_VSOCK SYMBOLIC(AF_VSOCK)
#define AF_WANPIPE SYMBOLIC(AF_WANPIPE)
#define AF_X25 SYMBOLIC(AF_X25)
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_AF_H_ */