Introduce cosmocc flags -mdbg -mtiny -moptlinux

The cosmocc.zip toolchain will now include four builds of the libcosmo.a
runtime libraries. You can pass the -mdbg flag if you want to debug your
cosmopolitan runtime. You can pass the -moptlinux flag if you don't want
windows code lurking in your binary. See tool/cosmocc/README.md for more
details on how these flags may be used and their important implications.
This commit is contained in:
Justine Tunney 2024-07-26 05:10:25 -07:00
parent 59692b0882
commit 642e9cb91a
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
22 changed files with 404 additions and 56 deletions

View file

@ -37,7 +37,7 @@ register long freebsd_ordinal asm("x9");
register long xnu_ordinal asm("x16");
register long cosmo_tls_register asm("x28");
void report_cancelation_point(void);
void report_cancelation_point(int, int);
dontinline long systemfive_cancel(void) {
return _weaken(_pthread_cancel_ack)();
@ -58,9 +58,9 @@ dontinline long systemfive_cancellable(void) {
return systemfive_cancel();
}
#if IsModeDbg()
if (!(pth->pt_flags & PT_INCANCEL)) {
if (!(pth->pt_flags & PT_INCANCEL) && !(pth->pt_flags & PT_NOCANCEL)) {
if (_weaken(report_cancelation_point)) {
_weaken(report_cancelation_point)();
_weaken(report_cancelation_point)(sysv_ordinal, xnu_ordinal);
}
__builtin_trap();
}