mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-07 03:38:31 +00:00
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:
parent
22f81a8d50
commit
23e235b7a5
272 changed files with 3491 additions and 4350 deletions
157
libc/errno.h
157
libc/errno.h
|
@ -16,6 +16,14 @@ COSMOPOLITAN_C_START_
|
|||
asm("call\t__errno_location" : "=a"(_ep) : /* no inputs */ : "cc"); \
|
||||
_ep; \
|
||||
}))
|
||||
#elif defined(__GNUC__) && defined(__aarch64__) && \
|
||||
!defined(__STRICT_ANSI__) && !defined(__cplusplus)
|
||||
#define errno \
|
||||
(*({ \
|
||||
errno_t *_ep; \
|
||||
asm("sub\t%0,x28,#1092" : "=r"(_ep)); \
|
||||
_ep; \
|
||||
}))
|
||||
#else
|
||||
#define errno (*__errno_location())
|
||||
#endif
|
||||
|
@ -696,6 +704,155 @@ extern const errno_t EXFULL;
|
|||
#define EXDEV EXDEV
|
||||
#define EXFULL EXFULL
|
||||
|
||||
#define __tmpcosmo_E2BIG -15823698
|
||||
#define __tmpcosmo_EACCES -15823580
|
||||
#define __tmpcosmo_EADDRINUSE -15823756
|
||||
#define __tmpcosmo_EADDRNOTAVAIL -15823592
|
||||
#define __tmpcosmo_EADV -15823574
|
||||
#define __tmpcosmo_EAFNOSUPPORT -15823748
|
||||
#define __tmpcosmo_EAGAIN -15823506
|
||||
#define __tmpcosmo_EALREADY -15823530
|
||||
#define __tmpcosmo_EAUTH -15823702
|
||||
#define __tmpcosmo_EBADARCH -15823738
|
||||
#define __tmpcosmo_EBADE -15823740
|
||||
#define __tmpcosmo_EBADEXEC -15823684
|
||||
#define __tmpcosmo_EBADF -15823744
|
||||
#define __tmpcosmo_EBADFD -15823554
|
||||
#define __tmpcosmo_EBADMACHO -15823618
|
||||
#define __tmpcosmo_EBADMSG -15823650
|
||||
#define __tmpcosmo_EBADR -15823570
|
||||
#define __tmpcosmo_EBADRPC -15823626
|
||||
#define __tmpcosmo_EBADRQC -15823688
|
||||
#define __tmpcosmo_EBADSLT -15823788
|
||||
#define __tmpcosmo_EBUSY -15823550
|
||||
#define __tmpcosmo_ECANCELED -15823676
|
||||
#define __tmpcosmo_ECHILD -15823662
|
||||
#define __tmpcosmo_ECHRNG -15823722
|
||||
#define __tmpcosmo_ECOMM -15823634
|
||||
#define __tmpcosmo_ECONNABORTED -15823616
|
||||
#define __tmpcosmo_ECONNREFUSED -15823556
|
||||
#define __tmpcosmo_ECONNRESET -15823548
|
||||
#define __tmpcosmo_EDEADLK -15823718
|
||||
#define __tmpcosmo_EDESTADDRREQ -15823658
|
||||
#define __tmpcosmo_EDEVERR -15823518
|
||||
#define __tmpcosmo_EDOM -15823798
|
||||
#define __tmpcosmo_EDOTDOT -15823726
|
||||
#define __tmpcosmo_EDQUOT -15823620
|
||||
#define __tmpcosmo_EEXIST -15823594
|
||||
#define __tmpcosmo_EFAULT -15823686
|
||||
#define __tmpcosmo_EFBIG -15823768
|
||||
#define __tmpcosmo_EFTYPE -15823568
|
||||
#define __tmpcosmo_EHOSTDOWN -15823596
|
||||
#define __tmpcosmo_EHOSTUNREACH -15823742
|
||||
#define __tmpcosmo_EHWPOISON -15823680
|
||||
#define __tmpcosmo_EIDRM -15823644
|
||||
#define __tmpcosmo_EILSEQ -15823540
|
||||
#define __tmpcosmo_EINPROGRESS -15823720
|
||||
#define __tmpcosmo_EINTR -15823710
|
||||
#define __tmpcosmo_EINVAL -15823624
|
||||
#define __tmpcosmo_EIO -15823544
|
||||
#define __tmpcosmo_EISCONN -15823704
|
||||
#define __tmpcosmo_EISDIR -15823758
|
||||
#define __tmpcosmo_EISNAM -15823682
|
||||
#define __tmpcosmo_EKEYEXPIRED -15823520
|
||||
#define __tmpcosmo_EKEYREJECTED -15823712
|
||||
#define __tmpcosmo_EKEYREVOKED -15823780
|
||||
#define __tmpcosmo_EL2HLT -15823510
|
||||
#define __tmpcosmo_EL2NSYNC -15823670
|
||||
#define __tmpcosmo_EL3HLT -15823792
|
||||
#define __tmpcosmo_EL3RST -15823654
|
||||
#define __tmpcosmo_ELIBACC -15823708
|
||||
#define __tmpcosmo_ELIBBAD -15823564
|
||||
#define __tmpcosmo_ELIBEXEC -15823696
|
||||
#define __tmpcosmo_ELIBMAX -15823724
|
||||
#define __tmpcosmo_ELIBSCN -15823786
|
||||
#define __tmpcosmo_ELNRNG -15823732
|
||||
#define __tmpcosmo_ELOOP -15823672
|
||||
#define __tmpcosmo_EMEDIUMTYPE -15823508
|
||||
#define __tmpcosmo_EMFILE -15823762
|
||||
#define __tmpcosmo_EMLINK -15823694
|
||||
#define __tmpcosmo_EMSGSIZE -15823536
|
||||
#define __tmpcosmo_EMULTIHOP -15823750
|
||||
#define __tmpcosmo_ENAMETOOLONG -15823600
|
||||
#define __tmpcosmo_ENAVAIL -15823656
|
||||
#define __tmpcosmo_ENEEDAUTH -15823766
|
||||
#define __tmpcosmo_ENETDOWN -15823730
|
||||
#define __tmpcosmo_ENETRESET -15823604
|
||||
#define __tmpcosmo_ENETUNREACH -15823524
|
||||
#define __tmpcosmo_ENFILE -15823700
|
||||
#define __tmpcosmo_ENOANO -15823734
|
||||
#define __tmpcosmo_ENOATTR -15823606
|
||||
#define __tmpcosmo_ENOBUFS -15823628
|
||||
#define __tmpcosmo_ENOCSI -15823760
|
||||
#define __tmpcosmo_ENODATA -15823516
|
||||
#define __tmpcosmo_ENODEV -15823774
|
||||
#define __tmpcosmo_ENOENT -15823590
|
||||
#define __tmpcosmo_ENOEXEC -15823512
|
||||
#define __tmpcosmo_ENOKEY -15823764
|
||||
#define __tmpcosmo_ENOLCK -15823782
|
||||
#define __tmpcosmo_ENOLINK -15823538
|
||||
#define __tmpcosmo_ENOMEDIUM -15823598
|
||||
#define __tmpcosmo_ENOMEM -15823514
|
||||
#define __tmpcosmo_ENOMSG -15823796
|
||||
#define __tmpcosmo_ENONET -15823642
|
||||
#define __tmpcosmo_ENOPKG -15823664
|
||||
#define __tmpcosmo_ENOPOLICY -15823716
|
||||
#define __tmpcosmo_ENOPROTOOPT -15823608
|
||||
#define __tmpcosmo_ENOSPC -15823646
|
||||
#define __tmpcosmo_ENOSR -15823558
|
||||
#define __tmpcosmo_ENOSTR -15823706
|
||||
#define __tmpcosmo_ENOSYS -15823636
|
||||
#define __tmpcosmo_ENOTBLK -15823640
|
||||
#define __tmpcosmo_ENOTCONN -15823778
|
||||
#define __tmpcosmo_ENOTDIR -15823648
|
||||
#define __tmpcosmo_ENOTEMPTY -15823552
|
||||
#define __tmpcosmo_ENOTNAM -15823532
|
||||
#define __tmpcosmo_ENOTRECOVERABLE -15823746
|
||||
#define __tmpcosmo_ENOTSOCK -15823582
|
||||
#define __tmpcosmo_ENOTSUP -15823602
|
||||
#define __tmpcosmo_ENOTTY -15823528
|
||||
#define __tmpcosmo_ENOTUNIQ -15823790
|
||||
#define __tmpcosmo_ENXIO -15823622
|
||||
#define __tmpcosmo_EOPNOTSUPP -15823588
|
||||
#define __tmpcosmo_EOVERFLOW -15823736
|
||||
#define __tmpcosmo_EOWNERDEAD -15823562
|
||||
#define __tmpcosmo_EPERM -15823754
|
||||
#define __tmpcosmo_EPFNOSUPPORT -15823690
|
||||
#define __tmpcosmo_EPIPE -15823534
|
||||
#define __tmpcosmo_EPROCLIM -15823610
|
||||
#define __tmpcosmo_EPROCUNAVAIL -15823546
|
||||
#define __tmpcosmo_EPROGMISMATCH -15823572
|
||||
#define __tmpcosmo_EPROGUNAVAIL -15823526
|
||||
#define __tmpcosmo_EPROTO -15823678
|
||||
#define __tmpcosmo_EPROTONOSUPPORT -15823576
|
||||
#define __tmpcosmo_EPROTOTYPE -15823614
|
||||
#define __tmpcosmo_EPWROFF -15823692
|
||||
#define __tmpcosmo_ERANGE -15823772
|
||||
#define __tmpcosmo_EREMCHG -15823666
|
||||
#define __tmpcosmo_EREMOTE -15823560
|
||||
#define __tmpcosmo_EREMOTEIO -15823794
|
||||
#define __tmpcosmo_ERESTART -15823728
|
||||
#define __tmpcosmo_ERFKILL -15823612
|
||||
#define __tmpcosmo_EROFS -15823566
|
||||
#define __tmpcosmo_ERPCMISMATCH -15823542
|
||||
#define __tmpcosmo_ESHLIBVERS -15823584
|
||||
#define __tmpcosmo_ESHUTDOWN -15823660
|
||||
#define __tmpcosmo_ESOCKTNOSUPPORT -15823776
|
||||
#define __tmpcosmo_ESPIPE -15823652
|
||||
#define __tmpcosmo_ESRCH -15823674
|
||||
#define __tmpcosmo_ESRMNT -15823714
|
||||
#define __tmpcosmo_ESTALE -15823632
|
||||
#define __tmpcosmo_ESTRPIPE -15823770
|
||||
#define __tmpcosmo_ETIME -15823630
|
||||
#define __tmpcosmo_ETIMEDOUT -15823522
|
||||
#define __tmpcosmo_ETOOMANYREFS -15823586
|
||||
#define __tmpcosmo_ETXTBSY -15823638
|
||||
#define __tmpcosmo_EUCLEAN -15823578
|
||||
#define __tmpcosmo_EUNATCH -15823504
|
||||
#define __tmpcosmo_EUSERS -15823668
|
||||
#define __tmpcosmo_EXDEV -15823752
|
||||
#define __tmpcosmo_EXFULL -15823784
|
||||
|
||||
extern errno_t __errno;
|
||||
errno_t *__errno_location(void);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue