mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-24 03:20:30 +00:00
Improve cosmocc toolchain
- Decouple zlib from libc - Add some underscores to mostly internal names
This commit is contained in:
parent
713d4424c6
commit
ba180e754d
25 changed files with 128 additions and 42 deletions
18
third_party/puff/README.cosmo
vendored
Normal file
18
third_party/puff/README.cosmo
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
DESCRIPTION
|
||||
|
||||
puff is a tiny implementation of deflate decompression
|
||||
|
||||
LICENSE
|
||||
|
||||
zlib license
|
||||
|
||||
ORIGIN
|
||||
|
||||
Origin: git@github.com:madler/zlib.git
|
||||
Commit: 03614c56ad299f9b238c75aa1e66f0c08fc4fc8b
|
||||
Author: Mark Adler <madler@alumni.caltech.edu>
|
||||
Date: Sun Oct 30 08:36:13 2016 -0700
|
||||
|
||||
LOCAL CHANGES
|
||||
|
||||
None.
|
|
@ -23,7 +23,7 @@
|
|||
│ Mark Adler madler@alumni.caltech.edu │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "third_party/zlib/puff.h"
|
||||
#include "third_party/puff/puff.h"
|
||||
// clang-format off
|
||||
|
||||
asm(".ident\t\"\\n\\n\
|
||||
|
@ -825,10 +825,10 @@ local int dynamic(struct state *s)
|
|||
* block (if it was a fixed or dynamic block) are undefined and have no
|
||||
* expected values to check.
|
||||
*/
|
||||
int puff(unsigned char *dest, /* pointer to destination pointer */
|
||||
unsigned long *destlen, /* amount of output space */
|
||||
const unsigned char *source, /* pointer to source data pointer */
|
||||
unsigned long *sourcelen) /* amount of input available */
|
||||
int _puff(unsigned char *dest, /* pointer to destination pointer */
|
||||
unsigned long *destlen, /* amount of output space */
|
||||
const unsigned char *source, /* pointer to source data pointer */
|
||||
unsigned long *sourcelen) /* amount of input available */
|
||||
{
|
||||
struct state s; /* input/output state */
|
||||
int last, type; /* block information */
|
|
@ -7,8 +7,8 @@ COSMOPOLITAN_C_START_
|
|||
#define NIL ((unsigned char *)0) /* for no output option */
|
||||
#endif
|
||||
|
||||
int puff(unsigned char *dest, unsigned long *destlen,
|
||||
const unsigned char *source, unsigned long *sourcelen);
|
||||
int _puff(unsigned char *dest, unsigned long *destlen,
|
||||
const unsigned char *source, unsigned long *sourcelen);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
45
third_party/puff/puff.mk
vendored
Normal file
45
third_party/puff/puff.mk
vendored
Normal file
|
@ -0,0 +1,45 @@
|
|||
#-*-mode:makefile-gmake;indent-tabs-mode:t;tab-width:8;coding:utf-8-*-┐
|
||||
#───vi: set et ft=make ts=8 tw=8 fenc=utf-8 :vi───────────────────────┘
|
||||
|
||||
PKGS += THIRD_PARTY_PUFF
|
||||
|
||||
THIRD_PARTY_PUFF_ARTIFACTS += THIRD_PARTY_PUFF_A
|
||||
THIRD_PARTY_PUFF = $(THIRD_PARTY_PUFF_A_DEPS) $(THIRD_PARTY_PUFF_A)
|
||||
THIRD_PARTY_PUFF_A = o/$(MODE)/third_party/puff/puff.a
|
||||
THIRD_PARTY_PUFF_A_FILES := $(wildcard third_party/puff/*)
|
||||
THIRD_PARTY_PUFF_A_HDRS = $(filter %.h,$(THIRD_PARTY_PUFF_A_FILES))
|
||||
THIRD_PARTY_PUFF_A_SRCS = $(filter %.c,$(THIRD_PARTY_PUFF_A_FILES))
|
||||
|
||||
THIRD_PARTY_PUFF_A_OBJS = \
|
||||
$(THIRD_PARTY_PUFF_A_SRCS:%.c=o/$(MODE)/%.o)
|
||||
|
||||
THIRD_PARTY_PUFF_A_CHECKS = \
|
||||
$(THIRD_PARTY_PUFF_A).pkg \
|
||||
$(THIRD_PARTY_PUFF_A_HDRS:%=o/$(MODE)/%.ok)
|
||||
|
||||
THIRD_PARTY_PUFF_A_DIRECTDEPS = \
|
||||
LIBC_INTRIN \
|
||||
LIBC_NEXGEN32E \
|
||||
LIBC_STUBS
|
||||
|
||||
THIRD_PARTY_PUFF_A_DEPS := \
|
||||
$(call uniq,$(foreach x,$(THIRD_PARTY_PUFF_A_DIRECTDEPS),$($(x))))
|
||||
|
||||
$(THIRD_PARTY_PUFF_A): \
|
||||
third_party/puff/ \
|
||||
$(THIRD_PARTY_PUFF_A).pkg \
|
||||
$(THIRD_PARTY_PUFF_A_OBJS)
|
||||
|
||||
$(THIRD_PARTY_PUFF_A).pkg: \
|
||||
$(THIRD_PARTY_PUFF_A_OBJS) \
|
||||
$(foreach x,$(THIRD_PARTY_PUFF_A_DIRECTDEPS),$($(x)_A).pkg)
|
||||
|
||||
THIRD_PARTY_PUFF_LIBS = $(foreach x,$(THIRD_PARTY_PUFF_ARTIFACTS),$($(x)))
|
||||
THIRD_PARTY_PUFF_SRCS = $(foreach x,$(THIRD_PARTY_PUFF_ARTIFACTS),$($(x)_SRCS))
|
||||
THIRD_PARTY_PUFF_HDRS = $(foreach x,$(THIRD_PARTY_PUFF_ARTIFACTS),$($(x)_HDRS))
|
||||
THIRD_PARTY_PUFF_CHECKS = $(foreach x,$(THIRD_PARTY_PUFF_ARTIFACTS),$($(x)_CHECKS))
|
||||
THIRD_PARTY_PUFF_OBJS = $(foreach x,$(THIRD_PARTY_PUFF_ARTIFACTS),$($(x)_OBJS))
|
||||
|
||||
.PHONY: o/$(MODE)/third_party/puff
|
||||
o/$(MODE)/third_party/puff: \
|
||||
$(THIRD_PARTY_PUFF_CHECKS)
|
1
third_party/third_party.mk
vendored
1
third_party/third_party.mk
vendored
|
@ -23,6 +23,7 @@ o/$(MODE)/third_party: \
|
|||
o/$(MODE)/third_party/mbedtls \
|
||||
o/$(MODE)/third_party/musl \
|
||||
o/$(MODE)/third_party/nsync \
|
||||
o/$(MODE)/third_party/puff \
|
||||
o/$(MODE)/third_party/python \
|
||||
o/$(MODE)/third_party/quickjs \
|
||||
o/$(MODE)/third_party/regex \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue