cosmopolitan/libc/str
Justine Tunney 8ff48201ca
Rewrite .zip.o file linker
This change takes an entirely new approach to the incremental linking of
pkzip executables. The assets created by zipobj.com are now treated like
debug data. After a .com.dbg is compiled, fixupobj.com should be run, so
it can apply fixups to the offsets and move the zip directory to the end
of the file. Since debug data doesn't get objcopy'd, a new tool has been
introduced called zipcopy.com which should be run after objcopy whenever
a .com file is created. This is all automated by the `cosmocc` toolchain
which is rapidly becoming the new recommended approach.

This change also introduces the new C23 checked arithmetic macros.
2023-06-10 09:29:44 -07:00
..
a64l.c Add base64 support 2021-03-27 18:17:54 -07:00
bcmp.c Get GCC to mostly build with Cosmo 2023-06-09 06:41:34 -07:00
blake2.c Run clang-format on most sources 2023-04-27 05:44:32 -07:00
blake2.h Decentralize Python native module linkage 2021-09-07 11:40:11 -07:00
blocks.txt Fold LIBC_UNICODE into LIBC_STR 2022-08-13 08:42:32 -07:00
btowc.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
c16rtomb.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
c32rtomb.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
chomp.c Fix basename() and dirname() 2022-04-06 00:13:44 -07:00
chomp16.c Fix basename() and dirname() 2022-04-06 00:13:44 -07:00
classifypath.c Add NET_HTTP to the amalgamation 2022-05-16 14:47:49 -07:00
compareslices.c Refactor out some duplicated code 2021-08-14 06:17:56 -07:00
compareslicescase.c Refactor out some duplicated code 2021-08-14 06:17:56 -07:00
crc32c.c Get LIBC_MEM and LIBC_STDIO building with aarch64 2023-05-10 04:20:47 -07:00
djbsort.c Rewrite .zip.o file linker 2023-06-10 09:29:44 -07:00
dosdatetimetounix.c Undiamond Python headers 2021-08-12 14:07:40 -07:00
eastasianwidth.txt Fold LIBC_UNICODE into LIBC_STR 2022-08-13 08:42:32 -07:00
endswith.c Pay off more technical debt 2022-09-12 23:36:56 -07:00
endswith16.c Pay off more technical debt 2022-09-12 23:36:56 -07:00
escapedos.c Fix basename() and dirname() 2022-04-06 00:13:44 -07:00
findembeddedape.c Fold LIBC_BITS into LIBC_INTRIN 2022-08-11 12:13:18 -07:00
freelocale.c Fold LIBC_UNICODE into LIBC_STR 2022-08-13 08:42:32 -07:00
getcachesize.c Make more code aarch64 friendly 2023-05-10 04:20:46 -07:00
getx86processormodel.c Fold LIBC_ALG into LIBC_MEM 2022-08-13 08:32:34 -07:00
getzipcdircomment.c Introduce #include <cosmo.h> to toolchain users 2023-06-09 18:03:05 -07:00
getzipcdircommentsize.c Introduce #include <cosmo.h> to toolchain users 2023-06-09 18:03:05 -07:00
getzipcdiroffset.c Introduce #include <cosmo.h> to toolchain users 2023-06-09 18:03:05 -07:00
getzipcdirrecords.c Introduce #include <cosmo.h> to toolchain users 2023-06-09 18:03:05 -07:00
getzipcdirsize.c Introduce #include <cosmo.h> to toolchain users 2023-06-09 18:03:05 -07:00
getzipcfilecompressedsize.c Introduce #include <cosmo.h> to toolchain users 2023-06-09 18:03:05 -07:00
getzipcfilemode.c Introduce #include <cosmo.h> to toolchain users 2023-06-09 18:03:05 -07:00
getzipcfileoffset.c Introduce #include <cosmo.h> to toolchain users 2023-06-09 18:03:05 -07:00
getzipcfiletimestamps.c Introduce #include <cosmo.h> to toolchain users 2023-06-09 18:03:05 -07:00
getzipcfileuncompressedsize.c Introduce #include <cosmo.h> to toolchain users 2023-06-09 18:03:05 -07:00
getzipeocd.c Rewrite .zip.o file linker 2023-06-10 09:29:44 -07:00
getziplfilecompressedsize.c Introduce #include <cosmo.h> to toolchain users 2023-06-09 18:03:05 -07:00
getziplfileuncompressedsize.c Introduce #include <cosmo.h> to toolchain users 2023-06-09 18:03:05 -07:00
hexpcpy.c Implement pthread_atfork() 2022-10-16 12:25:13 -07:00
hextoint.c Change license 2020-12-27 17:18:44 -08:00
highwayhash64.c Run clang-format on most sources 2023-04-27 05:44:32 -07:00
highwayhash64.h Make numerous improvements 2021-09-28 01:52:34 -07:00
indexdoublenulstring.c Change license 2020-12-27 17:18:44 -08:00
internal.h Run clang-format on most sources 2023-04-27 05:44:32 -07:00
intsort.c Make some sorting functions faster 2023-04-24 23:11:18 -07:00
isabspath.c Add NET_HTTP to the amalgamation 2022-05-16 14:47:49 -07:00
isalnum.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
isalpha.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
isascii.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
isblank.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
iscntrl.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
isdigit.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
isdirsep.c Fix basename() and dirname() 2022-04-06 00:13:44 -07:00
isgraph.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
islower.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
isprint.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
ispunct.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
isspace.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
istext.c Introduce --strace flag for system call tracing 2022-03-18 18:07:28 -07:00
isupper.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
isutf8.c Fix bugs in cosmocc toolchain 2023-06-08 23:44:03 -07:00
iswalnum.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
iswalpha.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
iswblank.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
iswcntrl.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
iswctype.c Improve LLVM compatibility a little bit 2021-05-16 20:34:46 -07:00
iswdigit.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
iswgraph.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
iswlower.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
iswprint.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
iswpunct.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
iswseparator.c Make fixes, improvements, and chibicc python bindings 2021-10-08 08:41:57 -07:00
iswspace.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
iswupper.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
iswxdigit.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
isxdigit.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
iszipeocd32.c Introduce #include <cosmo.h> to toolchain users 2023-06-09 18:03:05 -07:00
iszipeocd64.c Introduce #include <cosmo.h> to toolchain users 2023-06-09 18:03:05 -07:00
kcombiningchars.S Fold LIBC_UNICODE into LIBC_STR 2022-08-13 08:42:32 -07:00
keastasianwidth.S Make progress towards aarch64 build 2023-05-10 04:20:46 -07:00
khextoint.c Get LIBC_FMT to build for aarch64 2023-05-10 04:20:47 -07:00
kmonthyearday.c Rename hidden keyword to _Hide 2022-11-08 12:55:28 -08:00
kx86processormodels.c Rename hidden keyword to _Hide 2022-11-08 12:55:28 -08:00
l64a.c Add base64 support 2021-03-27 18:17:54 -07:00
langinfo.c Add imaxdiv, wcscoll, getdtablesize (#639) 2022-10-05 07:14:58 -07:00
langinfo.h Fold LIBC_UNICODE into LIBC_STR 2022-08-13 08:42:32 -07:00
locale.h Greatly expand system() shell code features 2022-10-11 21:30:31 -07:00
localeconv.c Fold LIBC_UNICODE into LIBC_STR 2022-08-13 08:42:32 -07:00
longsort.c Make some sorting functions faster 2023-04-24 23:11:18 -07:00
lz4check.c Change license 2020-12-27 17:18:44 -08:00
lz4cpy.c Make more code aarch64 friendly 2023-05-10 04:20:46 -07:00
lz4decode.c Make _Thread_local work across platforms 2022-07-10 04:01:17 -07:00
mb.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
mb.internal.h Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
mblen.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
mbrlen.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
mbrtoc16.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
mbrtoc32.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
mbrtowc.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
mbsinit.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
mbsnrtowcs.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
mbsrtowcs.c Add SSL to redbean 2021-06-24 13:20:50 -07:00
mbstowcs.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
mbtowc.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
memcasecmp.c Make important improvements 2022-09-14 22:39:08 -07:00
memccpy.c Fold LIBC_BITS into LIBC_INTRIN 2022-08-11 12:13:18 -07:00
memchr16.c Make more progress on aarch64 2023-05-10 04:20:47 -07:00
memfrob.c Change license 2020-12-27 17:18:44 -08:00
memmem.c Make more code aarch64 friendly 2023-05-10 04:20:46 -07:00
memrchr16.c Make more code aarch64 friendly 2023-05-10 04:20:46 -07:00
memset16.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
newlocale.c Run clang-format on most sources 2023-04-27 05:44:32 -07:00
nltypes.h Fold LIBC_UNICODE into LIBC_STR 2022-08-13 08:42:32 -07:00
path.h Make pledge() and unveil() work amazingly 2022-07-19 21:33:49 -07:00
rawmemchr.c Make further progress on non-x86 support 2023-05-10 04:20:47 -07:00
rawmemchr16.c Make more progress on aarch64 2023-05-10 04:20:47 -07:00
rldecode2.c Make numerous improvements 2021-09-28 01:52:34 -07:00
setlocale.c Remove some problematic APIs 2023-06-08 06:12:26 -07:00
slice.h Fixup and polish chibicc some more 2022-06-20 04:32:25 -07:00
smoothsort.c Run clang-format on most sources 2023-04-27 05:44:32 -07:00
SpecialCasing.txt Fold LIBC_UNICODE into LIBC_STR 2022-08-13 08:42:32 -07:00
startswith.c Pay off more technical debt 2022-09-12 23:36:56 -07:00
startswith16.c Pay off more technical debt 2022-09-12 23:36:56 -07:00
startswithi.c Make important improvements 2022-09-14 22:39:08 -07:00
stpncpy.c Make numerous improvements 2021-09-28 01:52:34 -07:00
str.h Disable linker map generation and improve tinyness 2023-06-09 03:29:26 -07:00
str.mk Fix bugs in cosmocc toolchain 2023-06-08 23:44:03 -07:00
strcasecmp.c Fix stack abuse in llama.cc 2023-06-08 07:12:26 -07:00
strcasecmp16.c Make major improvements to redbean and libraries 2021-04-18 12:34:15 -07:00
strcasestr.c Make more code aarch64 friendly 2023-05-10 04:20:46 -07:00
strcat.c Get more Python tests passing (#141) 2021-08-16 15:26:31 -07:00
strcat16.c Get more Python tests passing (#141) 2021-08-16 15:26:31 -07:00
strchr16.c Make more progress on aarch64 2023-05-10 04:20:47 -07:00
strchrnul16.c Make more progress on aarch64 2023-05-10 04:20:47 -07:00
strcmp16.c Change license 2020-12-27 17:18:44 -08:00
strcoll.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
strcpy16.c Do some string library work 2022-08-20 22:17:14 -07:00
strcspn.c Get --ftrace working on aarch64 2023-06-05 23:35:31 -07:00
strcspn16.c Change license 2020-12-27 17:18:44 -08:00
strlcat.c Introduce native support for MacOS ARM64 2023-05-20 04:17:03 -07:00
strlcpy.c Introduce native support for MacOS ARM64 2023-05-20 04:17:03 -07:00
strlen16.c Make more code aarch64 friendly 2023-05-10 04:20:46 -07:00
strncasecmp.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
strncasecmp16.c Tune SQLite build for redbean (#97) 2021-06-10 08:00:08 -07:00
strncat.c Add NetBSD support 2021-02-05 06:19:45 -08:00
strncat16.c Undiamond Python headers 2021-08-12 14:07:40 -07:00
strncmp16.c Change license 2020-12-27 17:18:44 -08:00
strncpy.c Greatly expand system() shell code features 2022-10-11 21:30:31 -07:00
strnlen16.c Fix bugs and make code tinier 2022-10-09 23:21:34 -07:00
strnlen_s.c Fix bugs and make code tinier 2022-10-09 23:21:34 -07:00
strntolower.c Change license 2020-12-27 17:18:44 -08:00
strntoupper.c Implement more security stuff 2021-02-02 20:21:06 -08:00
strnwidth.c Fix bugs in cosmocc toolchain 2023-06-08 23:44:03 -07:00
strnwidth16.c Reduce build graph by another eight percent 2022-08-13 13:11:56 -07:00
strpbrk.c Make fixes, improvements, and chibicc python bindings 2021-10-08 08:41:57 -07:00
strpbrk16.c Change license 2020-12-27 17:18:44 -08:00
strrchr16.c Change license 2020-12-27 17:18:44 -08:00
strsep.c Perform some code cleanup 2021-02-27 10:33:32 -08:00
strspn.c Get --ftrace working on aarch64 2023-06-05 23:35:31 -07:00
strspn16.c Change license 2020-12-27 17:18:44 -08:00
strstr.c Make more code aarch64 friendly 2023-05-10 04:20:46 -07:00
strstr16.c Perform some code cleanup 2021-02-27 10:33:32 -08:00
strtok.c Change license 2020-12-27 17:18:44 -08:00
strtok_r.c Change license 2020-12-27 17:18:44 -08:00
strtolower.c Implement more security stuff 2021-02-02 20:21:06 -08:00
strtoupper.c Implement more security stuff 2021-02-02 20:21:06 -08:00
strverscmp.c Work towards improving signals and processes 2021-01-27 19:34:02 -08:00
strwidth.c Make more compatibility improvements 2022-09-06 07:04:13 -07:00
strwidth.h Make more compatibility improvements 2022-09-06 07:04:13 -07:00
strwidth16.c Make more compatibility improvements 2022-09-06 07:04:13 -07:00
strxfrm.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
tab.internal.h Make more progress on aarch64 2023-05-10 04:20:47 -07:00
thompike.h Pay off more technical debt 2022-09-12 23:36:56 -07:00
timespectowindowstime.c Get more Python tests passing (#141) 2021-08-16 15:26:31 -07:00
timevaltowindowstime.c Get more Python tests passing (#141) 2021-08-16 15:26:31 -07:00
timingsafe_bcmp.c Get GCC to mostly build with Cosmo 2023-06-09 06:41:34 -07:00
timingsafe_memcmp.c Make numerous improvements 2021-09-28 01:52:34 -07:00
toascii.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
tolower.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
toupper.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
towctrans.c Import C++ Standard Template Library 2022-03-22 06:41:54 -07:00
towlower.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
towupper.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
tpdecodecb.internal.h Pay off more technical debt 2022-09-12 23:36:56 -07:00
tprecode8to16.c Do some string library work 2022-08-20 22:17:14 -07:00
tprecode16to8.c Pay off more technical debt 2022-09-12 23:36:56 -07:00
unicode-properties.txt Fold LIBC_UNICODE into LIBC_STR 2022-08-13 08:42:32 -07:00
unicode.h Remove some problematic APIs 2023-06-08 06:12:26 -07:00
unicodedata.txt Fold LIBC_UNICODE into LIBC_STR 2022-08-13 08:42:32 -07:00
update.sh Improve cancellations, randomness, and time 2022-11-05 23:45:32 -07:00
uselocale.c Run clang-format on most sources 2023-04-27 05:44:32 -07:00
utf16.h Fold LIBC_BITS into LIBC_INTRIN 2022-08-11 12:13:18 -07:00
wchomp.c Fix basename() and dirname() 2022-04-06 00:13:44 -07:00
wcrtomb.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
wcscasecmp.c Change license 2020-12-27 17:18:44 -08:00
wcscat.c Get more Python tests passing (#141) 2021-08-16 15:26:31 -07:00
wcschr.c Make more progress on aarch64 2023-05-10 04:20:47 -07:00
wcschrnul.c Make more progress on aarch64 2023-05-10 04:20:47 -07:00
wcscmp.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
wcscpy.c Do some string library work 2022-08-20 22:17:14 -07:00
wcscspn.c Change license 2020-12-27 17:18:44 -08:00
wcsendswith.c Pay off more technical debt 2022-09-12 23:36:56 -07:00
wcslen.c Make more code aarch64 friendly 2023-05-10 04:20:46 -07:00
wcsncasecmp.c Do some string library work 2022-08-20 22:17:14 -07:00
wcsncat.c Undiamond Python headers 2021-08-12 14:07:40 -07:00
wcsncmp.c Get TEST_LIBC_STR passing on AARCH64 2023-05-12 18:09:23 -07:00
wcsncpy.c Change license 2020-12-27 17:18:44 -08:00
wcsnlen.c Get LIBC_FMT to build for aarch64 2023-05-10 04:20:47 -07:00
wcsnlen_s.c Get LIBC_FMT to build for aarch64 2023-05-10 04:20:47 -07:00
wcsnrtombs.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
wcsnwidth.c Make improvements 2023-06-06 09:12:30 -07:00
wcspbrk.c Change license 2020-12-27 17:18:44 -08:00
wcsrchr.c Change license 2020-12-27 17:18:44 -08:00
wcsrtombs.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
wcsspn.c Change license 2020-12-27 17:18:44 -08:00
wcsstartswith.c Pay off more technical debt 2022-09-12 23:36:56 -07:00
wcsstr.c Do some string library work 2022-08-20 22:17:14 -07:00
wcstok.c Added wcstok and wmemcmp (#183) 2021-06-09 19:34:27 -07:00
wcstombs.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
wcswidth.c Fold LIBC_UNICODE into LIBC_STR 2022-08-13 08:42:32 -07:00
wcsxfrm.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
wctob.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
wctomb.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
wctrans.c Import C++ Standard Template Library 2022-03-22 06:41:54 -07:00
wctype.c Fold LIBC_BITS into LIBC_INTRIN 2022-08-11 12:13:18 -07:00
wcwidth.c Get TEST_LIBC_STR passing on AARCH64 2023-05-12 18:09:23 -07:00
wcwidth_osx.c Get TEST_LIBC_STR passing on AARCH64 2023-05-12 18:09:23 -07:00
wcwidth_osx.internal.h Get TEST_LIBC_STR passing on AARCH64 2023-05-12 18:09:23 -07:00
windowsdurationtotimespec.c Get more Python tests passing (#141) 2021-08-16 15:26:31 -07:00
windowsdurationtotimeval.c Get more Python tests passing (#141) 2021-08-16 15:26:31 -07:00
windowstimetotimespec.c Get more Python tests passing (#141) 2021-08-16 15:26:31 -07:00
windowstimetotimeval.c Import some Lua documentation 2021-08-22 15:03:04 -07:00
wmemchr.c Get LIBC_FMT to build for aarch64 2023-05-10 04:20:47 -07:00
wmemcmp.c Add more missing C / C++ headers 2022-09-04 04:53:52 -07:00
wmemcpy.c Rewrite .zip.o file linker 2023-06-10 09:29:44 -07:00
wmemmove.c Rewrite .zip.o file linker 2023-06-10 09:29:44 -07:00
wmempcpy.c Rewrite .zip.o file linker 2023-06-10 09:29:44 -07:00
wmemrchr.c Rewrite .zip.o file linker 2023-06-10 09:29:44 -07:00
wmemset.c Add more missing C / C++ headers 2022-09-04 04:53:52 -07:00