From 211d5d902e37f5078306aee1f6b87b4759277caa Mon Sep 17 00:00:00 2001 From: Gautham <41098605+ahgamut@users.noreply.github.com> Date: Mon, 9 Oct 2023 16:39:02 -0500 Subject: [PATCH] Changes made for cosmocc builds (#908) --- bin/cosmocc | 2 +- libc/integral/c.inc | 5 +++++ libc/isystem/sys/cdefs.h | 0 libc/isystem/sys/socket.h | 1 + libc/isystem/ucontext.h | 4 ++++ libc/isystem/unistd.h | 5 +++++ libc/thread/semaphore.h | 1 + 7 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 libc/isystem/sys/cdefs.h create mode 100644 libc/isystem/ucontext.h diff --git a/bin/cosmocc b/bin/cosmocc index 625a6dbc763..eecc99756b7 100755 --- a/bin/cosmocc +++ b/bin/cosmocc @@ -182,7 +182,7 @@ fi if [ "$1" = "--update" ]; then cd $COSMO || exit echo "building cosmo host toolchain..." >&2 - make --silent -j toolchain MODE= || exit + make --silent -j toolchain MODE= ARCH=x86_64 || exit echo "building cosmo target (MODE=$MODE) toolchain..." >&2 make --silent -j toolchain MODE="$MODE" || exit echo "setting up your cosmos..." >&2 diff --git a/libc/integral/c.inc b/libc/integral/c.inc index 1a5aae09d50..c4da8a4c5a0 100644 --- a/libc/integral/c.inc +++ b/libc/integral/c.inc @@ -138,9 +138,14 @@ typedef signed __int128 int128_t; typedef unsigned __int128 uint128_t; #endif #endif /* _COSMO_SOURCE */ + +#ifndef __AXDX_T +#define __AXDX_T typedef struct { intptr_t ax, dx; } axdx_t; +#endif + #ifndef __chibicc__ #define va_list __builtin_va_list diff --git a/libc/isystem/sys/cdefs.h b/libc/isystem/sys/cdefs.h new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libc/isystem/sys/socket.h b/libc/isystem/sys/socket.h index e2427ddfef3..4c51ed938fc 100644 --- a/libc/isystem/sys/socket.h +++ b/libc/isystem/sys/socket.h @@ -8,6 +8,7 @@ #include "libc/sock/struct/sockaddr.h" #include "libc/sysv/consts/af.h" #include "libc/sysv/consts/limits.h" +#include "libc/sysv/consts/msg.h" #include "libc/sysv/consts/pf.h" #include "libc/sysv/consts/scm.h" #include "libc/sysv/consts/shut.h" diff --git a/libc/isystem/ucontext.h b/libc/isystem/ucontext.h new file mode 100644 index 00000000000..310861d41e7 --- /dev/null +++ b/libc/isystem/ucontext.h @@ -0,0 +1,4 @@ +#ifndef _UCONTEXT_H +#define _UCONTEXT_H +#include "libc/calls/ucontext.h" +#endif diff --git a/libc/isystem/unistd.h b/libc/isystem/unistd.h index 4e343e0ccef..942c30e74a5 100644 --- a/libc/isystem/unistd.h +++ b/libc/isystem/unistd.h @@ -13,4 +13,9 @@ #include "third_party/getopt/long1.h" #include "third_party/musl/crypt.h" #include "third_party/musl/lockf.h" + +#ifndef _CS_PATH +#define _CS_PATH 0 +#endif + #endif /* _UNISTD_H */ diff --git a/libc/thread/semaphore.h b/libc/thread/semaphore.h index 052a2dee66a..4e759e1c80a 100644 --- a/libc/thread/semaphore.h +++ b/libc/thread/semaphore.h @@ -1,6 +1,7 @@ #ifndef COSMOPOLITAN_LIBC_CALLS_SEMAPHORE_H_ #define COSMOPOLITAN_LIBC_CALLS_SEMAPHORE_H_ #include "libc/calls/struct/timespec.h" +#include "libc/stdbool.h" #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_