mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-07 03:38:31 +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
1
third_party/unzip/crc32.h
vendored
1
third_party/unzip/crc32.h
vendored
|
@ -18,6 +18,7 @@
|
|||
#include "third_party/unzip/unzip.h"
|
||||
#include "third_party/unzip/unzpriv.h"
|
||||
#include "third_party/zip/crc32.h"
|
||||
#include "third_party/unzip/globals.h"
|
||||
|
||||
/* This header should be read AFTER zip.h resp. unzip.h
|
||||
* (the latter with UNZIP_INTERNAL defined...).
|
||||
|
|
1
third_party/unzip/crypt.c
vendored
1
third_party/unzip/crypt.c
vendored
|
@ -34,6 +34,7 @@
|
|||
#include "third_party/unzip/zip.h"
|
||||
#include "third_party/unzip/crypt.h"
|
||||
#include "third_party/unzip/ttyio.h"
|
||||
#include "third_party/unzip/globals.h"
|
||||
|
||||
#if CRYPT
|
||||
|
||||
|
|
32
third_party/unzip/crypt.h
vendored
32
third_party/unzip/crypt.h
vendored
|
@ -27,33 +27,7 @@
|
|||
#define __crypt_h
|
||||
#include "third_party/unzip/crc32.h"
|
||||
|
||||
#ifdef CRYPT
|
||||
# undef CRYPT
|
||||
#endif
|
||||
/*
|
||||
Logic of selecting "full crypt" code:
|
||||
a) default behaviour:
|
||||
- dummy crypt code when compiling UnZipSFX stub, to minimize size
|
||||
- full crypt code when used to compile Zip, UnZip and fUnZip
|
||||
b) USE_CRYPT defined:
|
||||
- always full crypt code
|
||||
c) NO_CRYPT defined:
|
||||
- never full crypt code
|
||||
NO_CRYPT takes precedence over USE_CRYPT
|
||||
*/
|
||||
#if defined(NO_CRYPT)
|
||||
# define CRYPT 0 /* dummy version */
|
||||
#else
|
||||
#if defined(USE_CRYPT)
|
||||
# define CRYPT 1 /* full version */
|
||||
#else
|
||||
#if !defined(SFX)
|
||||
# define CRYPT 1 /* full version for zip and main unzip */
|
||||
#else
|
||||
# define CRYPT 0 /* dummy version for unzip sfx */
|
||||
#endif
|
||||
#endif /* ?USE_CRYPT */
|
||||
#endif /* ?NO_CRYPT */
|
||||
#define CRYPT 1
|
||||
|
||||
#if CRYPT
|
||||
/* full version */
|
||||
|
@ -146,9 +120,7 @@ void init_keys OF((__GPRO__ ZCONST char *passwd));
|
|||
# endif
|
||||
#endif /* ZIP */
|
||||
|
||||
#if (defined(UNZIP) && !defined(FUNZIP))
|
||||
int decrypt OF((__GPRO__ ZCONST char *passwrd));
|
||||
#endif
|
||||
int decrypt OF((__GPRO__ ZCONST char *passwrd));
|
||||
|
||||
#ifdef FUNZIP
|
||||
extern int encrypted;
|
||||
|
|
1
third_party/unzip/explode.c
vendored
1
third_party/unzip/explode.c
vendored
|
@ -117,6 +117,7 @@
|
|||
#define __EXPLODE_C /* identifies this source module */
|
||||
#define UNZIP_INTERNAL
|
||||
#include "third_party/unzip/unzip.h" /* must supply slide[] (uch) array and NEXTBYTE macro */
|
||||
#include "third_party/unzip/globals.h"
|
||||
|
||||
#ifndef WSIZE
|
||||
# define WSIZE 0x8000 /* window size--must be a power of two, and */
|
||||
|
|
2
third_party/unzip/extract.c
vendored
2
third_party/unzip/extract.c
vendored
|
@ -36,6 +36,7 @@
|
|||
#define __EXTRACT_C /* identifies this source module */
|
||||
#define UNZIP_INTERNAL
|
||||
#include "third_party/unzip/unzip.h"
|
||||
#include "third_party/unzip/globals.h"
|
||||
#include "third_party/unzip/crc32.h"
|
||||
#include "libc/alg/alg.h"
|
||||
#include "libc/log/log.h"
|
||||
|
@ -1346,6 +1347,7 @@ static int extract_or_test_entrylist(__G__ numchunk,
|
|||
}
|
||||
|
||||
#if CRYPT
|
||||
int decrypt(const char *);
|
||||
if (G.pInfo->encrypted &&
|
||||
(error = decrypt(__G__ uO.pwdarg)) != PK_COOL) {
|
||||
if (error == PK_WARN) {
|
||||
|
|
1
third_party/unzip/fileio.c
vendored
1
third_party/unzip/fileio.c
vendored
|
@ -81,6 +81,7 @@
|
|||
# endif
|
||||
#endif
|
||||
#include "third_party/unzip/ebcdic.h" /* definition/initialization of ebcdic[] */
|
||||
#include "third_party/unzip/globals.h"
|
||||
|
||||
|
||||
/*
|
||||
|
|
1
third_party/unzip/globals.c
vendored
1
third_party/unzip/globals.c
vendored
|
@ -23,6 +23,7 @@
|
|||
|
||||
#define UNZIP_INTERNAL
|
||||
#include "third_party/unzip/unzip.h"
|
||||
#include "third_party/unzip/globals.h"
|
||||
|
||||
#ifndef FUNZIP
|
||||
/* initialization of sigs is completed at runtime so unzip(sfx) executable
|
||||
|
|
1
third_party/unzip/inflate.c
vendored
1
third_party/unzip/inflate.c
vendored
|
@ -275,6 +275,7 @@
|
|||
/* #define DEBUG */
|
||||
#define INFMOD /* tell inflate.h to include code to be compiled */
|
||||
#include "third_party/unzip/inflate.h"
|
||||
#include "third_party/unzip/globals.h"
|
||||
|
||||
|
||||
/* marker for "unused" huft code, and corresponding check macro */
|
||||
|
|
1
third_party/unzip/list.c
vendored
1
third_party/unzip/list.c
vendored
|
@ -23,6 +23,7 @@
|
|||
|
||||
#define UNZIP_INTERNAL
|
||||
#include "third_party/unzip/unzip.h"
|
||||
#include "third_party/unzip/globals.h"
|
||||
|
||||
|
||||
#ifdef TIMESTAMP
|
||||
|
|
1
third_party/unzip/process.c
vendored
1
third_party/unzip/process.c
vendored
|
@ -33,6 +33,7 @@
|
|||
|
||||
#define UNZIP_INTERNAL
|
||||
#include "third_party/unzip/unzip.h"
|
||||
#include "third_party/unzip/globals.h"
|
||||
#if defined(DYNALLOC_CRCTAB) || defined(UNICODE_SUPPORT)
|
||||
#include "third_party/unzip/crc32.h"
|
||||
#endif
|
||||
|
|
1
third_party/unzip/ttyio.c
vendored
1
third_party/unzip/ttyio.c
vendored
|
@ -32,6 +32,7 @@
|
|||
#include "libc/calls/struct/termios.h"
|
||||
#include "libc/calls/termios.h"
|
||||
#include "third_party/unzip/crypt.h"
|
||||
#include "third_party/unzip/globals.h"
|
||||
|
||||
#if (CRYPT || (defined(UNZIP) && !defined(FUNZIP)))
|
||||
/* Non-echo console/keyboard input is needed for (en/de)cryption's password
|
||||
|
|
1
third_party/unzip/ubz2err.c
vendored
1
third_party/unzip/ubz2err.c
vendored
|
@ -28,6 +28,7 @@
|
|||
#define __UBZ2ERR_C /* identifies this source module */
|
||||
#define UNZIP_INTERNAL
|
||||
#include "third_party/unzip/unzip.h"
|
||||
#include "third_party/unzip/globals.h"
|
||||
|
||||
#ifdef USE_BZIP2
|
||||
|
||||
|
|
1
third_party/unzip/unix.c
vendored
1
third_party/unzip/unix.c
vendored
|
@ -33,6 +33,7 @@
|
|||
#include "libc/log/log.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "third_party/unzip/unzip.h"
|
||||
#include "third_party/unzip/globals.h"
|
||||
|
||||
#ifdef USE_ICONV_MAPPING
|
||||
#endif /* USE_ICONV_MAPPING */
|
||||
|
|
1
third_party/unzip/unshrink.c
vendored
1
third_party/unzip/unshrink.c
vendored
|
@ -69,6 +69,7 @@
|
|||
#define __UNSHRINK_C /* identifies this source module */
|
||||
#define UNZIP_INTERNAL
|
||||
#include "third_party/unzip/unzip.h"
|
||||
#include "third_party/unzip/globals.h"
|
||||
|
||||
|
||||
#ifndef LZW_CLEAN
|
||||
|
|
1
third_party/unzip/unzip.c
vendored
1
third_party/unzip/unzip.c
vendored
|
@ -73,6 +73,7 @@
|
|||
#include "libc/mem/mem.h"
|
||||
#include "libc/runtime/gc.internal.h"
|
||||
#include "third_party/unzip/unzvers.h"
|
||||
#include "third_party/unzip/globals.h"
|
||||
|
||||
#ifndef WINDLL /* The WINDLL port uses windll/windll.c instead... */
|
||||
|
||||
|
|
35
third_party/unzip/unzpriv.h
vendored
35
third_party/unzip/unzpriv.h
vendored
|
@ -23,6 +23,17 @@
|
|||
#ifndef __unzpriv_h /* prevent multiple inclusions */
|
||||
#define __unzpriv_h
|
||||
|
||||
#include "libc/sysv/consts/s.h"
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/errno.h"
|
||||
#include "third_party/unzip/unzpriv.h"
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "third_party/zip/crypt.h"
|
||||
#include "third_party/unzip/unxcfg.h"
|
||||
|
||||
/* First thing: Signal all following code that we compile UnZip utilities! */
|
||||
#ifndef UNZIP
|
||||
# define UNZIP
|
||||
|
@ -208,16 +219,6 @@
|
|||
Unix section:
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
#include "libc/sysv/consts/s.h"
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/errno.h"
|
||||
#include "third_party/unzip/unzpriv.h"
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "third_party/unzip/unxcfg.h"
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
MUST BE AFTER LARGE FILE INCLUDES
|
||||
|
@ -1927,20 +1928,6 @@ typedef struct _APIDocStruct {
|
|||
} APIDocStruct;
|
||||
|
||||
|
||||
|
||||
|
||||
/*************/
|
||||
/* Globals */
|
||||
/*************/
|
||||
|
||||
#if (defined(OS2) && !defined(FUNZIP))
|
||||
#include "third_party/unzip/os2/os2data.h"
|
||||
#endif
|
||||
|
||||
#include "third_party/unzip/globals.h"
|
||||
|
||||
|
||||
|
||||
/*************************/
|
||||
/* Function Prototypes */
|
||||
/*************************/
|
||||
|
|
1
third_party/unzip/zipinfo.c
vendored
1
third_party/unzip/zipinfo.c
vendored
|
@ -25,6 +25,7 @@
|
|||
|
||||
#define UNZIP_INTERNAL
|
||||
#include "third_party/unzip/unzip.h"
|
||||
#include "third_party/unzip/globals.h"
|
||||
|
||||
|
||||
#ifndef NO_ZIPINFO /* strings use up too much space in small-memory systems */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue