mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-28 07:18:30 +00:00
Prove that Makefile is fully defined
The whole repository is now buildable with GNU Make Landlock sandboxing. This proves that no Makefile targets exist which touch files other than their declared prerequisites. In order to do this, we had to: 1. Stop code morphing GCC output in package.com and instead run a newly introduced FIXUPOBJ.COM command after GCC invocations. 2. Disable all the crumby Python unit tests that do things like create files in the current directory, or rename() files between folders. This ended up being a lot of tests, but most of them are still ok. 3. Introduce an .UNSANDBOXED variable to GNU Make to disable Landlock. We currently only do this for things like `make tags`. 4. This change deletes some GNU Make code that was preventing the execve() optimization from working. This means it should no longer be necessary in most cases for command invocations to be indirected through the cocmd interpreter. 5. Missing dependencies had to be declared in certain places, in cases where they couldn't be automatically determined by MKDEPS.COM 6. The libcxx header situation has finally been tamed. One of the things that makes this difficult is MKDEPS.COM only wants to consider the first 64kb of a file, in order to go fast. But libcxx likes to have #include lines buried after huge documentation. 7. An .UNVEIL variable has been introduced to GNU Make just in case we ever wish to explicitly specify additional things that need to be whitelisted which aren't strictly prerequisites. This works in a manner similar to the recently introduced .EXTRA_PREREQS feature. There's now a new build/bootstrap/make.com prebuilt binary available. It should no longer be possible to write invalid Makefile code.
This commit is contained in:
parent
acdf591833
commit
cf93ecbbb2
181 changed files with 1902 additions and 1986 deletions
27
libc/sock/struct/ifconf.h
Normal file
27
libc/sock/struct/ifconf.h
Normal file
|
@ -0,0 +1,27 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_SOCK_STRUCT_IFCONF_H_
|
||||
#define COSMOPOLITAN_LIBC_SOCK_STRUCT_IFCONF_H_
|
||||
#include "libc/sock/struct/ifreq.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
/*
|
||||
* Structure used in SIOCGIFCONF request.
|
||||
* Used to retrieve interface configuration
|
||||
* for machine (useful for programs which
|
||||
* must know all networks accessible).
|
||||
*/
|
||||
struct ifconf {
|
||||
uint64_t ifc_len; /* size of buffer */
|
||||
union {
|
||||
char *ifcu_buf;
|
||||
struct ifreq *ifcu_req;
|
||||
} ifc_ifcu;
|
||||
};
|
||||
|
||||
/* Shortcuts to the ifconf buffer or ifreq array */
|
||||
#define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */
|
||||
#define ifc_req ifc_ifcu.ifcu_req /* array of structures */
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_SOCK_STRUCT_IFCONF_H_ */
|
30
libc/sock/struct/ifreq.h
Normal file
30
libc/sock/struct/ifreq.h
Normal file
|
@ -0,0 +1,30 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_SOCK_STRUCT_IFREQ_H_
|
||||
#define COSMOPOLITAN_LIBC_SOCK_STRUCT_IFREQ_H_
|
||||
#include "libc/sock/struct/sockaddr.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
struct ifreq {
|
||||
union {
|
||||
char ifrn_name[IFNAMSIZ]; /* Interface name, e.g. "en0". */
|
||||
} ifr_ifrn;
|
||||
union {
|
||||
struct sockaddr ifru_addr; /* SIOCGIFADDR */
|
||||
struct sockaddr ifru_dstaddr; /* SIOCGIFDSTADDR */
|
||||
struct sockaddr ifru_netmask; /* SIOCGIFNETMASK */
|
||||
struct sockaddr ifru_broadaddr; /* SIOCGIFBRDADDR */
|
||||
short ifru_flags; /* SIOCGIFFLAGS */
|
||||
char ifru_pad[24]; /* ifru_map is the largest, just pad */
|
||||
} ifr_ifru;
|
||||
};
|
||||
|
||||
#define ifr_name ifr_ifrn.ifrn_name /* interface name */
|
||||
#define ifr_addr ifr_ifru.ifru_addr /* address */
|
||||
#define ifr_netmask ifr_ifru.ifru_netmask /* netmask */
|
||||
#define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */
|
||||
#define ifr_dstaddr ifr_ifru.ifru_dstaddr /* destination address */
|
||||
#define ifr_flags ifr_ifru.ifru_flags /* flags */
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_SOCK_STRUCT_IFREQ_H_ */
|
13
libc/sock/struct/ip_mreq.h
Normal file
13
libc/sock/struct/ip_mreq.h
Normal file
|
@ -0,0 +1,13 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_SOCK_STRUCT_IP_MREQ_H_
|
||||
#define COSMOPOLITAN_LIBC_SOCK_STRUCT_IP_MREQ_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
struct ip_mreq {
|
||||
struct in_addr imr_multiaddr; /* IP multicast address of group */
|
||||
struct in_addr imr_interface; /* local IP address of interface */
|
||||
};
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_SOCK_STRUCT_IP_MREQ_H_ */
|
|
@ -14,6 +14,9 @@ struct msghdr { /* Linux+NT ABI */
|
|||
uint32_t msg_flags; /* MSG_XXX */
|
||||
};
|
||||
|
||||
ssize_t recvmsg(int, struct msghdr *, int);
|
||||
ssize_t sendmsg(int, const struct msghdr *, int);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_SOCK_STRUCT_MSGHDR_H_ */
|
||||
|
|
|
@ -9,6 +9,8 @@ struct pollfd {
|
|||
int16_t revents;
|
||||
};
|
||||
|
||||
int poll(struct pollfd *, uint64_t, int32_t);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_SOCK_STRUCT_POLLFD_H_ */
|
||||
|
|
|
@ -33,6 +33,9 @@ struct sockaddr_storage {
|
|||
};
|
||||
};
|
||||
|
||||
int inet_aton(const char *, struct in_addr *);
|
||||
char *inet_ntoa(struct in_addr);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_SOCK_STRUCT_SOCKADDR_H_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue