diff --git a/.gitignore b/.gitignore index ad6b6502a..7d5f217e9 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,3 @@ __pycache__ /TAGS /bx_enh_dbg.ini /tool/emacs/*.elc -/usr/share/dict/words diff --git a/Makefile b/Makefile index f2282e120..f5e15c7a2 100644 --- a/Makefile +++ b/Makefile @@ -59,9 +59,9 @@ # # build/config.mk -SHELL = /bin/sh +SHELL = build/bootstrap/cocmd.com HOSTS ?= freebsd openbsd netbsd rhel7 rhel5 win7 win10 xnu -SANITY := $(shell build/sanitycheck $$PPID) +#SANITY := $(shell build/sanitycheck $$PPID) .SUFFIXES: .DELETE_ON_ERROR: @@ -229,7 +229,7 @@ depend: o/$(MODE)/depend tags: TAGS HTAGS o/$(MODE)/.x: - @mkdir -p $(@D) && touch $@ + @$(COMPILE) -AMKDIR -tT$@ $(MKDIR) $(@D) o/$(MODE)/srcs.txt: o/$(MODE)/.x $(MAKEFILES) $(call uniq,$(foreach x,$(SRCS),$(dir $(x)))) $(file >$@,$(SRCS)) @@ -246,11 +246,11 @@ o/$(MODE)/hdrs-old.txt: o/$(MODE)/.x $(MAKEFILES) $(call uniq,$(foreach x,$(HDRS $(file >$@) $(foreach x,$(HDRS) $(INCS),$(file >>$@,$(x))) TAGS: o/$(MODE)/srcs-old.txt $(SRCS) - @rm -f $@ + @$(RM) $@ @$(COMPILE) -ATAGS -T$@ $(TAGS) $(TAGSFLAGS) -L $< -o $@ HTAGS: o/$(MODE)/hdrs-old.txt $(HDRS) - @rm -f $@ + @$(RM) $@ @$(COMPILE) -ATAGS -T$@ build/htags -L $< -o $@ loc: o/$(MODE)/tool/build/summy.com @@ -390,9 +390,9 @@ $(SRCS): $(HDRS): $(INCS): .DEFAULT: - @echo >&2 - @echo NOTE: deleting o/$(MODE)/depend because of an unspecified prerequisite: $@ >&2 - @echo >&2 - rm -f o/$(MODE)/depend + @$(ECHO) >&2 + @$(ECHO) NOTE: deleting o/$(MODE)/depend because of an unspecified prerequisite: $@ >&2 + @$(ECHO) >&2 + $(RM) o/$(MODE)/depend -include o/$(MODE)/depend diff --git a/README.md b/README.md index 2e44683bc..a00dfb8a2 100644 --- a/README.md +++ b/README.md @@ -64,15 +64,19 @@ that, you can use the following flag to turn your binary into the platform local format (ELF or Mach-O): ```sh +$ file hello.com +hello.com: DOS/MBR boot sector ./hello.com --assimilate +$ file hello.com +hello.com: ELF 64-bit LSB executable ``` There's also some other useful flags that get baked into your binary by default: ```sh -./hello.com --strace -./hello.com --ftrace +./hello.com --strace # log system calls to stderr +./hello.com --ftrace # log function calls to stderr ``` If you want your `hello.com` program to be much tinier, more on the @@ -100,22 +104,85 @@ Windows](https://justine.lol/cosmopolitan/windows-compiling.html) tutorial. It's needed because the ELF object format is what makes universal binaries possible. +Cosmopolitan officially only builds on Linux. However, one highly +experimental (and currently broken) thing you could try, is building the +entire cosmo repository from source using the cross9 toolchain. + +``` +mkdir -p o/third_party +rm -rf o/third_party/gcc +wget https://justine.lol/linux-compiler-on-windows/cross9.zip +unzip cross9.zip +mv cross9 o/third_party/gcc +build/bootstrap/make.com +``` + ## Source Builds -Cosmopolitan can be compiled from source on any Linux distro. GNU make -needs to be installed beforehand. This is a freestanding hermetic -repository that bootstraps using a vendored static gcc9 executable. -No further dependencies are required. +Cosmopolitan can be compiled from source on any Linux distro. First, you +need to download or clone the repository. ```sh wget https://justine.lol/cosmopolitan/cosmopolitan.tar.gz tar xf cosmopolitan.tar.gz # see releases page cd cosmopolitan -make -j16 +``` + +This will build the entire repository and run all the tests: + +```sh +build/bootstrap/make.com -j16 o//examples/hello.com find o -name \*.com | xargs ls -rShal | less ``` +If you get an error running make.com then it's probably because you have +WINE installed to `binfmt_misc`. You can fix that by installing the the +APE loader as an interpreter. It'll improve build performance too! + +```sh +ape/apeinstall.sh +``` + +Since the Cosmopolitan repository is very large, you might only want to +build a particular thing. Cosmopolitan's build config does a good job at +having minimal deterministic builds. For example, if you wanted to build +only hello.com then you could do that as follows: + +```sh +build/bootstrap/make.com -j16 o//examples/hello.com +``` + +Sometimes it's desirable to build a subset of targets, without having to +list out each individual one. You can do that by asking make to build a +directory name. For example, if you wanted to build only the targets and +subtargets of the chibicc package including its tests, you would say: + +```sh +build/bootstrap/make.com -j16 o//third_party/chibicc +o//third_party/chibicc/chibicc.com --help +``` + +Cosmopolitan provides a variety of build modes. For example, if you want +really tiny binaries (as small as 12kb in size) then you'd say: + +```sh +build/bootstrap/make.com -j16 MODE=tiny +``` + +Here's some other build modes you can try: + +```sh +build/bootstrap/make.com -j16 MODE=dbg # asan + ubsan + debug +build/bootstrap/make.com -j16 MODE=asan # production memory safety +build/bootstrap/make.com -j16 MODE=opt # -march=native optimizations +build/bootstrap/make.com -j16 MODE=rel # traditional release binaries +build/bootstrap/make.com -j16 MODE=optlinux # optimal linux-only performance +build/bootstrap/make.com -j16 MODE=tinylinux # tiniest linux-only 4kb binaries +``` + +For further details, see [//build/config.mk](build/config.mk). + ## GDB Here's the recommended `~/.gdbinit` config: @@ -159,4 +226,3 @@ gdb foo.com -ex 'add-symbol-file foo.com.dbg 0x401000' | FreeBSD | 12 | 2018 | | OpenBSD | 6.4 | 2018 | | NetBSD | 9.1 | 2020 | -| GNU Make | 4.0 | 2015 | diff --git a/ape/ape.mk b/ape/ape.mk index 759296ec4..14b0880b3 100644 --- a/ape/ape.mk +++ b/ape/ape.mk @@ -15,38 +15,38 @@ PKGS += APE -APE = o/$(MODE)/ape/ape.o \ +APE = o/$(MODE)/ape/ape.o \ o/$(MODE)/ape/ape.lds -APE_NO_MODIFY_SELF = \ - o/$(MODE)/ape/ape.lds \ +APE_NO_MODIFY_SELF = \ + o/$(MODE)/ape/ape.lds \ o/$(MODE)/ape/ape-no-modify-self.o -APE_COPY_SELF = \ - o/$(MODE)/ape/ape.lds \ +APE_COPY_SELF = \ + o/$(MODE)/ape/ape.lds \ o/$(MODE)/ape/ape-copy-self.o -APELINK = \ - $(COMPILE) \ - -ALINK.ape \ - $(LINK) \ - $(LINKARGS) \ +APELINK = \ + $(COMPILE) \ + -ALINK.ape \ + $(LINK) \ + $(LINKARGS) \ $(OUTPUT_OPTION) -APE_LOADER_FLAGS = \ - -DNDEBUG \ - -iquote. \ - -Wall \ - -Wextra \ - -fpie \ - -Os \ - -ffreestanding \ - -mgeneral-regs-only \ - -mno-red-zone \ - -fno-ident \ - -fno-gnu-unique \ - -c \ - $(OUTPUT_OPTION) \ +APE_LOADER_FLAGS = \ + -DNDEBUG \ + -iquote. \ + -Wall \ + -Wextra \ + -fpie \ + -Os \ + -ffreestanding \ + -mgeneral-regs-only \ + -mno-red-zone \ + -fno-ident \ + -fno-gnu-unique \ + -c \ + $(OUTPUT_OPTION) \ $< APE_FILES := $(wildcard ape/*.*) @@ -58,32 +58,32 @@ APE_SRCS = $(APE_SRCS_C) $(APE_SRCS_S) APE_OBJS = $(APE_SRCS_S:%.S=o/$(MODE)/%.o) APE_CHECKS = $(APE_HDRS:%=o/%.ok) -o/$(MODE)/ape/ape.lds: \ - ape/ape.lds \ - ape/macros.internal.h \ - libc/dce.h \ +o/$(MODE)/ape/ape.lds: \ + ape/ape.lds \ + ape/macros.internal.h \ + libc/dce.h \ libc/zip.h -o/ape/idata.inc: \ - ape/idata.internal.h \ +o/ape/idata.inc: \ + ape/idata.internal.h \ ape/relocations.h -o/$(MODE)/ape/ape-no-modify-self.o: \ - ape/ape.S \ +o/$(MODE)/ape/ape-no-modify-self.o: \ + ape/ape.S \ o/$(MODE)/ape/ape.elf - @$(COMPILE) \ - -AOBJECTIFY.S \ - $(OBJECTIFY.S) \ - $(OUTPUT_OPTION) \ - -DAPE_NO_MODIFY_SELF \ - -DAPE_LOADER="\"o/$(MODE)/ape/ape.elf\"" $< + @$(COMPILE) \ + -AOBJECTIFY.S \ + $(OBJECTIFY.S) \ + $(OUTPUT_OPTION) \ + -DAPE_NO_MODIFY_SELF \ + -DAPE_LOADER='"o/$(MODE)/ape/ape.elf"' $< -o/$(MODE)/ape/ape-copy-self.o: \ +o/$(MODE)/ape/ape-copy-self.o: \ ape/ape.S - @$(COMPILE) \ - -AOBJECTIFY.S \ - $(OBJECTIFY.S) \ - $(OUTPUT_OPTION) \ + @$(COMPILE) \ + -AOBJECTIFY.S \ + $(OBJECTIFY.S) \ + $(OUTPUT_OPTION) \ -DAPE_NO_MODIFY_SELF $< o/$(MODE)/ape/loader.o: ape/loader.c @@ -103,22 +103,23 @@ o/$(MODE)/ape/loader-xnu-clang.asm: ape/loader.c o/$(MODE)/ape/ape.elf: o/$(MODE)/ape/ape.elf.dbg o/$(MODE)/ape/ape.macho: o/$(MODE)/ape/ape.macho.dbg -o/$(MODE)/ape/ape.elf.dbg: \ - o/$(MODE)/ape/loader.o \ - o/$(MODE)/ape/loader-elf.o \ +o/$(MODE)/ape/ape.elf.dbg: \ + o/$(MODE)/ape/loader.o \ + o/$(MODE)/ape/loader-elf.o \ ape/loader.lds @$(ELFLINK) -z max-page-size=0x10 -o/$(MODE)/ape/ape.macho.dbg: \ - o/$(MODE)/ape/loader-xnu.o \ - o/$(MODE)/ape/loader-macho.o \ +o/$(MODE)/ape/ape.macho.dbg: \ + o/$(MODE)/ape/loader-xnu.o \ + o/$(MODE)/ape/loader-macho.o \ ape/loader-macho.lds @$(ELFLINK) -z max-page-size=0x10 .PHONY: o/$(MODE)/ape -o/$(MODE)/ape: $(APE) \ - $(APE_CHECKS) \ - o/$(MODE)/ape/ape.elf \ - o/$(MODE)/ape/ape.macho \ - o/$(MODE)/ape/ape-copy-self.o \ +o/$(MODE)/ape: $(APE_CHECKS) \ + o/$(MODE)/ape/ape.o \ + o/$(MODE)/ape/ape.lds \ + o/$(MODE)/ape/ape.elf \ + o/$(MODE)/ape/ape.macho \ + o/$(MODE)/ape/ape-copy-self.o \ o/$(MODE)/ape/ape-no-modify-self.o diff --git a/build/bootstrap/ar.com b/build/bootstrap/ar.com index 90bd84a8f..0f1dc30ec 100755 Binary files a/build/bootstrap/ar.com and b/build/bootstrap/ar.com differ diff --git a/build/bootstrap/cocmd.com b/build/bootstrap/cocmd.com new file mode 100755 index 000000000..d31f42752 Binary files /dev/null and b/build/bootstrap/cocmd.com differ diff --git a/build/bootstrap/compile.com b/build/bootstrap/compile.com index df9521d24..0ebc35571 100755 Binary files a/build/bootstrap/compile.com and b/build/bootstrap/compile.com differ diff --git a/build/bootstrap/cp.com b/build/bootstrap/cp.com new file mode 100755 index 000000000..421917e28 Binary files /dev/null and b/build/bootstrap/cp.com differ diff --git a/build/bootstrap/echo.com b/build/bootstrap/echo.com new file mode 100755 index 000000000..7e2cb9852 Binary files /dev/null and b/build/bootstrap/echo.com differ diff --git a/build/bootstrap/gzip.com b/build/bootstrap/gzip.com new file mode 100755 index 000000000..2e1c78976 Binary files /dev/null and b/build/bootstrap/gzip.com differ diff --git a/build/bootstrap/make.com b/build/bootstrap/make.com new file mode 100755 index 000000000..69751182a Binary files /dev/null and b/build/bootstrap/make.com differ diff --git a/build/bootstrap/mkdeps.com b/build/bootstrap/mkdeps.com index 7a8296c2d..bbb1e066d 100755 Binary files a/build/bootstrap/mkdeps.com and b/build/bootstrap/mkdeps.com differ diff --git a/build/bootstrap/mkdir.com b/build/bootstrap/mkdir.com new file mode 100755 index 000000000..2307febea Binary files /dev/null and b/build/bootstrap/mkdir.com differ diff --git a/build/bootstrap/package.com b/build/bootstrap/package.com index 285af9e64..b5b0e8790 100755 Binary files a/build/bootstrap/package.com and b/build/bootstrap/package.com differ diff --git a/build/bootstrap/pwd.com b/build/bootstrap/pwd.com new file mode 100755 index 000000000..dc562bf51 Binary files /dev/null and b/build/bootstrap/pwd.com differ diff --git a/build/bootstrap/rm.com b/build/bootstrap/rm.com new file mode 100755 index 000000000..a99f8296b Binary files /dev/null and b/build/bootstrap/rm.com differ diff --git a/build/bootstrap/touch.com b/build/bootstrap/touch.com new file mode 100755 index 000000000..3a9630ce5 Binary files /dev/null and b/build/bootstrap/touch.com differ diff --git a/build/bootstrap/unbundle.com b/build/bootstrap/unbundle.com new file mode 100755 index 000000000..e3ddc7d8f Binary files /dev/null and b/build/bootstrap/unbundle.com differ diff --git a/build/bootstrap/zipobj.com b/build/bootstrap/zipobj.com index 1980a9018..c4702c1f8 100755 Binary files a/build/bootstrap/zipobj.com and b/build/bootstrap/zipobj.com differ diff --git a/build/definitions.mk b/build/definitions.mk index cfb7eafe8..6274df0b3 100644 --- a/build/definitions.mk +++ b/build/definitions.mk @@ -50,15 +50,42 @@ ARFLAGS = rcsD ZFLAGS ?= XARGS ?= xargs -P4 -rs8000 DOT ?= dot -GZ ?= gzip CLANG = clang FC = gfortran #/opt/cross9f/bin/x86_64-linux-musl-gfortran +TMPDIR = o/tmp -# see build/compile, etc. which run third_party/gcc/unbundle.sh AR = build/bootstrap/ar.com +CP = build/bootstrap/cp.com +RM = build/bootstrap/rm.com -f +ECHO = build/bootstrap/echo.com +TOUCH = build/bootstrap/touch.com PKG = build/bootstrap/package.com MKDEPS = build/bootstrap/mkdeps.com ZIPOBJ = build/bootstrap/zipobj.com +MKDIR = build/bootstrap/mkdir.com -p +COMPILE = build/bootstrap/compile.com -V9 $(QUOTA) + +COMMA := , +PWD := $(shell build/bootstrap/pwd.com) +IMAGE_BASE_VIRTUAL ?= 0x400000 + +IGNORE := $(shell $(ECHO) -2 ♥cosmo) +IGNORE := $(shell $(MKDIR) o/tmp) + +ifneq ("$(wildcard o/third_party/gcc/bin/x86_64-pc-linux-gnu-as.exe)","") +AS = o/third_party/gcc/bin/x86_64-pc-linux-gnu-as.exe +CC = o/third_party/gcc/bin/x86_64-pc-linux-gnu-gcc.exe +CXX = o/third_party/gcc/bin/x86_64-pc-linux-gnu-g++.exe +CXXFILT = o/third_party/gcc/bin/x86_64-pc-linux-gnu-c++filt.exe +LD = o/third_party/gcc/bin/x86_64-pc-linux-gnu-ld.bfd.exe +NM = o/third_party/gcc/bin/x86_64-pc-linux-gnu-nm.exe +GCC = o/third_party/gcc/bin/x86_64-pc-linux-gnu-gcc.exe +STRIP = o/third_party/gcc/bin/x86_64-pc-linux-gnu-strip.exe +OBJCOPY = o/third_party/gcc/bin/x86_64-pc-linux-gnu-objcopy.exe +OBJDUMP = o/third_party/gcc/bin/x86_64-pc-linux-gnu-objdump.exe +ADDR2LINE = $(shell build/bootstrap/pwd.com)/o/third_party/gcc/bin/x86_64-pc-linux-gnu-addr2line.exe +else +IGNORE := $(shell build/bootstrap/unbundle.com) AS = o/third_party/gcc/bin/x86_64-linux-musl-as CC = o/third_party/gcc/bin/x86_64-linux-musl-gcc CXX = o/third_party/gcc/bin/x86_64-linux-musl-g++ @@ -69,18 +96,12 @@ GCC = o/third_party/gcc/bin/x86_64-linux-musl-gcc STRIP = o/third_party/gcc/bin/x86_64-linux-musl-strip OBJCOPY = o/third_party/gcc/bin/x86_64-linux-musl-objcopy OBJDUMP = o/third_party/gcc/bin/x86_64-linux-musl-objdump -ADDR2LINE = $(shell pwd)/o/third_party/gcc/bin/x86_64-linux-musl-addr2line - -COMMA := , -PWD := $(shell pwd) -IMAGE_BASE_VIRTUAL ?= 0x400000 -HELLO := $(shell build/hello) -TMPDIR := $(shell build/findtmp) -SPAWNER := $(shell build/getcompile) -V$(shell build/getccversion $(CC)) -COMPILE = $(SPAWNER) $(HARNESSFLAGS) $(QUOTA) +ADDR2LINE = $(shell build/bootstrap/pwd.com)/o/third_party/gcc/bin/x86_64-linux-musl-addr2line +endif export ADDR2LINE export LC_ALL +export MKDIR export MODE export SOURCE_DATE_EPOCH export TMPDIR @@ -115,7 +136,7 @@ TRADITIONAL = \ DEFAULT_CCFLAGS = \ -Wall \ -Werror \ - -fdebug-prefix-map="$(PWD)"= \ + -fdebug-prefix-map='$(PWD)'= \ -frecord-gcc-switches DEFAULT_OFLAGS = \ @@ -180,7 +201,7 @@ PYFLAGS = \ ASONLYFLAGS = \ -c \ -g \ - --debug-prefix-map="$(PWD)"= + --debug-prefix-map='$(PWD)'= DEFAULT_LDLIBS = diff --git a/build/findtmp b/build/findtmp deleted file mode 100755 index 441b765ab..000000000 --- a/build/findtmp +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -#-*-mode:sh;indent-tabs-mode:nil;tab-width:2;coding:utf-8-*-┐ -#───vi: set net ft=sh ts=2 sts=2 fenc=utf-8 :vi─────────────┘ -# -# OVERVIEW -# -# Temporary Directory Discovery -# -# DESCRIPTION -# -# We call this script once per build to ideally find a folder that's -# backed by an in-memory file system. We then export it to the TMPDIR -# environment variable. Many programs use it under the hood, e.g. gcc, -# so it grants many small performance improvements. - -mkdir -p o/tmp -echo $PWD/o/tmp diff --git a/build/getccversion b/build/getccversion deleted file mode 100755 index ed74ba39a..000000000 --- a/build/getccversion +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -#-*-mode:sh;indent-tabs-mode:nil;tab-width:2;coding:utf-8-*-┐ -#───vi: set net ft=sh ts=2 sts=2 fenc=utf-8 :vi─────────────┘ -# -# OVERVIEW -# -# Compiler Version Discovery -# -# DESCRIPTION -# -# Cosmopolitan itself may be built using either GCC and Clang, and our -# build irons out many of the differences between the two. This script -# is used by build/definitions.mk alongside build/getccname to support -# the different versions folks use. -# -# Our aim is to support GCC 4.2.1+ since that's the last GPLv2 version -# with any sort of industry consensus. Please note, Cosmopolitan never -# links GCC runtimes when using later versions, so some concerns might -# not apply. - -if [ ! -d o/third_party/gcc ]; then - third_party/gcc/unbundle.sh -fi - -set -e - -MAJOR_VERSION=$( - $1 --version | - head -n1 | - sed -n ' - s!^[^(]*([^)]*) \([[:digit:]][[:digit:]]*\).*!\1!p - s!^.*clang.*version \([[:digit:]][[:digit:]]*\).*!\1!p - ') - -if [ -z "$MAJOR_VERSION" ]; then - echo 6 -else - printf '%s\n' "$MAJOR_VERSION" -fi diff --git a/build/getcompile b/build/getcompile deleted file mode 100755 index 7fbee1812..000000000 --- a/build/getcompile +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -#-*-mode:sh;indent-tabs-mode:nil;tab-width:2;coding:utf-8-*-┐ -#───vi: set net ft=sh ts=2 sts=2 fenc=utf-8 :vi─────────────┘ - -if ! [ o/build/bootstrap/compile.com -nt build/bootstrap/compile.com ]; then - mkdir -p o/build/bootstrap/ - cp -f build/bootstrap/compile.com o/build/bootstrap/compile.$$.com - o/build/bootstrap/compile.$$.com -n - mv -f o/build/bootstrap/compile.$$.com o/build/bootstrap/compile.com -fi - -echo o/build/bootstrap/compile.com diff --git a/build/hello b/build/hello deleted file mode 100755 index b62ca7693..000000000 --- a/build/hello +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh -#-*-mode:sh;indent-tabs-mode:nil;tab-width:2;coding:utf-8-*-┐ -#───vi: set net ft=sh ts=2 sts=2 fenc=utf-8 :vi─────────────┘ -# -# SYNOPSIS -# -# HELLO BUILD -# -# OVERVIEW -# -# We generate a line at the start of each Makefile run, because if we -# use `make V=0` mode then the terminal logging trick we use in -# tool/build/compile.c will delete the previous line, and we'd rather -# have that line not be the bash prompt that ran make. -# -# This script is also useful for giving us an indicator each time the -# build restarts itself from scratch, which can happen in cases like -# when dependencies need to be regenerated by tool/build/mkdeps.c - -echo ♥cosmo >&2 diff --git a/build/rules.mk b/build/rules.mk index 34c2359c8..e999984c7 100644 --- a/build/rules.mk +++ b/build/rules.mk @@ -29,7 +29,6 @@ o/%.o: %.cc ; @$(COMPILE) -AOBJECTIFY.cxx $(OBJECTIFY.cxx o/%.o: o/%.cc ; @$(COMPILE) -AOBJECTIFY.cxx $(OBJECTIFY.cxx) $(OUTPUT_OPTION) $< o/%.lds: %.lds ; @$(COMPILE) -APREPROCESS $(PREPROCESS.lds) $(OUTPUT_OPTION) $< o/%.inc: %.h ; @$(COMPILE) -APREPROCESS $(PREPROCESS) $(OUTPUT_OPTION) -D__ASSEMBLER__ -P $< -o/%.pkg: ; @$(COMPILE) -APACKAGE -T$@ $(PKG) $(OUTPUT_OPTION) $(addprefix -d,$(filter %.pkg,$^)) $(filter %.o,$^) o/%.h.ok: %.h ; @$(COMPILE) -ACHECK.h $(COMPILE.c) -xc -g0 -o $@ $< o/%.okk: % ; @$(COMPILE) -ACHECK.h $(COMPILE.cxx) -xc++ -g0 -o $@ $< o/%.greg.o: %.greg.c ; @$(COMPILE) -AOBJECTIFY.greg $(OBJECTIFY.greg.c) $(OUTPUT_OPTION) $< @@ -75,7 +74,6 @@ o/$(MODE)/%.ncabi.o: %.ncabi.c ; @$(COMPILE) -AOBJECTIFY.nc $(OBJECTIFY.ncab o/$(MODE)/%.real.o: %.c ; @$(COMPILE) -AOBJECTIFY.real $(OBJECTIFY.real.c) $(OUTPUT_OPTION) $< o/$(MODE)/%.runs: o/$(MODE)/% ; @$(COMPILE) -ACHECK -tT$@ $< $(TESTARGS) -o/$(MODE)/%.pkg: ; @$(COMPILE) -APACKAGE -T$@ $(PKG) $(OUTPUT_OPTION) $(addprefix -d,$(filter %.pkg,$^)) $(filter %.o,$^) o/$(MODE)/%.zip.o: % ; @$(COMPILE) -AZIPOBJ $(ZIPOBJ) $(ZIPOBJ_FLAGS) $(OUTPUT_OPTION) $< o/$(MODE)/%-gcc.asm: %.c ; @$(COMPILE) -AOBJECTIFY.c $(OBJECTIFY.c) -S -g0 $(OUTPUT_OPTION) $< o/$(MODE)/%-gcc.asm: %.cc ; @$(COMPILE) -AOBJECTIFY.c $(OBJECTIFY.cxx) -S -g0 $(OUTPUT_OPTION) $< @@ -87,6 +85,14 @@ o/%.a: $(file >$@.args,$^) @$(COMPILE) -AARCHIVE -T$@ $(AR) $(ARFLAGS) $@ @$@.args +o/%.pkg: + $(file >$@.args,$(filter %.o,$^)) + @$(COMPILE) -APACKAGE -T$@ $(PKG) $(OUTPUT_OPTION) $(addprefix -d,$(filter %.pkg,$^)) @$@.args + +o/$(MODE)/%.pkg: + $(file >$@.args,$(filter %.o,$^)) + @$(COMPILE) -APACKAGE -T$@ $(PKG) $(OUTPUT_OPTION) $(addprefix -d,$(filter %.pkg,$^)) @$@.args + o/$(MODE)/%.o: %.py o/$(MODE)/third_party/python/pyobj.com @$(COMPILE) -APYOBJ o/$(MODE)/third_party/python/pyobj.com $(PYFLAGS) -o $@ $< diff --git a/examples/shell.c b/examples/cosh.c similarity index 98% rename from examples/shell.c rename to examples/cosh.c index 9c2ab8915..822fdb4d3 100644 --- a/examples/shell.c +++ b/examples/cosh.c @@ -32,11 +32,11 @@ #include "third_party/linenoise/linenoise.h" /** - * @fileoverview Shell that works on Windows. + * @fileoverview Cosmopolitan Shell * * This doesn't have script language features like UNBOURNE.COM but it - * works on Windows and, unlike CMD.EXE, actually has CTRL-P and CTRL-R - * which alone make it so much better. + * works on Windows and, unlike CMD.EXE, has CTRL-P, CTRL-R, and other + * GNU Emacs / Readline keyboard shortcuts. * * One day we'll have UNBOURNE.COM working on Windows but the code isn't * very maintainable sadly. @@ -184,8 +184,8 @@ int main(int argc, char *argv[]) { args = xrealloc(args, (++n + 1) * sizeof(*args)); args[n - 1] = arg; args[n - 0] = 0; - start = 0; } + start = 0; } if (n > 0) { if ((prog = commandv(args[0], path, sizeof(path)))) { diff --git a/examples/cp.c b/examples/cp.c deleted file mode 100644 index ddb4910c3..000000000 --- a/examples/cp.c +++ /dev/null @@ -1,96 +0,0 @@ -#if 0 -/*─────────────────────────────────────────────────────────────────╗ -│ To the extent possible under law, Justine Tunney has waived │ -│ all copyright and related or neighboring rights to this file, │ -│ as it is written in the following disclaimers: │ -│ • http://unlicense.org/ │ -│ • http://creativecommons.org/publicdomain/zero/1.0/ │ -╚─────────────────────────────────────────────────────────────────*/ -#endif -#include "libc/calls/calls.h" -#include "libc/calls/copyfile.h" -#include "libc/errno.h" -#include "libc/fmt/conv.h" -#include "libc/fmt/fmt.h" -#include "libc/runtime/gc.h" -#include "libc/runtime/runtime.h" -#include "libc/stdio/stdio.h" -#include "libc/str/str.h" -#include "libc/sysv/consts/ex.h" -#include "libc/sysv/consts/exit.h" -#include "libc/sysv/consts/ok.h" -#include "libc/x/x.h" -#include "third_party/getopt/getopt.h" - -#define USAGE \ - " SRC... DST\n\ -\n\ -SYNOPSIS\n\ -\n\ - Copies Files\n\ -\n\ -FLAGS\n\ -\n\ - -?\n\ - -h help\n\ - -f force\n\ - -n no clobber\n\ - -a preserve all\n\ - -p preserve owner and timestamps\n\ -\n" - -int flags; -bool force; - -wontreturn void PrintUsage(int rc, FILE *f) { - fprintf(f, "%s%s%s", "Usage: ", program_invocation_name, USAGE); - exit(rc); -} - -void GetOpts(int argc, char *argv[]) { - int opt; - while ((opt = getopt(argc, argv, "?hfnap")) != -1) { - switch (opt) { - case 'f': - force = true; - break; - case 'n': - flags |= COPYFILE_NOCLOBBER; - break; - case 'a': - case 'p': - flags |= COPYFILE_PRESERVE_OWNER; - flags |= COPYFILE_PRESERVE_TIMESTAMPS; - break; - case 'h': - case '?': - PrintUsage(EXIT_SUCCESS, stdout); - default: - PrintUsage(EX_USAGE, stderr); - } - } -} - -int cp(const char *src, const char *dst) { - if (endswith(dst, "/") || isdirectory(dst)) { - dst = _gc(xasprintf("%s/%s", dst, basename(src))); - } - if (!force && access(dst, W_OK) == -1 && errno != ENOENT) goto OnFail; - if (copyfile(src, dst, flags) == -1) goto OnFail; - return 0; -OnFail: - fprintf(stderr, "%s %s %s: %s\n", "error: cp", src, dst, strerror(errno)); - return -1; -} - -int main(int argc, char *argv[]) { - int i; - GetOpts(argc, argv); - if (argc - optind < 2) PrintUsage(EX_USAGE, stderr); - for (i = optind; i < argc - 1; ++i) { - if (cp(argv[i], argv[argc - 1]) == -1) { - return -1; - } - } - return 0; -} diff --git a/examples/echo.c b/examples/echo.c deleted file mode 100644 index b1f757779..000000000 --- a/examples/echo.c +++ /dev/null @@ -1,29 +0,0 @@ -#if 0 -/*─────────────────────────────────────────────────────────────────╗ -│ To the extent possible under law, Justine Tunney has waived │ -│ all copyright and related or neighboring rights to this file, │ -│ as it is written in the following disclaimers: │ -│ • http://unlicense.org/ │ -│ • http://creativecommons.org/publicdomain/zero/1.0/ │ -╚─────────────────────────────────────────────────────────────────*/ -#endif -#include "libc/stdio/stdio.h" -#include "libc/str/str.h" - -int main(int argc, char *argv[]) { - int i, j; - bool wantnewline; - if (argc > 1 && !strcmp(argv[1], "-n")) { - i = 2; - wantnewline = false; - } else { - i = 1; - wantnewline = true; - } - for (j = 0; i + j < argc; ++j) { - if (j) fputc(' ', stdout); - fputs(argv[i + j], stdout); - } - if (wantnewline) fputc('\n', stdout); - return 0; -} diff --git a/examples/examples.mk b/examples/examples.mk index 75002a90f..5501d524e 100644 --- a/examples/examples.mk +++ b/examples/examples.mk @@ -3,6 +3,12 @@ PKGS += EXAMPLES +ifeq ($(MODE),tiny) +EXAMPLES_BOOTLOADER = $(CRT) $(APE) +else +EXAMPLES_BOOTLOADER = $(CRT) $(APE_NO_MODIFY_SELF) +endif + EXAMPLES_FILES := $(wildcard examples/*) EXAMPLES_MAINS_S = $(filter %.S,$(EXAMPLES_FILES)) EXAMPLES_MAINS_C = $(filter %.c,$(EXAMPLES_FILES)) @@ -100,8 +106,7 @@ o/$(MODE)/examples/%.com.dbg: \ $(EXAMPLES_DEPS) \ o/$(MODE)/examples/%.o \ o/$(MODE)/examples/examples.pkg \ - $(CRT) \ - $(APE) + $(EXAMPLES_BOOTLOADER) @$(APELINK) o/$(MODE)/examples/nomodifyself.com.dbg: \ @@ -112,21 +117,12 @@ o/$(MODE)/examples/nomodifyself.com.dbg: \ $(APE_NO_MODIFY_SELF) @$(APELINK) -o/$(MODE)/examples/greenbean.com.dbg: \ - $(EXAMPLES_DEPS) \ - o/$(MODE)/examples/greenbean.o \ - o/$(MODE)/examples/examples.pkg \ - $(CRT) \ - $(APE_NO_MODIFY_SELF) - @$(APELINK) - o/$(MODE)/examples/hellolua.com.dbg: \ $(EXAMPLES_DEPS) \ o/$(MODE)/examples/hellolua.o \ o/$(MODE)/examples/hellolua.lua.zip.o \ o/$(MODE)/examples/examples.pkg \ - $(CRT) \ - $(APE) + $(EXAMPLES_BOOTLOADER) @$(APELINK) o/$(MODE)/examples/ispell.com.dbg: \ @@ -134,8 +130,7 @@ o/$(MODE)/examples/ispell.com.dbg: \ o/$(MODE)/examples/ispell.o \ o/$(MODE)/usr/share/dict/words.zip.o \ o/$(MODE)/examples/examples.pkg \ - $(CRT) \ - $(APE) + $(EXAMPLES_BOOTLOADER) @$(APELINK) o/$(MODE)/examples/nesemu1.com.dbg: \ @@ -145,8 +140,7 @@ o/$(MODE)/examples/nesemu1.com.dbg: \ o/$(MODE)/usr/share/rom/zelda.nes.zip.o \ o/$(MODE)/usr/share/rom/tetris.nes.zip.o \ o/$(MODE)/examples/examples.pkg \ - $(CRT) \ - $(APE) + $(EXAMPLES_BOOTLOADER) @$(APELINK) o/$(MODE)/examples/nesemu1.com: \ @@ -160,12 +154,15 @@ o/$(MODE)/examples/nesemu1.com: \ o/$(MODE)/examples/.nesemu1/.symtab o/$(MODE)/examples/nesemu1.o: QUOTA += -M512m +o/$(MODE)/usr/share/dict/words.zip.o: ZIPOBJ_FLAGS += -C2 $(EXAMPLES_OBJS): examples/examples.mk -usr/share/dict/words: usr/share/dict/words.gz - @mkdir -p $(@D) - @$(GZ) $(ZFLAGS) -d <$< >$@ +o/$(MODE)/usr/share/dict/words: \ + usr/share/dict/words.gz \ + o/$(MODE)/tool/build/gzip.com + @$(MKDIR) $(@D) + @o/$(MODE)/tool/build/gzip.com $(ZFLAGS) -cd <$< >$@ .PHONY: o/$(MODE)/examples o/$(MODE)/examples: \ diff --git a/examples/package/build.mk b/examples/package/build.mk index fc604b2a2..acf3bf46b 100644 --- a/examples/package/build.mk +++ b/examples/package/build.mk @@ -60,7 +60,7 @@ o/$(MODE)/examples/package/%.com.dbg: \ $(EXAMPLES_PACKAGE_DEPS) \ o/$(MODE)/examples/package/%.o \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) # Invalidates objects in package when makefile is edited. diff --git a/examples/pyapp/pyapp.mk b/examples/pyapp/pyapp.mk index 298236fc6..49e88b386 100644 --- a/examples/pyapp/pyapp.mk +++ b/examples/pyapp/pyapp.mk @@ -95,7 +95,7 @@ o/$(MODE)/examples/pyapp/pyapp.com.dbg: \ o/$(MODE)/examples/pyapp/pyapp.pkg \ o/$(MODE)/examples/pyapp/pyapp.o \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) $(LINK) $(LINKARGS) -o $@ # # Unwrap the APE .COM binary, that's embedded within the linked file diff --git a/examples/touch.c b/examples/touch.c deleted file mode 100644 index 58e179f44..000000000 --- a/examples/touch.c +++ /dev/null @@ -1,29 +0,0 @@ -#if 0 -/*─────────────────────────────────────────────────────────────────╗ -│ To the extent possible under law, Justine Tunney has waived │ -│ all copyright and related or neighboring rights to this file, │ -│ as it is written in the following disclaimers: │ -│ • http://unlicense.org/ │ -│ • http://creativecommons.org/publicdomain/zero/1.0/ │ -╚─────────────────────────────────────────────────────────────────*/ -#endif -#include "libc/calls/calls.h" -#include "libc/errno.h" -#include "libc/runtime/runtime.h" -#include "libc/stdio/stdio.h" -#include "libc/str/str.h" - -/** - * @fileoverview Command for updating timestamps on files. - */ - -int main(int argc, char *argv[]) { - int i; - for (i = 1; i < argc; ++i) { - if (touch(argv[i], 0666) == -1) { - fprintf(stderr, "ERROR: %s: %s\n", argv[i], strerror(errno)); - exit(1); - } - } - return 0; -} diff --git a/libc/calls/calls.mk b/libc/calls/calls.mk index 6e359fdbe..cceeec7e3 100644 --- a/libc/calls/calls.mk +++ b/libc/calls/calls.mk @@ -112,6 +112,7 @@ o/$(MODE)/libc/calls/execl.o \ o/$(MODE)/libc/calls/execle.o \ o/$(MODE)/libc/calls/execlp.o \ o/$(MODE)/libc/calls/execve-sysv.o \ +o/$(MODE)/libc/calls/execve-nt.greg.o \ o/$(MODE)/libc/calls/mkntenvblock.o: \ OVERRIDE_CPPFLAGS += \ -DSTACK_FRAME_UNLIMITED diff --git a/libc/calls/clock_gettime.c b/libc/calls/clock_gettime.c index 8b4a962ed..254273c63 100644 --- a/libc/calls/clock_gettime.c +++ b/libc/calls/clock_gettime.c @@ -76,7 +76,7 @@ noinstrument int clock_gettime(int clockid, struct timespec *ts) { /** * Returns pointer to fastest clock_gettime(). */ -clock_gettime_f *__get_clock_gettime(bool *opt_out_isfast) { +clock_gettime_f *__clock_gettime_get(bool *opt_out_isfast) { bool isfast; clock_gettime_f *res; if (IsLinux() && (res = __vdsosym("LINUX_2.6", "__vdso_clock_gettime"))) { @@ -99,6 +99,6 @@ clock_gettime_f *__get_clock_gettime(bool *opt_out_isfast) { hidden int __clock_gettime_init(int clockid, struct timespec *ts) { clock_gettime_f *gettime; - __clock_gettime = gettime = __get_clock_gettime(0); + __clock_gettime = gettime = __clock_gettime_get(0); return gettime(clockid, ts); } diff --git a/libc/calls/clock_gettime.h b/libc/calls/clock_gettime.h index 0fa6758a6..e6afedd45 100644 --- a/libc/calls/clock_gettime.h +++ b/libc/calls/clock_gettime.h @@ -8,7 +8,7 @@ typedef int clock_gettime_f(int, struct timespec *); extern clock_gettime_f *__clock_gettime; hidden clock_gettime_f __clock_gettime_init; -hidden clock_gettime_f *__get_clock_gettime(bool *); +hidden clock_gettime_f *__clock_gettime_get(bool *); COSMOPOLITAN_C_END_ #endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */ diff --git a/libc/calls/execve-nt.greg.c b/libc/calls/execve-nt.greg.c index 3418744c3..4bb7c8794 100644 --- a/libc/calls/execve-nt.greg.c +++ b/libc/calls/execve-nt.greg.c @@ -23,6 +23,7 @@ #include "libc/calls/ntspawn.h" #include "libc/calls/strace.internal.h" #include "libc/calls/syscall-nt.internal.h" +#include "libc/intrin/kprintf.h" #include "libc/mem/alloca.h" #include "libc/nt/accounting.h" #include "libc/nt/console.h" @@ -59,13 +60,28 @@ textwindows int sys_execve_nt(const char *program, char *const argv[], int rc; size_t i; uint32_t dwExitCode; + char progbuf[PATH_MAX]; struct MemoryIntervals *mm; struct NtStartupInfo startinfo; struct NtProcessInformation procinfo; + if (strlen(program) + 4 + 1 > PATH_MAX) { + return enametoolong(); + } + // this is a non-recoverable operation, so do some manual validation if (sys_faccessat_nt(AT_FDCWD, program, X_OK, 0) == -1) { - return eacces(); + stpcpy(stpcpy(progbuf, program), ".com"); + if (sys_faccessat_nt(AT_FDCWD, progbuf, X_OK, 0) != -1) { + program = progbuf; + } else { + stpcpy(stpcpy(progbuf, program), ".exe"); + if (sys_faccessat_nt(AT_FDCWD, progbuf, X_OK, 0) != -1) { + program = progbuf; + } else { + return eacces(); + } + } } ////////////////////////////////////////////////////////////////////////////// diff --git a/libc/calls/execve-sysv.c b/libc/calls/execve-sysv.c index 7c39f32c0..bcf848537 100644 --- a/libc/calls/execve-sysv.c +++ b/libc/calls/execve-sysv.c @@ -16,28 +16,80 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ +#include "libc/bits/bits.h" #include "libc/bits/safemacros.internal.h" #include "libc/calls/calls.h" #include "libc/calls/syscall-sysv.internal.h" #include "libc/errno.h" #include "libc/mem/alloca.h" #include "libc/paths.h" +#include "libc/runtime/runtime.h" #include "libc/str/str.h" +#include "libc/sysv/consts/at.h" +#include "libc/sysv/consts/o.h" +#include "libc/sysv/consts/ok.h" +#include "libc/sysv/errfuns.h" + +static bool CanExecute(const char *path) { + return !sys_faccessat(AT_FDCWD, path, X_OK, 0); +} + +static bool IsApeBinary(const char *path) { + int fd; + char buf[8]; + bool res = false; + if ((fd = sys_open(path, O_RDONLY, 0)) != -1) { + if (sys_read(fd, buf, 8) == 8 && READ64LE(buf) == READ64LE("MZqFpD='")) { + res = true; + } + sys_close(fd); + } + return res; +} + +static const char *Join(const char *a, const char *b, char buf[PATH_MAX]) { + size_t n, m; + n = strlen(a); + m = strlen(b); + if (n + 1 + m + 1 < PATH_MAX) { + stpcpy(stpcpy(stpcpy(buf, a), "/"), b); + return buf; + } else { + return ""; + } +} int sys_execve(const char *prog, char *const argv[], char *const envp[]) { + int e; size_t i; + char *buf; char **shargs; + const char *ape; + e = errno; __sys_execve(prog, argv, envp); if (errno != ENOEXEC) return -1; for (i = 0; argv[i];) ++i; - shargs = alloca((i + 2) * sizeof(char *)); - memcpy(shargs + 2, argv + 1, i * sizeof(char *)); - if (IsFreebsd() || IsNetbsd()) { - shargs[0] = firstnonnull(commandv("bash", alloca(PATH_MAX), PATH_MAX), - _PATH_BSHELL); + buf = alloca(PATH_MAX); + shargs = alloca((i + 4) * sizeof(char *)); + if (IsApeBinary(prog) && + (CanExecute((ape = "/usr/bin/ape")) || + CanExecute( + (ape = Join(firstnonnull(getenv("TMPDIR"), "/tmp"), "ape", buf))))) { + shargs[0] = ape; + shargs[1] = "-"; + shargs[2] = prog; + memcpy(shargs + 3, argv, (i + 1) * sizeof(char *)); + } else if (CanExecute(prog)) { + if (IsFreebsd() || IsNetbsd()) { + shargs[0] = firstnonnull(commandv("bash", buf, PATH_MAX), _PATH_BSHELL); + } else { + shargs[0] = _PATH_BSHELL; + } + shargs[1] = prog; + memcpy(shargs + 2, argv + 1, i * sizeof(char *)); } else { - shargs[0] = _PATH_BSHELL; + return enoexec(); } - shargs[1] = prog; + errno = e; return __sys_execve(shargs[0], shargs, envp); } diff --git a/libc/calls/getcwd-nt.c b/libc/calls/getcwd-nt.c index ed6c962d6..3982ef5cb 100644 --- a/libc/calls/getcwd-nt.c +++ b/libc/calls/getcwd-nt.c @@ -32,14 +32,21 @@ textwindows char *sys_getcwd_nt(char *buf, size_t size) { if ((n = GetCurrentDirectory(ARRAYLEN(p), p))) { if (4 + n + 1 <= size && 4 + n + 1 <= ARRAYLEN(p)) { tprecode16to8(buf, size, p); + i = 0; j = 0; if (n >= 3 && isalpha(p[0]) && p[1] == ':' && p[2] == '\\') { + // turn c:\... into \c\... + p[1] = p[0]; + p[0] = '\\'; + } else if (n >= 7 && p[0] == '\\' && p[1] == '\\' && p[2] == '?' && + p[3] == '\\' && isalpha(p[4]) && p[5] == ':' && p[6] == '\\') { + // turn \\?\c:\... into \c\... buf[j++] = '/'; + buf[j++] = p[4]; buf[j++] = '/'; - buf[j++] = '?'; - buf[j++] = '/'; + i += 7; } - for (i = 0; i < n;) { + while (i < n) { x = p[i++] & 0xffff; if (!IsUcs2(x)) { if (i < n) { diff --git a/libc/calls/getntsyspath.S b/libc/calls/getntsyspath.S index f4969bcf4..d3e4466fb 100644 --- a/libc/calls/getntsyspath.S +++ b/libc/calls/getntsyspath.S @@ -16,6 +16,7 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ +#include "libc/dce.h" #include "libc/macros.internal.h" // Obtains WIN32 magic path, e.g. GetTempPathA. @@ -33,7 +34,13 @@ __getntsyspath: movpp %rdi,%rcx # call f=%rax(p1=%rcx,p2=%rdx) sub $40,%rsp call *%rax - xor %edx,%edx + testb IsWindows() + jz 3f + mov (%rdi),%cl # turn c:\... into \c\... + movb $'\\',(%rdi) + mov %cl,1(%rdi) + movb $'\\',2(%rdi) +3: xor %edx,%edx mov -8(%rbp),%ecx # restore %edx param as %ecx cmp %eax,%ecx # use current dir on overflow cmovbe %edx,%eax diff --git a/libc/calls/getprogramexecutablename.greg.c b/libc/calls/getprogramexecutablename.greg.c index 3c34e73c1..7a516ebb8 100644 --- a/libc/calls/getprogramexecutablename.greg.c +++ b/libc/calls/getprogramexecutablename.greg.c @@ -34,6 +34,10 @@ char program_executable_name[PATH_MAX]; +static inline int IsAlpha(int c) { + return ('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z'); +} + static inline char *StrCat(char buf[PATH_MAX], const char *a, const char *b) { char *p, *e; p = buf; @@ -56,16 +60,16 @@ static inline void GetProgramExecutableNameImpl(char *p, char *e) { if (IsWindows()) { n = GetModuleFileName(0, u.path16, ARRAYLEN(u.path16)); for (i = 0; i < n; ++i) { + // turn c:\foo\bar into c:/foo/bar if (u.path16[i] == '\\') { u.path16[i] = '/'; } } - if (isalpha(u.path16[0]) && u.path16[1] == ':' && u.path16[2] == '/') { - p[0] = '/'; - p[1] = '/'; - p[2] = '?'; - p[3] = '/'; - p += 4; + if (IsAlpha(u.path16[0]) && u.path16[1] == ':' && u.path16[2] == '/') { + // turn c:/... into /c/... + u.path16[1] = u.path16[0]; + u.path16[0] = '/'; + u.path16[2] = '/'; } tprecode16to8(p, e - p, u.path16); return; diff --git a/libc/calls/mkntenvblock.c b/libc/calls/mkntenvblock.c index f8315ad52..e076efbe5 100644 --- a/libc/calls/mkntenvblock.c +++ b/libc/calls/mkntenvblock.c @@ -17,8 +17,10 @@ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/alg/arraylist2.internal.h" +#include "libc/bits/bits.h" #include "libc/calls/ntspawn.h" #include "libc/fmt/conv.h" +#include "libc/intrin/kprintf.h" #include "libc/macros.internal.h" #include "libc/mem/alloca.h" #include "libc/mem/mem.h" @@ -31,15 +33,85 @@ #define ToUpper(c) ((c) >= 'a' && (c) <= 'z' ? (c) - 'a' + 'A' : (c)) -static int CompareStrings(const char *l, const char *r) { +static inline int IsAlpha(int c) { + return ('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z'); +} + +static inline char *StrChr(char *s, int c) { + for (;; ++s) { + if ((*s & 255) == (c & 255)) return s; + if (!*s) return 0; + } +} + +static textwindows inline int CompareStrings(const char *l, const char *r) { int a, b; size_t i = 0; while ((a = ToUpper(l[i] & 255)) == (b = ToUpper(r[i] & 255)) && r[i]) ++i; return a - b; } -static void InsertString(char **a, size_t i, char *s) { - size_t j; +static textwindows void FixPath(char *path) { + char *p; + size_t i; + + // skip over variable name + while (*path++) { + if (path[-1] == '=') { + break; + } + } + + // turn colon into semicolon + // unless it already looks like a dos path + for (p = path; *p; ++p) { + if (p[0] == ':' && p[1] != '\\') { + p[0] = ';'; + } + } + + // turn \c\... into c:\... + p = path; + if (p[0] == '/' && IsAlpha(p[1]) && p[2] == '/') { + p[0] = p[1]; + p[1] = ':'; + } + for (; *p; ++p) { + if (p[0] == ';' && p[1] == '/' && IsAlpha(p[2]) && p[3] == '/') { + p[1] = p[2]; + p[2] = ':'; + } + } + + // turn slash into backslash + for (p = path; *p; ++p) { + if (*p == '/') { + *p = '\\'; + } + } +} + +static textwindows void InsertString(char **a, size_t i, char *s, + char buf[ARG_MAX], size_t *bufi) { + char *v; + size_t j, k; + + // apply fixups to var=/c/... + if ((v = StrChr(s, '=')) && v[1] == '/' && IsAlpha(v[2]) && v[3] == '/') { + v = buf + *bufi; + for (k = 0; s[k]; ++k) { + if (*bufi + 1 < ARG_MAX) { + buf[(*bufi)++] = s[k]; + } + } + if (*bufi < ARG_MAX) { + buf[(*bufi)++] = 0; + FixPath(v); + s = v; + } + } + + // append to sorted list for (j = i; j > 0 && CompareStrings(s, a[j - 1]) < 0; --j) { a[j] = a[j - 1]; } @@ -58,18 +130,18 @@ static void InsertString(char **a, size_t i, char *s) { * @error E2BIG if total number of shorts exceeded ARG_MAX/2 (32767) */ textwindows int mkntenvblock(char16_t envvars[ARG_MAX / 2], char *const envp[], - const char *extravar) { + const char *extravar, char buf[ARG_MAX]) { bool v; char *t; axdx_t rc; uint64_t w; char **vars; wint_t x, y; - size_t i, j, k, n, m; + size_t i, j, k, n, m, bufi = 0; for (n = 0; envp[n];) n++; vars = alloca((n + 1) * sizeof(char *)); - for (i = 0; i < n; ++i) InsertString(vars, i, envp[i]); - if (extravar) InsertString(vars, n++, extravar); + for (i = 0; i < n; ++i) InsertString(vars, i, envp[i], buf, &bufi); + if (extravar) InsertString(vars, n++, extravar, buf, &bufi); for (k = i = 0; i < n; ++i) { j = 0; v = false; diff --git a/libc/calls/mkntpath.c b/libc/calls/mkntpath.c index e69732c60..9342bffd6 100644 --- a/libc/calls/mkntpath.c +++ b/libc/calls/mkntpath.c @@ -31,6 +31,10 @@ static inline bool IsSlash(char c) { return c == '/' || c == '\\'; } +static inline int IsAlpha(int c) { + return ('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z'); +} + textwindows static const char *FixNtMagicPath(const char *path, unsigned flags) { const struct NtMagicPaths *mp = &kNtMagicPaths; @@ -78,18 +82,51 @@ textwindows int __mkntpath2(const char *path, */ char16_t *p; const char *q; - size_t i, n, m, z; + bool isdospath; + size_t i, n, m, x, z; if (!path) return efault(); path = FixNtMagicPath(path, flags); p = path16; q = path; - if (IsSlash(path[0]) && IsSlash(path[1]) && path[2] == '?' && - IsSlash(path[3])) { + + if (IsSlash(q[0]) && IsAlpha(q[1]) && IsSlash(q[2])) { z = MIN(32767, PATH_MAX); + // turn "\c\foo" into "\\?\c:\foo" + p[0] = '\\'; + p[1] = '\\'; + p[2] = '?'; + p[3] = '\\'; + p[4] = q[1]; + p[5] = ':'; + p[6] = '\\'; + p += 7; + q += 3; + z -= 7; + x = 7; + } else if (IsSlash(q[0]) && IsAlpha(q[1]) && IsSlash(q[2])) { + z = MIN(32767, PATH_MAX); + // turn "c:\foo" into "\\?\c:\foo" + p[0] = '\\'; + p[1] = '\\'; + p[2] = '?'; + p[3] = '\\'; + p[4] = q[0]; + p[5] = ':'; + p[6] = '\\'; + p += 7; + q += 3; + z -= 7; + x = 7; + } else if (IsSlash(q[0]) && IsSlash(q[1]) && q[2] == '?' && IsSlash(q[3])) { + z = MIN(32767, PATH_MAX); + x = 0; } else { z = MIN(260, PATH_MAX); + x = 0; } - if (IsSlash(q[0]) && q[1] == 't' && q[2] == 'm' && q[3] == 'p' && + + // turn /tmp into GetTempPath() + if (!x && IsSlash(q[0]) && q[1] == 't' && q[2] == 'm' && q[3] == 'p' && (IsSlash(q[4]) || !q[4])) { m = GetTempPath(z, p); if (!q[4]) return m; @@ -99,15 +136,20 @@ textwindows int __mkntpath2(const char *path, } else { m = 0; } + + // turn utf-8 into utf-16 n = tprecode8to16(p, z, q).ax; if (n >= z - 1) { STRACE("path too long for windows: %#s", path); return enametoolong(); } + + // turn slash into backslash for (i = 0; i < n; ++i) { if (p[i] == '/') { p[i] = '\\'; } } - return m + n; + + return x + m + n; } diff --git a/libc/calls/now.c b/libc/calls/now.c index 83012eba4..62ec67940 100644 --- a/libc/calls/now.c +++ b/libc/calls/now.c @@ -102,7 +102,7 @@ static long double nowl_vdso(void) { long double nowl_setup(void) { bool isfast; uint64_t ticks; - __gettime = __get_clock_gettime(&isfast); + __gettime = __clock_gettime_get(&isfast); if (isfast) { nowl = nowl_vdso; } else if (X86_HAVE(INVTSC)) { diff --git a/libc/calls/ntaccesscheck.c b/libc/calls/ntaccesscheck.c index b0769a6a6..367811257 100644 --- a/libc/calls/ntaccesscheck.c +++ b/libc/calls/ntaccesscheck.c @@ -94,15 +94,15 @@ TryAgain: } } else { rc = __winerr(); - STRACE("%s failed: %m", "AccessCheck"); + STRACE("%s(%#hs) failed: %m", "AccessCheck", pathname); } } else { rc = __winerr(); - STRACE("%s failed: %m", "DuplicateToken"); + STRACE("%s(%#hs) failed: %m", "DuplicateToken", pathname); } } else { rc = __winerr(); - STRACE("%s failed: %m", "OpenProcessToken"); + STRACE("%s(%#hs) failed: %m", "OpenProcessToken", pathname); } } else { e = GetLastError(); @@ -112,9 +112,11 @@ TryAgain: goto TryAgain; } else { rc = enomem(); + STRACE("%s(%#hs) failed: %m", "GetFileSecurity", pathname); } } else { errno = e; + STRACE("%s(%#hs) failed: %m", "GetFileSecurity", pathname); rc = -1; } } diff --git a/libc/calls/ntspawn.c b/libc/calls/ntspawn.c index 19a7c560e..9f99129b6 100644 --- a/libc/calls/ntspawn.c +++ b/libc/calls/ntspawn.c @@ -36,8 +36,9 @@ struct SpawnBlock { struct { char16_t cmdline[ARG_MAX / 2]; char16_t envvars[ARG_MAX / 2]; + char buf[ARG_MAX]; }; - char __pad[ROUNDUP(ARG_MAX / 2 * 2 * sizeof(char16_t), FRAMESIZE)]; + char __pad[ROUNDUP(ARG_MAX / 2 * 3 * sizeof(char16_t), FRAMESIZE)]; }; }; @@ -83,7 +84,7 @@ textwindows int ntspawn( (block = MapViewOfFileEx(handle, kNtFileMapRead | kNtFileMapWrite, 0, 0, sizeof(*block), 0)) && mkntcmdline(block->cmdline, prog, argv) != -1 && - mkntenvblock(block->envvars, envp, extravar) != -1 && + mkntenvblock(block->envvars, envp, extravar, block->buf) != -1 && CreateProcess(prog16, block->cmdline, opt_lpProcessAttributes, opt_lpThreadAttributes, bInheritHandles, dwCreationFlags | kNtCreateUnicodeEnvironment, diff --git a/libc/calls/ntspawn.h b/libc/calls/ntspawn.h index df1955b43..167b431f1 100644 --- a/libc/calls/ntspawn.h +++ b/libc/calls/ntspawn.h @@ -7,7 +7,8 @@ COSMOPOLITAN_C_START_ int mkntcmdline(char16_t[ARG_MAX / 2], const char *, char *const[]) hidden; -int mkntenvblock(char16_t[ARG_MAX / 2], char *const[], const char *) hidden; +int mkntenvblock(char16_t[ARG_MAX / 2], char *const[], const char *, + char[ARG_MAX]) hidden; int ntspawn(const char *, char *const[], char *const[], const char *, struct NtSecurityAttributes *, struct NtSecurityAttributes *, bool32, uint32_t, const char16_t *, const struct NtStartupInfo *, diff --git a/libc/calls/readlinkat-nt.c b/libc/calls/readlinkat-nt.c index e8f730dc2..3e75adefc 100644 --- a/libc/calls/readlinkat-nt.c +++ b/libc/calls/readlinkat-nt.c @@ -58,10 +58,9 @@ textwindows ssize_t sys_readlinkat_nt(int dirfd, const char *path, char *buf, p = (char16_t *)((char *)rdb->SymbolicLinkReparseBuffer.PathBuffer + rdb->SymbolicLinkReparseBuffer.PrintNameOffset); if (n >= 3 && isalpha(p[0]) && p[1] == ':' && p[2] == '\\') { - buf[j++] = '/'; - buf[j++] = '/'; - buf[j++] = '?'; - buf[j++] = '/'; + p[1] = p[0]; + p[0] = '/'; + p[2] = '/'; } while (i < n) { x = p[i++] & 0xffff; diff --git a/libc/calls/strace.internal.h b/libc/calls/strace.internal.h index b8d3cc662..70d158183 100644 --- a/libc/calls/strace.internal.h +++ b/libc/calls/strace.internal.h @@ -9,7 +9,7 @@ #define _KERNTRACE 0 /* not configurable w/ flag yet */ #define _POLLTRACE 0 /* not configurable w/ flag yet */ #define _DATATRACE 1 /* not configurable w/ flag yet */ -#define _NTTRACE 1 /* not configurable w/ flag yet */ +#define _NTTRACE 0 /* not configurable w/ flag yet */ #define STRACE_PROLOGUE "%rSYS %5P %'18T " diff --git a/libc/calls/syscall-sysv.internal.h b/libc/calls/syscall-sysv.internal.h index 479b6c6ed..b73fc3b50 100644 --- a/libc/calls/syscall-sysv.internal.h +++ b/libc/calls/syscall-sysv.internal.h @@ -64,6 +64,7 @@ i32 sys_mknod(const char *, u32, u64) hidden; i32 sys_mprotect(void *, u64, i32) hidden; i32 sys_msync(void *, u64, i32) hidden; i32 sys_munmap(void *, u64) hidden; +i32 sys_open(const char *, i32, u32) hidden; i32 sys_openat(i32, const char *, i32, u32) hidden; i32 sys_pause(void) hidden; i32 sys_pipe(i32[hasatleast 2]) hidden; diff --git a/libc/fmt/stoa.c b/libc/fmt/stoa.c index f7efa15ac..94973bb9a 100644 --- a/libc/fmt/stoa.c +++ b/libc/fmt/stoa.c @@ -62,19 +62,6 @@ static int __fmt_stoa_quoted(out_f out, void *a, uint64_t w) { return out(buf, a, w ? (bsr(w) >> 3) + 1 : 1); } -static int __fmt_stoa_quote(out_f out, void *arg, unsigned flags, char ch, - unsigned char signbit) { - if (flags & FLAGS_REPR) { - if (signbit == 63) { - if (out("L", arg, 1) == -1) return -1; - } else if (signbit == 15) { - if (out("u", arg, 1) == -1) return -1; - } - if (out(&ch, arg, 1) == -1) return -1; - } - return 0; -} - /** * Converts string to array. * @@ -103,8 +90,6 @@ int __fmt_stoa(int out(const char *, void *, size_t), void *arg, void *data, if (flags & FLAGS_PRECISION) { precision = min(strlen(p), precision); } - } else { - if (__fmt_stoa_quote(out, arg, flags, qchar, signbit) == -1) return -1; } ignorenul = false; @@ -153,6 +138,9 @@ int __fmt_stoa(int out(const char *, void *, size_t), void *arg, void *data, } else if (weaken(strnwidth)) { w = weaken(strnwidth)(p, precision, 0); } + if (!(flags & FLAGS_NOQUOTE) && (flags & FLAGS_REPR)) { + w += 2 + (signbit == 63) + (signbit == 15); + } if (w < width) { pad = width - w; } @@ -162,6 +150,16 @@ int __fmt_stoa(int out(const char *, void *, size_t), void *arg, void *data, if (__fmt_pad(out, arg, pad) == -1) return -1; } + if (!(flags & FLAGS_NOQUOTE) && (flags & FLAGS_REPR)) { + if (signbit == 63) { + if (out("L", arg, 1) == -1) return -1; + } else if (signbit == 15) { + if (out("u", arg, 1) == -1) return -1; + } + buf[0] = qchar; + if (out(buf, arg, 1) == -1) return -1; + } + if (justdobytes) { while (precision--) { wc = *p++ & 0xff; @@ -207,14 +205,14 @@ int __fmt_stoa(int out(const char *, void *, size_t), void *arg, void *data, } } - if (pad && (flags & FLAGS_LEFT)) { - if (__fmt_pad(out, arg, pad) == -1) return -1; - } - if (!(flags & FLAGS_NOQUOTE) && (flags & FLAGS_REPR)) { buf[0] = qchar; if (out(buf, arg, 1) == -1) return -1; } + if (pad && (flags & FLAGS_LEFT)) { + if (__fmt_pad(out, arg, pad) == -1) return -1; + } + return 0; } diff --git a/libc/nexgen32e/gc.S b/libc/nexgen32e/gc.S index 08c03c60b..d93859808 100644 --- a/libc/nexgen32e/gc.S +++ b/libc/nexgen32e/gc.S @@ -22,6 +22,8 @@ #define INITIAL_CAPACITY 4 + nop + // Invokes deferred function calls. // // This offers behavior similar to std::unique_ptr. Functions @@ -32,8 +34,6 @@ // // @param rax,rdx,xmm0,xmm1,st0,st1 is return value // @see test/libc/runtime/gc_test.c - nop # backtrace workaround -// __gc: decq __garbage(%rip) mov __garbage(%rip),%r8 mov __garbage+16(%rip),%r9 @@ -43,17 +43,16 @@ __gc: decq __garbage(%rip) mov 8(%r8),%r9 mov 16(%r8),%rdi push 24(%r8) -// push %rbp mov %rsp,%rbp - sub $16,%rsp - push %rax - push %rdx - movdqa %xmm0,-16(%rbp) + sub $32,%rsp + mov %rax,-8(%rbp) + mov %rdx,-16(%rbp) + movdqa %xmm0,-32(%rbp) call *%r9 - movdqa -16(%rbp),%xmm0 - pop %rdx - pop %rax + movdqa -32(%rbp),%xmm0 + mov -16(%rbp),%rdx + mov -8(%rbp),%rax leave ret 9: hlt diff --git a/libc/runtime/finddebugbinary.c b/libc/runtime/finddebugbinary.c index aee215169..e902aaa54 100644 --- a/libc/runtime/finddebugbinary.c +++ b/libc/runtime/finddebugbinary.c @@ -35,23 +35,24 @@ const char *FindDebugBinary(void) { char *p; size_t n; if (!once) { - if (!(res = getenv("COMDBG"))) { - p = GetProgramExecutableName(); - n = strlen(p); - if (n > 4 && READ32LE(p + n - 4) == READ32LE(".dbg")) { - res = p; - } else if (n > 4 && READ32LE(p + n - 4) == READ32LE(".com") && - n + 4 < ARRAYLEN(buf)) { - mempcpy(mempcpy(buf, p, n), ".dbg", 5); - if (fileexists(buf)) { - res = buf; - } - } else if (n + 8 < ARRAYLEN(buf)) { - mempcpy(mempcpy(buf, p, n), ".com.dbg", 9); - if (fileexists(buf)) { - res = buf; - } + p = GetProgramExecutableName(); + n = strlen(p); + if (n > 4 && READ32LE(p + n - 4) == READ32LE(".dbg")) { + res = p; + } else if (n > 4 && READ32LE(p + n - 4) == READ32LE(".com") && + n + 4 < ARRAYLEN(buf)) { + mempcpy(mempcpy(buf, p, n), ".dbg", 5); + if (fileexists(buf)) { + res = buf; } + } else if (n + 8 < ARRAYLEN(buf)) { + mempcpy(mempcpy(buf, p, n), ".com.dbg", 9); + if (fileexists(buf)) { + res = buf; + } + } + if (!res) { + res = getenv("COMDBG"); } once = true; } diff --git a/libc/runtime/getdosenviron.c b/libc/runtime/getdosenviron.c index 58f3e3bf1..c9dd991b2 100644 --- a/libc/runtime/getdosenviron.c +++ b/libc/runtime/getdosenviron.c @@ -16,6 +16,7 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ +#include "libc/bits/bits.h" #include "libc/runtime/runtime.h" #include "libc/str/str.h" #include "libc/str/tpenc.h" @@ -23,6 +24,19 @@ #define ToUpper(c) ((c) >= 'a' && (c) <= 'z' ? (c) - 'a' + 'A' : (c)) +forceinline int IsAlpha(int c) { + return ('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z'); +} + +forceinline char *MemChr(const char *s, unsigned char c, unsigned long n) { + for (; n; --n, ++s) { + if ((*s & 255) == c) { + return s; + } + } + return 0; +} + static textwindows noasan noinstrument axdx_t Recode16to8(char *dst, size_t dstsize, const char16_t *src) { @@ -45,13 +59,51 @@ static textwindows noasan noinstrument axdx_t Recode16to8(char *dst, } w = tpenc(x); do { - if (r.ax + 1 >= dstsize) break; - dst[r.ax++] = w; + if (r.ax + 1 < dstsize) { + dst[r.ax++] = w; + } else { + break; + } } while ((w >>= 8)); } + if (r.ax < dstsize) { + dst[r.ax] = 0; + } return r; } +textwindows noinstrument noasan void FixPath(char *path) { + char *p; + size_t i; + + // turn backslash into slash + for (p = path; *p; ++p) { + if (*p == '\\') { + *p = '/'; + } + } + + // turn c:/... into /c/... + p = path; + if (IsAlpha(p[0]) && p[1] == ':' && p[2] == '/') { + p[1] = p[0]; + p[0] = '/'; + } + for (; *p; ++p) { + if (p[0] == ';' && IsAlpha(p[1]) && p[2] == ':' && p[3] == '/') { + p[2] = p[1]; + p[1] = '/'; + } + } + + // turn semicolon into colon + for (p = path; *p; ++p) { + if (*p == ';') { + *p = ':'; + } + } +} + /** * Transcodes NT environment variable block from UTF-16 to UTF-8. * @@ -66,12 +118,17 @@ textwindows noasan noinstrument int GetDosEnviron(const char16_t *env, char *buf, size_t size, char **envp, size_t max) { int i; + char *p; axdx_t r; i = 0; --size; while (*env) { if (i + 1 < max) envp[i++] = buf; r = Recode16to8(buf, size, env); + if ((p = memchr(buf, '=', r.ax)) && IsAlpha(p[1]) && p[2] == ':' && + (p[3] == '\\' || p[3] == '/')) { + FixPath(p + 1); + } size -= r.ax + 1; buf += r.ax + 1; env += r.dx; diff --git a/libc/x/x.h b/libc/x/x.h index a904caa93..c514b0e42 100644 --- a/libc/x/x.h +++ b/libc/x/x.h @@ -73,6 +73,7 @@ char *xdirname(const char *) paramsnonnull() _XMAL; char *xjoinpaths(const char *, const char *) paramsnonnull() _XMAL; char *xreadlink(const char *) paramsnonnull() _XMAL; char *xreadlinkat(int, const char *) paramsnonnull() _XMAL; +void xfixpath(void); /*───────────────────────────────────────────────────────────────────────────│─╗ │ cosmopolitan § eXtended apis » time ─╬─│┼ diff --git a/libc/x/xfixpath.c b/libc/x/xfixpath.c new file mode 100644 index 000000000..237eeb80f --- /dev/null +++ b/libc/x/xfixpath.c @@ -0,0 +1,63 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Copyright 2022 Justine Alexandra Roberts Tunney │ +│ │ +│ Permission to use, copy, modify, and/or distribute this software for │ +│ any purpose with or without fee is hereby granted, provided that the │ +│ above copyright notice and this permission notice appear in all copies. │ +│ │ +│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │ +│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │ +│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │ +│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │ +│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │ +│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │ +│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ +│ PERFORMANCE OF THIS SOFTWARE. │ +╚─────────────────────────────────────────────────────────────────────────────*/ +#include "libc/mem/mem.h" +#include "libc/runtime/runtime.h" +#include "libc/str/str.h" +#include "libc/x/x.h" + +static inline int IsAlpha(int c) { + return ('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z'); +} + +/** + * Fixes $PATH environment variable on Windows. + */ +void xfixpath(void) { + size_t i; + char *p, *path; + path = strdup(getenv("PATH")); + if (strstr(path, "C:\\") && strstr(path, ";")) { + + // turn backslash into slash + for (p = path; *p; ++p) { + if (*p == '\\') *p = '/'; + } + + // turn c:/... into /c/... + if (IsAlpha(path[0]) && path[1] == ':' && path[2] == '/') { + path[1] = path[0]; + path[0] = '/'; + } + for (p = path, i = 0; p[i]; ++i) { + if (p[i + 0] == ';' && IsAlpha(p[i + 1]) && p[i + 2] == ':' && + p[i + 3] == '/') { + p[i + 2] = p[i + 1]; + p[i + 1] = '/'; + } + } + + // turn semicolon into colon + for (p = path; *p; ++p) { + if (*p == ';') *p = ':'; + } + + setenv("PATH", path, true); + } + free(path); +} diff --git a/test/dsp/core/test.mk b/test/dsp/core/test.mk index afa8171c6..60dbc21e8 100644 --- a/test/dsp/core/test.mk +++ b/test/dsp/core/test.mk @@ -43,7 +43,7 @@ o/$(MODE)/test/dsp/core/%.com.dbg: \ o/$(MODE)/test/dsp/core/%.o \ $(LIBC_TESTMAIN) \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) .PHONY: o/$(MODE)/test/dsp/core diff --git a/test/dsp/scale/test.mk b/test/dsp/scale/test.mk index 4b988b52a..87698b94b 100644 --- a/test/dsp/scale/test.mk +++ b/test/dsp/scale/test.mk @@ -50,7 +50,7 @@ o/$(MODE)/test/dsp/scale/%.com.dbg: \ o/$(MODE)/test/dsp/scale/scale.pkg \ $(LIBC_TESTMAIN) \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) .PHONY: o/$(MODE)/test/dsp/scale diff --git a/test/dsp/tty/test.mk b/test/dsp/tty/test.mk index c5b61ec0c..c8dd85733 100644 --- a/test/dsp/tty/test.mk +++ b/test/dsp/tty/test.mk @@ -45,7 +45,7 @@ o/$(MODE)/test/dsp/tty/%.com.dbg: \ o/$(MODE)/test/dsp/tty/tty.pkg \ $(LIBC_TESTMAIN) \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) .PHONY: o/$(MODE)/test/dsp/tty diff --git a/test/libc/alg/test.mk b/test/libc/alg/test.mk index 5ff888eff..8b3b5bfc2 100644 --- a/test/libc/alg/test.mk +++ b/test/libc/alg/test.mk @@ -50,7 +50,7 @@ o/$(MODE)/test/libc/alg/%.com.dbg: \ o/$(MODE)/test/libc/alg/alg.pkg \ $(LIBC_TESTMAIN) \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) $(TEST_LIBC_ALG_OBJS): test/libc/alg/test.mk diff --git a/test/libc/bits/test.mk b/test/libc/bits/test.mk index a588a980f..d4f59943e 100644 --- a/test/libc/bits/test.mk +++ b/test/libc/bits/test.mk @@ -46,7 +46,7 @@ o/$(MODE)/test/libc/bits/%.com.dbg: \ o/$(MODE)/test/libc/bits/bits.pkg \ $(LIBC_TESTMAIN) \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) $(TEST_LIBC_BITS_OBJS): \ diff --git a/test/libc/calls/clock_gettime_test.c b/test/libc/calls/clock_gettime_test.c index ce54e88de..94d00d4bb 100644 --- a/test/libc/calls/clock_gettime_test.c +++ b/test/libc/calls/clock_gettime_test.c @@ -35,7 +35,7 @@ TEST(clock_gettime, test) { ASSERT_NE(0, ts.tv_sec); ASSERT_NE(0, ts.tv_nsec); if (__is_linux_2_6_23()) { - ASSERT_GT((intptr_t)__get_clock_gettime(&isfast), + ASSERT_GT((intptr_t)__clock_gettime_get(&isfast), getauxval(AT_SYSINFO_EHDR)); ASSERT_TRUE(isfast); } diff --git a/test/libc/calls/getcwd_test.c b/test/libc/calls/getcwd_test.c index af7eb7851..77f65f5a7 100644 --- a/test/libc/calls/getcwd_test.c +++ b/test/libc/calls/getcwd_test.c @@ -45,5 +45,5 @@ TEST(getcwd, testWindows_addsFunnyPrefix) { if (!IsWindows()) return; char path[PATH_MAX]; ASSERT_NE(0, getcwd(path, sizeof(path))); - EXPECT_STARTSWITH("//?/", path); + EXPECT_STARTSWITH("/C/", path); } diff --git a/test/libc/calls/mkntenvblock_test.c b/test/libc/calls/mkntenvblock_test.c index 3c7c4bac2..505b789fb 100644 --- a/test/libc/calls/mkntenvblock_test.c +++ b/test/libc/calls/mkntenvblock_test.c @@ -20,17 +20,18 @@ #include "libc/runtime/gc.internal.h" #include "libc/testlib/testlib.h" +char tmp[ARG_MAX]; char16_t envvars[ARG_MAX / 2]; TEST(mkntenvblock, emptyList_onlyOutputsDoubleNulStringTerminator) { char *envp[] = {NULL}; - ASSERT_NE(-1, mkntenvblock(envvars, envp, NULL)); + ASSERT_NE(-1, mkntenvblock(envvars, envp, NULL, tmp)); ASSERT_BINEQ(u"  ", envvars); } TEST(mkntenvblock, envp_becomesSortedDoubleNulTerminatedUtf16String) { char *envp[] = {"u=b", "c=d", "韩=非", "uh=d", "hduc=d", NULL}; - ASSERT_NE(-1, mkntenvblock(envvars, envp, NULL)); + ASSERT_NE(-1, mkntenvblock(envvars, envp, NULL, tmp)); ASSERT_BINEQ(u"C = d   " u"H D U C = d   " u"U = b   " @@ -42,7 +43,7 @@ TEST(mkntenvblock, envp_becomesSortedDoubleNulTerminatedUtf16String) { TEST(mkntenvblock, extraVar_getsAdded) { char *envp[] = {"u=b", "c=d", "韩=非", "uh=d", "hduc=d", NULL}; - ASSERT_NE(-1, mkntenvblock(envvars, envp, "a=a")); + ASSERT_NE(-1, mkntenvblock(envvars, envp, "a=a", tmp)); ASSERT_BINEQ(u"A = a   " u"C = d   " u"H D U C = d   " @@ -52,3 +53,11 @@ TEST(mkntenvblock, extraVar_getsAdded) { u"  ", envvars); } + +TEST(mkntenvblock, pathvars_getUpdated) { + char *envp[] = {"PATH=/c/foo:/d/bar", NULL}; + ASSERT_NE(-1, mkntenvblock(envvars, envp, 0, tmp)); + ASSERT_BINEQ(u"P A T H = c : \\ f o o ; d : \\ b a r   " + u"  ", + envvars); +} diff --git a/test/libc/calls/readlinkat_test.c b/test/libc/calls/readlinkat_test.c index b178c07ee..86ecd4465 100644 --- a/test/libc/calls/readlinkat_test.c +++ b/test/libc/calls/readlinkat_test.c @@ -101,9 +101,10 @@ TEST(readlinkat, statReadsNameLength) { } TEST(readlinkat, realpathReturnsLongPath) { - if (!IsWindows()) return; struct stat st; char buf[PATH_MAX]; + if (!IsWindows()) return; + if (!startswith(getcwd(buf, PATH_MAX), "/c/")) return; ASSERT_SYS(0, 0, touch("froot", 0644)); - ASSERT_STARTSWITH("//?/", realpath("froot", buf)); + ASSERT_STARTSWITH("/c/", realpath("froot", buf)); } diff --git a/test/libc/calls/test.mk b/test/libc/calls/test.mk index bb21502ce..eaf0b18e1 100644 --- a/test/libc/calls/test.mk +++ b/test/libc/calls/test.mk @@ -61,7 +61,7 @@ o/$(MODE)/test/libc/calls/%.com.dbg: \ o/$(MODE)/test/libc/calls/calls.pkg \ $(LIBC_TESTMAIN) \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) .PHONY: o/$(MODE)/test/libc/calls diff --git a/test/libc/dns/test.mk b/test/libc/dns/test.mk index 4fe280243..c29aab197 100644 --- a/test/libc/dns/test.mk +++ b/test/libc/dns/test.mk @@ -53,7 +53,7 @@ o/$(MODE)/test/libc/dns/%.com.dbg: \ o/$(MODE)/test/libc/dns/dns.pkg \ $(LIBC_TESTMAIN) \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) .PHONY: o/$(MODE)/test/libc/dns diff --git a/test/libc/fmt/fmt_test.c b/test/libc/fmt/fmt_test.c index 9a3851dfb..3300ee9eb 100644 --- a/test/libc/fmt/fmt_test.c +++ b/test/libc/fmt/fmt_test.c @@ -278,6 +278,11 @@ TEST(fmt, p) { gc(xasprintf("% 10p", 0xffff800000031337))); } +TEST(fmt, quoted) { + ASSERT_STREQ(" \"hello\"", gc(xasprintf("%`*.*s", 10, 5, "hello"))); + ASSERT_STREQ("\"hello\" ", gc(xasprintf("%-`*.*s", 10, 5, "hello"))); +} + TEST(fmt, regress) { char buf[512]; const char *meth = "GET"; diff --git a/test/libc/fmt/test.mk b/test/libc/fmt/test.mk index 57c9c3262..ccc8603a5 100644 --- a/test/libc/fmt/test.mk +++ b/test/libc/fmt/test.mk @@ -49,7 +49,7 @@ o/$(MODE)/test/libc/fmt/%.com.dbg: \ o/$(MODE)/test/libc/fmt/fmt.pkg \ $(LIBC_TESTMAIN) \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) $(TEST_LIBC_FMT_OBJS): test/libc/fmt/test.mk diff --git a/test/libc/intrin/test.mk b/test/libc/intrin/test.mk index c29c57784..77e858ccd 100644 --- a/test/libc/intrin/test.mk +++ b/test/libc/intrin/test.mk @@ -54,7 +54,7 @@ o/$(MODE)/test/libc/intrin/%.com.dbg: \ o/$(MODE)/test/libc/intrin/intrin.pkg \ $(LIBC_TESTMAIN) \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) $(TEST_LIBC_INTRIN_OBJS): \ diff --git a/test/libc/log/backtrace.c b/test/libc/log/backtrace.c new file mode 100644 index 000000000..857e7d8dd --- /dev/null +++ b/test/libc/log/backtrace.c @@ -0,0 +1,132 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Copyright 2022 Justine Alexandra Roberts Tunney │ +│ │ +│ Permission to use, copy, modify, and/or distribute this software for │ +│ any purpose with or without fee is hereby granted, provided that the │ +│ above copyright notice and this permission notice appear in all copies. │ +│ │ +│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │ +│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │ +│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │ +│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │ +│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │ +│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │ +│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ +│ PERFORMANCE OF THIS SOFTWARE. │ +╚─────────────────────────────────────────────────────────────────────────────*/ +#include "libc/fmt/conv.h" +#include "libc/limits.h" +#include "libc/log/log.h" +#include "libc/runtime/symbols.internal.h" +#include "libc/stdio/stdio.h" +#include "libc/str/str.h" + +int StackOverflow(int f(), int n) { + if (n < INT_MAX) { + return f(f, n + 1) - 1; + } else { + return INT_MAX; + } +} + +void FpuCrash(void) { + typedef char xmm_t __attribute__((__vector_size__(16))); + xmm_t v = {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, + 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf}; + volatile int x = 0; + asm volatile("fldpi"); + asm volatile("mov\t%0,%%r15" : /* no outputs */ : "g"(0x3133731337)); + asm volatile("movaps\t%0,%%xmm15" : /* no outputs */ : "x"(v)); + fputc(7 / x, stdout); +} + +char bss[10]; +void BssOverrunCrash(int n) { + int i; + for (i = 0; i < n; ++i) { + bss[i] = i; + } +} + +char data[10] = "abcdeabcde"; +void DataOverrunCrash(int n) { + int i; + for (i = 0; i < n; ++i) { + data[i] = i; + } +} + +const char rodata[10] = "abcdeabcde"; +int RodataOverrunCrash(int i) { + return rodata[i]; +} + +char *StackOverrunCrash(int n) { + int i; + char stack[10]; + bzero(stack, sizeof(stack)); + for (i = 0; i < n; ++i) { + stack[i] = i; + } + return strdup(stack); +} + +char *MemoryLeakCrash(void) { + char *p = strdup("doge"); + CheckForMemoryLeaks(); + return p; +} + +int NpeCrash(char *p) { + asm("nop"); // xxx: due to backtrace addr-1 thing + return *p; +} + +void (*pFpuCrash)(void) = FpuCrash; +void (*pBssOverrunCrash)(int) = BssOverrunCrash; +void (*pDataOverrunCrash)(int) = DataOverrunCrash; +int (*pRodataOverrunCrash)(int) = RodataOverrunCrash; +char *(*pStackOverrunCrash)(int) = StackOverrunCrash; +char *(*pMemoryLeakCrash)(void) = MemoryLeakCrash; +int (*pNpeCrash)(char *) = NpeCrash; +int (*pStackOverflow)(int (*)(), int) = StackOverflow; + +int main(int argc, char *argv[]) { + ShowCrashReports(); + if (argc > 1) { + switch (atoi(argv[1])) { + case 0: + break; + case 1: + pFpuCrash(); + exit(0); + case 2: + pBssOverrunCrash(10 + 1); + exit(0); + case 3: + exit(pRodataOverrunCrash(10 + 1)); + case 4: + pDataOverrunCrash(10 + 1); + exit(0); + case 5: + exit((intptr_t)pStackOverrunCrash(10 + 1)); + case 6: + exit((intptr_t)pMemoryLeakCrash()); + case 7: + exit(pNpeCrash(0)); + case 8: + __cxa_finalize(0); + exit(pNpeCrash(0)); + case 9: + exit(pStackOverflow(pStackOverflow, 0)); + default: + fputs("error: unrecognized argument\n", stderr); + exit(1); + } + } else { + fputs("error: too few args\n", stderr); + exit(1); + } +} diff --git a/test/libc/log/backtrace_test.c b/test/libc/log/backtrace_test.c index a8fd805c9..e313fae7e 100644 --- a/test/libc/log/backtrace_test.c +++ b/test/libc/log/backtrace_test.c @@ -26,6 +26,7 @@ #include "libc/limits.h" #include "libc/log/libfatal.internal.h" #include "libc/log/log.h" +#include "libc/mem/io.h" #include "libc/mem/mem.h" #include "libc/runtime/gc.internal.h" #include "libc/runtime/internal.h" @@ -40,115 +41,30 @@ #include "libc/x/x.h" #include "net/http/escape.h" -int StackOverflow(int f(), int n) { - if (n < INT_MAX) { - return f(f, n + 1) - 1; - } else { - return INT_MAX; - } +STATIC_YOINK("zip_uri_support"); +STATIC_YOINK("backtrace.com"); +STATIC_YOINK("backtrace.com.dbg"); + +char testlib_enable_tmp_setup_teardown_once; + +void Extract(const char *from, const char *to, int mode) { + ASSERT_SYS(0, 3, open(from, O_RDONLY)); + ASSERT_SYS(0, 4, creat(to, mode)); + ASSERT_NE(-1, _copyfd(3, 4, -1)); + EXPECT_SYS(0, 0, close(4)); + EXPECT_SYS(0, 0, close(3)); +} + +void SetUpOnce(void) { + ASSERT_NE(-1, mkdir("bin", 0755)); + Extract("/zip/backtrace.com", "bin/backtrace.com", 0755); + Extract("/zip/backtrace.com.dbg", "bin/backtrace.com.dbg", 0755); } static bool OutputHasSymbol(const char *output, const char *s) { return strstr(output, s) || (!FindDebugBinary() && strstr(output, "NULL")); } -void FpuCrash(void) { - typedef char xmm_t __attribute__((__vector_size__(16))); - xmm_t v = {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, - 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf}; - volatile int x = 0; - asm volatile("fldpi"); - asm volatile("mov\t%0,%%r15" : /* no outputs */ : "g"(0x3133731337)); - asm volatile("movaps\t%0,%%xmm15" : /* no outputs */ : "x"(v)); - fputc(7 / x, stdout); -} - -char bss[10]; -void BssOverrunCrash(int n) { - int i; - for (i = 0; i < n; ++i) { - bss[i] = i; - } -} - -char data[10] = "abcdeabcde"; -void DataOverrunCrash(int n) { - int i; - for (i = 0; i < n; ++i) { - data[i] = i; - } -} - -const char rodata[10] = "abcdeabcde"; -int RodataOverrunCrash(int i) { - return rodata[i]; -} - -char *StackOverrunCrash(int n) { - int i; - char stack[10]; - bzero(stack, sizeof(stack)); - for (i = 0; i < n; ++i) { - stack[i] = i; - } - return strdup(stack); -} - -char *MemoryLeakCrash(void) { - char *p = strdup("doge"); - CheckForMemoryLeaks(); - return p; -} - -int NpeCrash(char *p) { - asm("nop"); // xxx: due to backtrace addr-1 thing - return *p; -} - -void (*pFpuCrash)(void) = FpuCrash; -void (*pBssOverrunCrash)(int) = BssOverrunCrash; -void (*pDataOverrunCrash)(int) = DataOverrunCrash; -int (*pRodataOverrunCrash)(int) = RodataOverrunCrash; -char *(*pStackOverrunCrash)(int) = StackOverrunCrash; -char *(*pMemoryLeakCrash)(void) = MemoryLeakCrash; -int (*pNpeCrash)(char *) = NpeCrash; -int (*pStackOverflow)(int (*)(), int) = StackOverflow; - -void SetUp(void) { - ShowCrashReports(); - if (__argc == 2) { - switch (atoi(__argv[1])) { - case 0: - break; - case 1: - pFpuCrash(); - exit(0); - case 2: - pBssOverrunCrash(10 + 1); - exit(0); - case 3: - exit(pRodataOverrunCrash(10 + 1)); - case 4: - pDataOverrunCrash(10 + 1); - exit(0); - case 5: - exit((intptr_t)pStackOverrunCrash(10 + 1)); - case 6: - exit((intptr_t)pMemoryLeakCrash()); - case 7: - exit(pNpeCrash(0)); - case 8: - __cxa_finalize(0); - exit(pNpeCrash(0)); - case 9: - exit(pStackOverflow(pStackOverflow, 0)); - default: - printf("preventing fork recursion: %s\n", __argv[1]); - exit(1); - } - } -} - // UNFREED MEMORY // o/dbg/test/libc/log/backtrace_test.com // max allocated space 655,360 @@ -189,9 +105,8 @@ TEST(ShowCrashReports, testMemoryLeakCrash) { if (!pid) { dup2(fds[1], 1); dup2(fds[1], 2); - execv(GetProgramExecutableName(), - (char *const[]){GetProgramExecutableName(), "6", 0}); - _exit(127); + execv("bin/backtrace.com", (char *const[]){"bin/backtrace.com", "6", 0}); + _Exit(127); } close(fds[1]); output = 0; @@ -267,9 +182,8 @@ TEST(ShowCrashReports, testStackOverrunCrash) { if (!pid) { dup2(fds[1], 1); dup2(fds[1], 2); - execv(GetProgramExecutableName(), - (char *const[]){GetProgramExecutableName(), "5", 0}); - _exit(127); + execv("bin/backtrace.com", (char *const[]){"bin/backtrace.com", "5", 0}); + _Exit(127); } close(fds[1]); output = 0; @@ -376,9 +290,8 @@ TEST(ShowCrashReports, testDivideByZero) { if (!pid) { dup2(fds[1], 1); dup2(fds[1], 2); - execv(GetProgramExecutableName(), - (char *const[]){GetProgramExecutableName(), "1", 0}); - _exit(127); + execv("bin/backtrace.com", (char *const[]){"bin/backtrace.com", "1", 0}); + _Exit(127); } close(fds[1]); output = 0; @@ -454,9 +367,8 @@ TEST(ShowCrashReports, testStackOverflow) { if (!pid) { dup2(fds[1], 1); dup2(fds[1], 2); - execv(GetProgramExecutableName(), - (char *const[]){GetProgramExecutableName(), "9", "--strace", 0}); - _exit(127); + execv("bin/backtrace.com", (char *const[]){"bin/backtrace.com", "9", 0}); + _Exit(127); } close(fds[1]); output = 0; @@ -571,9 +483,8 @@ TEST(ShowCrashReports, testBssOverrunCrash) { if (!pid) { dup2(fds[1], 1); dup2(fds[1], 2); - execv(GetProgramExecutableName(), - (char *const[]){GetProgramExecutableName(), "2", 0}); - _exit(127); + execv("bin/backtrace.com", (char *const[]){"bin/backtrace.com", "2", 0}); + _Exit(127); } close(fds[1]); output = 0; @@ -650,9 +561,8 @@ TEST(ShowCrashReports, testNpeCrash) { if (!pid) { dup2(fds[1], 1); dup2(fds[1], 2); - execv(GetProgramExecutableName(), - (char *const[]){GetProgramExecutableName(), "7", 0}); - _exit(127); + execv("bin/backtrace.com", (char *const[]){"bin/backtrace.com", "7", 0}); + _Exit(127); } close(fds[1]); output = 0; @@ -710,9 +620,8 @@ TEST(ShowCrashReports, testDataOverrunCrash) { if (!pid) { dup2(fds[1], 1); dup2(fds[1], 2); - execv(GetProgramExecutableName(), - (char *const[]){GetProgramExecutableName(), "4", 0}); - _exit(127); + execv("bin/backtrace.com", (char *const[]){"bin/backtrace.com", "4", 0}); + _Exit(127); } close(fds[1]); output = 0; @@ -765,9 +674,8 @@ TEST(ShowCrashReports, testNpeCrashAfterFinalize) { if (!pid) { dup2(fds[1], 1); dup2(fds[1], 2); - execv(GetProgramExecutableName(), - (char *const[]){GetProgramExecutableName(), "8", 0}); - _exit(127); + execv("bin/backtrace.com", (char *const[]){"bin/backtrace.com", "8", 0}); + _Exit(127); } close(fds[1]); output = 0; diff --git a/test/libc/log/test.mk b/test/libc/log/test.mk index 6a05cf495..34d81864f 100644 --- a/test/libc/log/test.mk +++ b/test/libc/log/test.mk @@ -6,56 +6,82 @@ PKGS += TEST_LIBC_LOG TEST_LIBC_LOG_SRCS := $(wildcard test/libc/log/*.c) TEST_LIBC_LOG_SRCS_TEST = $(filter %_test.c,$(TEST_LIBC_LOG_SRCS)) -TEST_LIBC_LOG_OBJS = \ - $(TEST_LIBC_LOG_SRCS:%.c=o/$(MODE)/%.o) +TEST_LIBC_LOG_OBJS = \ + $(TEST_LIBC_LOG_SRCS:%.c=o/$(MODE)/%.o) \ + o/$(MODE)/test/libc/log/backtrace.com.zip.o \ + o/$(MODE)/test/libc/log/backtrace.com.dbg.zip.o -TEST_LIBC_LOG_COMS = \ +TEST_LIBC_LOG_COMS = \ $(TEST_LIBC_LOG_SRCS:%.c=o/$(MODE)/%.com) -TEST_LIBC_LOG_BINS = \ - $(TEST_LIBC_LOG_COMS) \ +TEST_LIBC_LOG_BINS = \ + $(TEST_LIBC_LOG_COMS) \ $(TEST_LIBC_LOG_COMS:%=%.dbg) -TEST_LIBC_LOG_TESTS = \ +TEST_LIBC_LOG_TESTS = \ $(TEST_LIBC_LOG_SRCS_TEST:%.c=o/$(MODE)/%.com.ok) -TEST_LIBC_LOG_CHECKS = \ +TEST_LIBC_LOG_CHECKS = \ $(TEST_LIBC_LOG_SRCS_TEST:%.c=o/$(MODE)/%.com.runs) -TEST_LIBC_LOG_DIRECTDEPS = \ - LIBC_CALLS \ - LIBC_RUNTIME \ - NET_HTTP \ - LIBC_STDIO \ - LIBC_X \ - LIBC_INTRIN \ - LIBC_FMT \ - LIBC_MEM \ - LIBC_NEXGEN32E \ - LIBC_LOG \ - LIBC_STR \ - LIBC_STUBS \ - LIBC_TESTLIB \ - LIBC_SYSV \ - LIBC_LOG +TEST_LIBC_LOG_DIRECTDEPS = \ + LIBC_CALLS \ + LIBC_RUNTIME \ + NET_HTTP \ + LIBC_STDIO \ + LIBC_X \ + LIBC_INTRIN \ + LIBC_FMT \ + LIBC_MEM \ + LIBC_NEXGEN32E \ + LIBC_LOG \ + LIBC_STR \ + LIBC_STUBS \ + LIBC_TESTLIB \ + LIBC_SYSV \ + LIBC_LOG \ + LIBC_ZIPOS -TEST_LIBC_LOG_DEPS := \ +TEST_LIBC_LOG_DEPS := \ $(call uniq,$(foreach x,$(TEST_LIBC_LOG_DIRECTDEPS),$($(x)))) -o/$(MODE)/test/libc/log/log.pkg: \ - $(TEST_LIBC_LOG_OBJS) \ +o/$(MODE)/test/libc/log/log.pkg: \ + $(TEST_LIBC_LOG_OBJS) \ $(foreach x,$(TEST_LIBC_LOG_DIRECTDEPS),$($(x)_A).pkg) -o/$(MODE)/test/libc/log/%.com.dbg: \ - $(TEST_LIBC_LOG_DEPS) \ - o/$(MODE)/test/libc/log/%.o \ - o/$(MODE)/test/libc/log/log.pkg \ - $(LIBC_TESTMAIN) \ - $(CRT) \ - $(APE) +o/$(MODE)/test/libc/log/%.com.dbg: \ + $(TEST_LIBC_LOG_DEPS) \ + o/$(MODE)/test/libc/log/%.o \ + o/$(MODE)/test/libc/log/log.pkg \ + $(LIBC_TESTMAIN) \ + $(CRT) \ + $(APE_NO_MODIFY_SELF) @$(APELINK) +o/$(MODE)/test/libc/log/backtrace_test.com.dbg: \ + $(TEST_LIBC_LOG_DEPS) \ + o/$(MODE)/test/libc/log/backtrace.com.zip.o \ + o/$(MODE)/test/libc/log/backtrace.com.dbg.zip.o \ + o/$(MODE)/test/libc/log/backtrace_test.o \ + o/$(MODE)/test/libc/log/log.pkg \ + $(LIBC_TESTMAIN) \ + $(CRT) \ + $(APE_NO_MODIFY_SELF) + @$(APELINK) + +o/$(MODE)/test/libc/log/backtrace.com.dbg: \ + $(TEST_LIBC_LOG_DEPS) \ + o/$(MODE)/test/libc/log/backtrace.o \ + $(CRT) \ + $(APE_NO_MODIFY_SELF) + @$(APELINK) + +o/$(MODE)/test/libc/log/backtrace.com.zip.o \ +o/$(MODE)/test/libc/log/backtrace.com.dbg.zip.o: \ + ZIPOBJ_FLAGS += \ + -B + .PHONY: o/$(MODE)/test/libc/log -o/$(MODE)/test/libc/log: \ - $(TEST_LIBC_LOG_BINS) \ +o/$(MODE)/test/libc/log: \ + $(TEST_LIBC_LOG_BINS) \ $(TEST_LIBC_LOG_CHECKS) diff --git a/test/libc/mem/test.mk b/test/libc/mem/test.mk index cdb4dc420..ced1e6174 100644 --- a/test/libc/mem/test.mk +++ b/test/libc/mem/test.mk @@ -58,7 +58,7 @@ o/$(MODE)/test/libc/mem/%.com.dbg: \ o/$(MODE)/test/libc/mem/mem.pkg \ $(LIBC_TESTMAIN) \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) $(TEST_LIBC_MEM_OBJS): \ diff --git a/test/libc/nexgen32e/test.mk b/test/libc/nexgen32e/test.mk index c86b2ad2d..5cc459028 100644 --- a/test/libc/nexgen32e/test.mk +++ b/test/libc/nexgen32e/test.mk @@ -55,7 +55,7 @@ o/$(MODE)/test/libc/nexgen32e/%.com.dbg: \ o/$(MODE)/test/libc/nexgen32e/nexgen32e.pkg \ $(LIBC_TESTMAIN) \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) $(TEST_LIBC_NEXGEN32E_OBJS): \ diff --git a/test/libc/rand/test.mk b/test/libc/rand/test.mk index a26a99a32..9195d233b 100644 --- a/test/libc/rand/test.mk +++ b/test/libc/rand/test.mk @@ -52,7 +52,7 @@ o/$(MODE)/test/libc/rand/%.com.dbg: \ o/$(MODE)/test/libc/rand/rand.pkg \ $(LIBC_TESTMAIN) \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) $(TEST_LIBC_RAND_OBJS): test/libc/rand/test.mk diff --git a/test/libc/release/metal.sh b/test/libc/release/metal.sh index 250fcc76c..29c0bae0a 100755 --- a/test/libc/release/metal.sh +++ b/test/libc/release/metal.sh @@ -10,7 +10,7 @@ if [ "$MODE" = opt ] || [ "$MODE" = optlinux ]; then exit fi -mkdir -p o/$MODE/test/libc/release/ +$MKDIR o/$MODE/test/libc/release/ # smoke test booting on bare metal and printing data to serial uart CMD="o/$MODE/tool/build/blinkenlights.com.dbg -r o/$MODE/examples/hello.com" diff --git a/test/libc/release/test.mk b/test/libc/release/test.mk index 70982d4f3..b1edcb485 100644 --- a/test/libc/release/test.mk +++ b/test/libc/release/test.mk @@ -124,17 +124,17 @@ o/$(MODE)/test/libc/release/smokeansi.com.dbg: \ o/$(MODE)/ape/ape.o \ o/$(MODE)/cosmopolitan.a -o/$(MODE)/test/libc/release/metal.ok: \ - test/libc/release/metal.sh \ - o/$(MODE)/examples/hello.com \ - o/$(MODE)/tool/build/blinkenlights.com.dbg - @$(COMPILE) -ASHTEST -tT$@ $< - -o/$(MODE)/test/libc/release/emulate.ok: \ - test/libc/release/emulate.sh \ - o/$(MODE)/examples/hello.com \ - o/$(MODE)/tool/build/blinkenlights.com.dbg - @$(COMPILE) -ASHTEST -tT$@ $< +# TODO(jart): Rewrite these shell scripts as C code. +# o/$(MODE)/test/libc/release/metal.ok: \ +# test/libc/release/metal.sh \ +# o/$(MODE)/examples/hello.com \ +# o/$(MODE)/tool/build/blinkenlights.com.dbg +# @$(COMPILE) -ASHTEST -tT$@ $< +# o/$(MODE)/test/libc/release/emulate.ok: \ +# test/libc/release/emulate.sh \ +# o/$(MODE)/examples/hello.com \ +# o/$(MODE)/tool/build/blinkenlights.com.dbg +# @$(COMPILE) -ASHTEST -tT$@ $< .PHONY: o/$(MODE)/test/libc/release o/$(MODE)/test/libc/release: \ @@ -145,6 +145,4 @@ o/$(MODE)/test/libc/release: \ o/$(MODE)/test/libc/release/smokecxx.com \ o/$(MODE)/test/libc/release/smokecxx.com.runs \ o/$(MODE)/test/libc/release/smokeansi.com \ - o/$(MODE)/test/libc/release/smokeansi.com.runs \ - o/$(MODE)/test/libc/release/emulate.ok \ - o/$(MODE)/test/libc/release/metal.ok + o/$(MODE)/test/libc/release/smokeansi.com.runs diff --git a/test/libc/runtime/mmap_test.c b/test/libc/runtime/mmap_test.c index 285581aa2..15e5da374 100644 --- a/test/libc/runtime/mmap_test.c +++ b/test/libc/runtime/mmap_test.c @@ -24,6 +24,7 @@ #include "libc/dce.h" #include "libc/errno.h" #include "libc/fmt/fmt.h" +#include "libc/intrin/kprintf.h" #include "libc/linux/mmap.h" #include "libc/linux/munmap.h" #include "libc/log/log.h" @@ -228,6 +229,7 @@ TEST(mmap, cow) { char *p; char path[PATH_MAX]; sprintf(path, "%s%s.%ld", kTmpPath, program_invocation_short_name, lemur64()); + kprintf("path = %#s\n", path); ASSERT_NE(-1, (fd = open(path, O_CREAT | O_TRUNC | O_RDWR, 0644))); EXPECT_EQ(5, write(fd, "hello", 5)); EXPECT_NE(-1, fdatasync(fd)); diff --git a/test/libc/runtime/test.mk b/test/libc/runtime/test.mk index c4881f68a..05c56c00f 100644 --- a/test/libc/runtime/test.mk +++ b/test/libc/runtime/test.mk @@ -58,7 +58,7 @@ o/$(MODE)/test/libc/runtime/%.com.dbg: \ o/$(MODE)/test/libc/runtime/runtime.pkg \ $(LIBC_TESTMAIN) \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/test/libc/runtime/ape_test.com.dbg: \ @@ -67,7 +67,7 @@ o/$(MODE)/test/libc/runtime/ape_test.com.dbg: \ o/$(MODE)/test/libc/runtime/runtime.pkg \ $(LIBC_TESTMAIN) \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) $(TEST_LIBC_RUNTIME_OBJS): \ diff --git a/test/libc/sock/test.mk b/test/libc/sock/test.mk index 961a53c4a..375d3e4fc 100644 --- a/test/libc/sock/test.mk +++ b/test/libc/sock/test.mk @@ -51,7 +51,7 @@ o/$(MODE)/test/libc/sock/%.com.dbg: \ o/$(MODE)/test/libc/sock/sock.pkg \ $(LIBC_TESTMAIN) \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) $(TEST_LIBC_SOCK_OBJS): test/libc/sock/test.mk diff --git a/test/libc/stdio/test.mk b/test/libc/stdio/test.mk index 468f42497..8eb805252 100644 --- a/test/libc/stdio/test.mk +++ b/test/libc/stdio/test.mk @@ -57,7 +57,7 @@ o/$(MODE)/test/libc/stdio/%.com.dbg: \ o/$(MODE)/test/libc/stdio/stdio.pkg \ $(LIBC_TESTMAIN) \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) $(TEST_LIBC_STDIO_OBJS): \ diff --git a/test/libc/str/test.mk b/test/libc/str/test.mk index 7b3ec9f89..1bcd04d7e 100644 --- a/test/libc/str/test.mk +++ b/test/libc/str/test.mk @@ -72,7 +72,7 @@ o/$(MODE)/test/libc/str/%.com.dbg: \ o/$(MODE)/test/libc/str/str.pkg \ $(LIBC_TESTMAIN) \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/test/libc/str/blake2.com.dbg: \ @@ -82,7 +82,7 @@ o/$(MODE)/test/libc/str/blake2.com.dbg: \ o/$(MODE)/test/libc/str/str.pkg \ $(LIBC_TESTMAIN) \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) $(TEST_LIBC_STR_OBJS): \ diff --git a/test/libc/thread/test.mk b/test/libc/thread/test.mk index 33a46bc08..c62a0429a 100644 --- a/test/libc/thread/test.mk +++ b/test/libc/thread/test.mk @@ -48,7 +48,7 @@ o/$(MODE)/test/libc/thread/%.com.dbg: \ o/$(MODE)/test/libc/thread/thread.pkg \ $(LIBC_TESTMAIN) \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) $(TEST_LIBC_THREAD_OBJS): \ diff --git a/test/libc/time/test.mk b/test/libc/time/test.mk index 4744b92d2..caa61cba9 100644 --- a/test/libc/time/test.mk +++ b/test/libc/time/test.mk @@ -43,7 +43,7 @@ o/$(MODE)/test/libc/time/%.com.dbg: \ o/$(MODE)/test/libc/time/time.pkg \ $(LIBC_TESTMAIN) \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) .PHONY: o/$(MODE)/test/libc/time diff --git a/test/libc/tinymath/test.mk b/test/libc/tinymath/test.mk index 4feea7a30..931e7e706 100644 --- a/test/libc/tinymath/test.mk +++ b/test/libc/tinymath/test.mk @@ -53,7 +53,7 @@ o/$(MODE)/test/libc/tinymath/%.com.dbg: \ o/$(MODE)/test/libc/tinymath/tinymath.pkg \ $(LIBC_TESTMAIN) \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) $(TEST_LIBC_TINYMATH_OBJS): \ diff --git a/test/libc/unicode/test.mk b/test/libc/unicode/test.mk index 2b49b9c52..85ecba50c 100644 --- a/test/libc/unicode/test.mk +++ b/test/libc/unicode/test.mk @@ -47,7 +47,7 @@ o/$(MODE)/test/libc/unicode/%.com.dbg: \ o/$(MODE)/test/libc/unicode/unicode.pkg \ $(LIBC_TESTMAIN) \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) .PHONY: o/$(MODE)/test/libc/unicode diff --git a/test/libc/x/test.mk b/test/libc/x/test.mk index 025c759c0..ef812823c 100644 --- a/test/libc/x/test.mk +++ b/test/libc/x/test.mk @@ -53,7 +53,7 @@ o/$(MODE)/test/libc/x/%.com.dbg: \ o/$(MODE)/test/libc/x/x.pkg \ $(LIBC_TESTMAIN) \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) .PHONY: o/$(MODE)/test/libc/x diff --git a/test/libc/x/xfixpath_test.c b/test/libc/x/xfixpath_test.c new file mode 100644 index 000000000..63a5a6b2d --- /dev/null +++ b/test/libc/x/xfixpath_test.c @@ -0,0 +1,27 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Copyright 2022 Justine Alexandra Roberts Tunney │ +│ │ +│ Permission to use, copy, modify, and/or distribute this software for │ +│ any purpose with or without fee is hereby granted, provided that the │ +│ above copyright notice and this permission notice appear in all copies. │ +│ │ +│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │ +│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │ +│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │ +│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │ +│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │ +│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │ +│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ +│ PERFORMANCE OF THIS SOFTWARE. │ +╚─────────────────────────────────────────────────────────────────────────────*/ +#include "libc/runtime/runtime.h" +#include "libc/testlib/testlib.h" +#include "libc/x/x.h" + +TEST(xfixpath, test) { + setenv("PATH", "C:\\bin;C:\\usr\\bin;C:\\usr\\local\\bin", true); + xfixpath(); + ASSERT_STREQ("/C/bin:/C/usr/bin:/C/usr/local/bin", getenv("PATH")); +} diff --git a/test/libc/xed/test.mk b/test/libc/xed/test.mk index e51d88fd3..440f93ec9 100644 --- a/test/libc/xed/test.mk +++ b/test/libc/xed/test.mk @@ -93,7 +93,7 @@ o/$(MODE)/test/libc/xed/%.com.dbg: \ o/$(MODE)/test/libc/xed/xed.pkg \ $(LIBC_TESTMAIN) \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) #─────────────────────────────────────────────────────────────────────────────── diff --git a/test/net/http/test.mk b/test/net/http/test.mk index c07da4234..e9d4b54db 100644 --- a/test/net/http/test.mk +++ b/test/net/http/test.mk @@ -37,7 +37,7 @@ o/$(MODE)/test/net/http/%.com.dbg: \ o/$(MODE)/test/net/http/%.o \ $(LIBC_TESTMAIN) \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) .PHONY: o/$(MODE)/test/net/http diff --git a/test/net/https/test.mk b/test/net/https/test.mk index be8db89a6..0970a3577 100644 --- a/test/net/https/test.mk +++ b/test/net/https/test.mk @@ -38,7 +38,7 @@ o/$(MODE)/test/net/https/%.com.dbg: \ o/$(MODE)/test/net/https/%.o \ $(LIBC_TESTMAIN) \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) .PHONY: o/$(MODE)/test/net/https diff --git a/test/tool/args/test.mk b/test/tool/args/test.mk index ff9019a44..91bd5eca5 100644 --- a/test/tool/args/test.mk +++ b/test/tool/args/test.mk @@ -66,7 +66,7 @@ o/$(MODE)/test/tool/args/%.com.dbg: \ $(TEST_TOOL_ARGS_A).pkg \ $(LIBC_TESTMAIN) \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) .PHONY: o/$(MODE)/test/tool/args diff --git a/test/tool/build/lib/test.mk b/test/tool/build/lib/test.mk index dda3332c2..28ffd7bee 100644 --- a/test/tool/build/lib/test.mk +++ b/test/tool/build/lib/test.mk @@ -66,7 +66,7 @@ o/$(MODE)/test/tool/build/lib/%.com.dbg: \ $(TEST_TOOL_BUILD_LIB_A).pkg \ $(LIBC_TESTMAIN) \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) .PHONY: o/$(MODE)/test/tool/build/lib diff --git a/test/tool/net/test.mk b/test/tool/net/test.mk index 3445d799b..c652a90a0 100644 --- a/test/tool/net/test.mk +++ b/test/tool/net/test.mk @@ -68,7 +68,7 @@ o/$(MODE)/test/tool/net/%.com.dbg: \ $(TEST_TOOL_NET_A).pkg \ $(LIBC_TESTMAIN) \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) .PHONY: o/$(MODE)/test/tool/net diff --git a/test/tool/plinko/test.mk b/test/tool/plinko/test.mk index c247d780a..f93b5a9e2 100644 --- a/test/tool/plinko/test.mk +++ b/test/tool/plinko/test.mk @@ -74,7 +74,7 @@ o/$(MODE)/test/tool/plinko/%.com.dbg: \ $(TEST_TOOL_PLINKO_A).pkg \ $(LIBC_TESTMAIN) \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/test/tool/plinko/plinko_test.com.runs: \ diff --git a/test/tool/viz/lib/test.mk b/test/tool/viz/lib/test.mk index 8aa21f4fd..ca85dda17 100644 --- a/test/tool/viz/lib/test.mk +++ b/test/tool/viz/lib/test.mk @@ -55,7 +55,7 @@ o/$(MODE)/test/tool/viz/lib/%.com.dbg: \ o/$(MODE)/test/tool/viz/lib/vizlib.pkg \ $(LIBC_TESTMAIN) \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) .PHONY: o/$(MODE)/test/tool/viz/lib diff --git a/third_party/chibicc/chibicc.c b/third_party/chibicc/chibicc.c index e1fff9230..c189381d5 100644 --- a/third_party/chibicc/chibicc.c +++ b/third_party/chibicc/chibicc.c @@ -80,7 +80,7 @@ static void chibicc_usage(int status) { char *p; size_t n; p = xslurp("/zip/third_party/chibicc/help.txt", &n); - xwrite(1, p, n); + __paginate(1, p); _Exit(status); } @@ -447,7 +447,8 @@ static bool run_subprocess(char **argv) { _Exit(1); } // Wait for the child process to finish. - do rc = wait(&ws); + do + rc = wait(&ws); while (rc == -1 && errno == EINTR); return WIFEXITED(ws) && WEXITSTATUS(ws) == 0; } diff --git a/third_party/chibicc/chibicc.mk b/third_party/chibicc/chibicc.mk index ec387ba89..892379df5 100644 --- a/third_party/chibicc/chibicc.mk +++ b/third_party/chibicc/chibicc.mk @@ -93,7 +93,7 @@ $(THIRD_PARTY_CHIBICC2_A).pkg: \ o/$(MODE)/third_party/chibicc/chibicc.com.dbg: \ $(THIRD_PARTY_CHIBICC_A_DEPS) \ $(THIRD_PARTY_CHIBICC_A) \ - $(APE) \ + $(APE_NO_MODIFY_SELF) \ $(CRT) \ o/$(MODE)/third_party/chibicc/help.txt.zip.o \ o/$(MODE)/third_party/chibicc/chibicc.main.o \ @@ -102,7 +102,7 @@ o/$(MODE)/third_party/chibicc/chibicc.com.dbg: \ o/$(MODE)/third_party/chibicc/chibicc2.com.dbg: \ $(THIRD_PARTY_CHIBICC_A_DEPS) \ $(THIRD_PARTY_CHIBICC2_A) \ - $(APE) \ + $(APE_NO_MODIFY_SELF) \ $(CRT) \ o/$(MODE)/third_party/chibicc/help.txt.zip.o \ o/$(MODE)/third_party/chibicc/chibicc.main.chibicc.o \ @@ -122,7 +122,7 @@ o/$(MODE)/third_party/chibicc/chibicc.com: \ o/$(MODE)/third_party/chibicc/as.com.dbg: \ $(THIRD_PARTY_CHIBICC_A_DEPS) \ $(THIRD_PARTY_CHIBICC_A) \ - $(APE) \ + $(APE_NO_MODIFY_SELF) \ $(CRT) \ o/$(MODE)/third_party/chibicc/as.main.o \ $(THIRD_PARTY_CHIBICC_A).pkg diff --git a/third_party/chibicc/help.txt b/third_party/chibicc/help.txt index 2d5bba64b..1e2730726 100644 --- a/third_party/chibicc/help.txt +++ b/third_party/chibicc/help.txt @@ -259,6 +259,15 @@ BUILTIN FUNCTIONS double __builtin_copysign(double, double) float __builtin_copysignf(float, float) long double __builtin_copysignl(long double, long double) + void __builtin_ia32_movntq(di *, di) + int __builtin_ia32_pmovmskb128(v16qi) + T __atomic_load(T *addr, int memorder) + void __atomic_clear(_Bool *addr, int memorder) + _Bool __atomic_test_and_set(void *addr, int memorder) + T __atomic_sub_fetch(T *addr, T amt, int memorder) + T __atomic_fetch_add(T *addr, T amt, int memorder) + T __sync_lock_test_and_set(T *addr, T value, ...) + void __sync_lock_release(T *addr, ...) BUILTIN OBJECTS diff --git a/third_party/chibicc/test/test.mk b/third_party/chibicc/test/test.mk index e42be50b0..3686e6db3 100644 --- a/third_party/chibicc/test/test.mk +++ b/third_party/chibicc/test/test.mk @@ -79,7 +79,7 @@ o/$(MODE)/third_party/chibicc/test/%.com.dbg: \ o/$(MODE)/third_party/chibicc/test/%.chibicc.o \ $(THIRD_PARTY_CHIBICC_TEST_A).pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/chibicc/test/%2.com.dbg: \ @@ -88,7 +88,7 @@ o/$(MODE)/third_party/chibicc/test/%2.com.dbg: \ o/$(MODE)/third_party/chibicc/test/%.chibicc2.o \ $(THIRD_PARTY_CHIBICC_TEST2_A).pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) .PRECIOUS: $(THIRD_PARTY_CHIBICC_TEST_OBJS) diff --git a/third_party/gcc/bin/x86_64-linux-musl-c++ b/third_party/gcc/bin/x86_64-linux-musl-c++ deleted file mode 120000 index 5311ab2a9..000000000 --- a/third_party/gcc/bin/x86_64-linux-musl-c++ +++ /dev/null @@ -1 +0,0 @@ -x86_64-linux-musl-g++ \ No newline at end of file diff --git a/third_party/gcc/bin/x86_64-linux-musl-c++.sym b/third_party/gcc/bin/x86_64-linux-musl-c++.sym new file mode 100644 index 000000000..5311ab2a9 --- /dev/null +++ b/third_party/gcc/bin/x86_64-linux-musl-c++.sym @@ -0,0 +1 @@ +x86_64-linux-musl-g++ \ No newline at end of file diff --git a/third_party/gcc/bin/x86_64-linux-musl-cc b/third_party/gcc/bin/x86_64-linux-musl-cc deleted file mode 120000 index d7bd3b204..000000000 --- a/third_party/gcc/bin/x86_64-linux-musl-cc +++ /dev/null @@ -1 +0,0 @@ -x86_64-linux-musl-gcc \ No newline at end of file diff --git a/third_party/gcc/bin/x86_64-linux-musl-cc.sym b/third_party/gcc/bin/x86_64-linux-musl-cc.sym new file mode 100644 index 000000000..d7bd3b204 --- /dev/null +++ b/third_party/gcc/bin/x86_64-linux-musl-cc.sym @@ -0,0 +1 @@ +x86_64-linux-musl-gcc \ No newline at end of file diff --git a/third_party/gcc/bin/x86_64-linux-musl-gcc-9.2.0 b/third_party/gcc/bin/x86_64-linux-musl-gcc-9.2.0 deleted file mode 120000 index d7bd3b204..000000000 --- a/third_party/gcc/bin/x86_64-linux-musl-gcc-9.2.0 +++ /dev/null @@ -1 +0,0 @@ -x86_64-linux-musl-gcc \ No newline at end of file diff --git a/third_party/gcc/bin/x86_64-linux-musl-gcc-9.2.0.sym b/third_party/gcc/bin/x86_64-linux-musl-gcc-9.2.0.sym new file mode 100644 index 000000000..d7bd3b204 --- /dev/null +++ b/third_party/gcc/bin/x86_64-linux-musl-gcc-9.2.0.sym @@ -0,0 +1 @@ +x86_64-linux-musl-gcc \ No newline at end of file diff --git a/third_party/gcc/bin/x86_64-linux-musl-ld b/third_party/gcc/bin/x86_64-linux-musl-ld deleted file mode 120000 index cf399b994..000000000 --- a/third_party/gcc/bin/x86_64-linux-musl-ld +++ /dev/null @@ -1 +0,0 @@ -../x86_64-linux-musl/bin/ld.bfd \ No newline at end of file diff --git a/third_party/gcc/bin/x86_64-linux-musl-ld.bfd b/third_party/gcc/bin/x86_64-linux-musl-ld.bfd deleted file mode 120000 index cf399b994..000000000 --- a/third_party/gcc/bin/x86_64-linux-musl-ld.bfd +++ /dev/null @@ -1 +0,0 @@ -../x86_64-linux-musl/bin/ld.bfd \ No newline at end of file diff --git a/third_party/gcc/bin/x86_64-linux-musl-ld.bfd.sym b/third_party/gcc/bin/x86_64-linux-musl-ld.bfd.sym new file mode 100644 index 000000000..cf399b994 --- /dev/null +++ b/third_party/gcc/bin/x86_64-linux-musl-ld.bfd.sym @@ -0,0 +1 @@ +../x86_64-linux-musl/bin/ld.bfd \ No newline at end of file diff --git a/third_party/gcc/bin/x86_64-linux-musl-ld.sym b/third_party/gcc/bin/x86_64-linux-musl-ld.sym new file mode 100644 index 000000000..cf399b994 --- /dev/null +++ b/third_party/gcc/bin/x86_64-linux-musl-ld.sym @@ -0,0 +1 @@ +../x86_64-linux-musl/bin/ld.bfd \ No newline at end of file diff --git a/third_party/gcc/libexec/gcc/x86_64-linux-musl/9.2.0/as b/third_party/gcc/libexec/gcc/x86_64-linux-musl/9.2.0/as deleted file mode 120000 index 244777532..000000000 --- a/third_party/gcc/libexec/gcc/x86_64-linux-musl/9.2.0/as +++ /dev/null @@ -1 +0,0 @@ -../../../../bin/x86_64-linux-musl-as \ No newline at end of file diff --git a/third_party/gcc/libexec/gcc/x86_64-linux-musl/9.2.0/as.sym b/third_party/gcc/libexec/gcc/x86_64-linux-musl/9.2.0/as.sym new file mode 100644 index 000000000..244777532 --- /dev/null +++ b/third_party/gcc/libexec/gcc/x86_64-linux-musl/9.2.0/as.sym @@ -0,0 +1 @@ +../../../../bin/x86_64-linux-musl-as \ No newline at end of file diff --git a/third_party/gcc/unbundle.sh b/third_party/gcc/unbundle.sh deleted file mode 100755 index 77bfb0168..000000000 --- a/third_party/gcc/unbundle.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -#-*-mode:sh;indent-tabs-mode:nil;tab-width:2;coding:utf-8-*-┐ -#───vi: set net ft=sh ts=2 sts=2 fenc=utf-8 :vi─────────────┘ -mkdir -p o/third_party -cp -R third_party/gcc o/third_party/gcc.$$ -for f in $(find o/third_party/gcc.$$ -name \*.gz); do - gunzip $f - chmod +x ${f%.gz} -done -mv o/third_party/gcc.$$ o/third_party/gcc diff --git a/third_party/gcc/x86_64-linux-musl/bin/ar b/third_party/gcc/x86_64-linux-musl/bin/ar deleted file mode 120000 index 18b47c53d..000000000 --- a/third_party/gcc/x86_64-linux-musl/bin/ar +++ /dev/null @@ -1 +0,0 @@ -../../bin/x86_64-linux-musl-ar \ No newline at end of file diff --git a/third_party/gcc/x86_64-linux-musl/bin/ar.sym b/third_party/gcc/x86_64-linux-musl/bin/ar.sym new file mode 100644 index 000000000..18b47c53d --- /dev/null +++ b/third_party/gcc/x86_64-linux-musl/bin/ar.sym @@ -0,0 +1 @@ +../../bin/x86_64-linux-musl-ar \ No newline at end of file diff --git a/third_party/gcc/x86_64-linux-musl/bin/as b/third_party/gcc/x86_64-linux-musl/bin/as deleted file mode 120000 index 9db7664e8..000000000 --- a/third_party/gcc/x86_64-linux-musl/bin/as +++ /dev/null @@ -1 +0,0 @@ -../../bin/x86_64-linux-musl-as \ No newline at end of file diff --git a/third_party/gcc/x86_64-linux-musl/bin/as.sym b/third_party/gcc/x86_64-linux-musl/bin/as.sym new file mode 100644 index 000000000..9db7664e8 --- /dev/null +++ b/third_party/gcc/x86_64-linux-musl/bin/as.sym @@ -0,0 +1 @@ +../../bin/x86_64-linux-musl-as \ No newline at end of file diff --git a/third_party/gcc/x86_64-linux-musl/bin/ld b/third_party/gcc/x86_64-linux-musl/bin/ld deleted file mode 120000 index 3f5ce09ea..000000000 --- a/third_party/gcc/x86_64-linux-musl/bin/ld +++ /dev/null @@ -1 +0,0 @@ -ld.bfd \ No newline at end of file diff --git a/third_party/gcc/x86_64-linux-musl/bin/ld.sym b/third_party/gcc/x86_64-linux-musl/bin/ld.sym new file mode 100644 index 000000000..3f5ce09ea --- /dev/null +++ b/third_party/gcc/x86_64-linux-musl/bin/ld.sym @@ -0,0 +1 @@ +ld.bfd \ No newline at end of file diff --git a/third_party/gcc/x86_64-linux-musl/bin/nm b/third_party/gcc/x86_64-linux-musl/bin/nm deleted file mode 120000 index 8312c6cf2..000000000 --- a/third_party/gcc/x86_64-linux-musl/bin/nm +++ /dev/null @@ -1 +0,0 @@ -../../bin/x86_64-linux-musl-nm \ No newline at end of file diff --git a/third_party/gcc/x86_64-linux-musl/bin/nm.sym b/third_party/gcc/x86_64-linux-musl/bin/nm.sym new file mode 100644 index 000000000..8312c6cf2 --- /dev/null +++ b/third_party/gcc/x86_64-linux-musl/bin/nm.sym @@ -0,0 +1 @@ +../../bin/x86_64-linux-musl-nm \ No newline at end of file diff --git a/third_party/gcc/x86_64-linux-musl/bin/objcopy b/third_party/gcc/x86_64-linux-musl/bin/objcopy deleted file mode 120000 index 1996c8fbd..000000000 --- a/third_party/gcc/x86_64-linux-musl/bin/objcopy +++ /dev/null @@ -1 +0,0 @@ -../../bin/x86_64-linux-musl-objcopy \ No newline at end of file diff --git a/third_party/gcc/x86_64-linux-musl/bin/objcopy.sym b/third_party/gcc/x86_64-linux-musl/bin/objcopy.sym new file mode 100644 index 000000000..1996c8fbd --- /dev/null +++ b/third_party/gcc/x86_64-linux-musl/bin/objcopy.sym @@ -0,0 +1 @@ +../../bin/x86_64-linux-musl-objcopy \ No newline at end of file diff --git a/third_party/gcc/x86_64-linux-musl/bin/objdump b/third_party/gcc/x86_64-linux-musl/bin/objdump deleted file mode 120000 index 9e6eb648e..000000000 --- a/third_party/gcc/x86_64-linux-musl/bin/objdump +++ /dev/null @@ -1 +0,0 @@ -../../bin/x86_64-linux-musl-objdump \ No newline at end of file diff --git a/third_party/gcc/x86_64-linux-musl/bin/objdump.sym b/third_party/gcc/x86_64-linux-musl/bin/objdump.sym new file mode 100644 index 000000000..9e6eb648e --- /dev/null +++ b/third_party/gcc/x86_64-linux-musl/bin/objdump.sym @@ -0,0 +1 @@ +../../bin/x86_64-linux-musl-objdump \ No newline at end of file diff --git a/third_party/gcc/x86_64-linux-musl/bin/ranlib b/third_party/gcc/x86_64-linux-musl/bin/ranlib deleted file mode 120000 index 9fd9a9ba5..000000000 --- a/third_party/gcc/x86_64-linux-musl/bin/ranlib +++ /dev/null @@ -1 +0,0 @@ -../../bin/x86_64-linux-musl-ranlib \ No newline at end of file diff --git a/third_party/gcc/x86_64-linux-musl/bin/ranlib.sym b/third_party/gcc/x86_64-linux-musl/bin/ranlib.sym new file mode 100644 index 000000000..9fd9a9ba5 --- /dev/null +++ b/third_party/gcc/x86_64-linux-musl/bin/ranlib.sym @@ -0,0 +1 @@ +../../bin/x86_64-linux-musl-ranlib \ No newline at end of file diff --git a/third_party/gcc/x86_64-linux-musl/bin/readelf b/third_party/gcc/x86_64-linux-musl/bin/readelf deleted file mode 120000 index bce53096b..000000000 --- a/third_party/gcc/x86_64-linux-musl/bin/readelf +++ /dev/null @@ -1 +0,0 @@ -../../bin/x86_64-linux-musl-readelf \ No newline at end of file diff --git a/third_party/gcc/x86_64-linux-musl/bin/readelf.sym b/third_party/gcc/x86_64-linux-musl/bin/readelf.sym new file mode 100644 index 000000000..bce53096b --- /dev/null +++ b/third_party/gcc/x86_64-linux-musl/bin/readelf.sym @@ -0,0 +1 @@ +../../bin/x86_64-linux-musl-readelf \ No newline at end of file diff --git a/third_party/gcc/x86_64-linux-musl/bin/strip b/third_party/gcc/x86_64-linux-musl/bin/strip deleted file mode 120000 index 3905fc078..000000000 --- a/third_party/gcc/x86_64-linux-musl/bin/strip +++ /dev/null @@ -1 +0,0 @@ -../../bin/x86_64-linux-musl-strip \ No newline at end of file diff --git a/third_party/gcc/x86_64-linux-musl/bin/strip.sym b/third_party/gcc/x86_64-linux-musl/bin/strip.sym new file mode 100644 index 000000000..3905fc078 --- /dev/null +++ b/third_party/gcc/x86_64-linux-musl/bin/strip.sym @@ -0,0 +1 @@ +../../bin/x86_64-linux-musl-strip \ No newline at end of file diff --git a/third_party/mbedtls/test/test.mk b/third_party/mbedtls/test/test.mk index 29130433e..95df2b1b1 100644 --- a/third_party/mbedtls/test/test.mk +++ b/third_party/mbedtls/test/test.mk @@ -130,7 +130,7 @@ o/$(MODE)/third_party/mbedtls/test/%.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/%.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/%.com: o/$(MODE)/third_party/mbedtls/test/%.com.dbg @@ -165,7 +165,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_aes.cbc.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_aes.cbc.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_aes.cfb.com: o/$(MODE)/third_party/mbedtls/test/test_suite_aes.cfb.com.dbg @@ -176,7 +176,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_aes.cfb.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_aes.cfb.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_aes.ecb.com: o/$(MODE)/third_party/mbedtls/test/test_suite_aes.ecb.com.dbg @@ -187,7 +187,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_aes.ecb.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_aes.ecb.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_aes.ofb.com: o/$(MODE)/third_party/mbedtls/test/test_suite_aes.ofb.com.dbg @@ -198,7 +198,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_aes.ofb.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_aes.ofb.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_aes.rest.com: o/$(MODE)/third_party/mbedtls/test/test_suite_aes.rest.com.dbg @@ -209,7 +209,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_aes.rest.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_aes.rest.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_aes.xts.com: o/$(MODE)/third_party/mbedtls/test/test_suite_aes.xts.com.dbg @@ -220,7 +220,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_aes.xts.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_aes.xts.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_asn1parse.com: o/$(MODE)/third_party/mbedtls/test/test_suite_asn1parse.com.dbg @@ -231,7 +231,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_asn1parse.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_asn1parse.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_asn1write.com: o/$(MODE)/third_party/mbedtls/test/test_suite_asn1write.com.dbg @@ -242,7 +242,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_asn1write.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_asn1write.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_base64.com: o/$(MODE)/third_party/mbedtls/test/test_suite_base64.com.dbg @@ -253,7 +253,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_base64.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_base64.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_blowfish.com: o/$(MODE)/third_party/mbedtls/test/test_suite_blowfish.com.dbg @@ -264,7 +264,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_blowfish.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_blowfish.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_chacha20.com: o/$(MODE)/third_party/mbedtls/test/test_suite_chacha20.com.dbg @@ -275,7 +275,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_chacha20.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_chacha20.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_chachapoly.com: o/$(MODE)/third_party/mbedtls/test/test_suite_chachapoly.com.dbg @@ -286,7 +286,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_chachapoly.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_chachapoly.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.aes.com: o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.aes.com.dbg @@ -297,7 +297,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.aes.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.aes.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.blowfish.com: o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.blowfish.com.dbg @@ -308,7 +308,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.blowfish.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.blowfish.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.ccm.com: o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.ccm.com.dbg @@ -319,7 +319,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.ccm.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.ccm.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.chacha20.com: o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.chacha20.com.dbg @@ -330,7 +330,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.chacha20.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.chacha20.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.chachapoly.com: o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.chachapoly.com.dbg @@ -341,7 +341,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.chachapoly.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.chachapoly.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.des.com: o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.des.com.dbg @@ -352,7 +352,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.des.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.des.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.gcm.com: o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.gcm.com.dbg @@ -363,7 +363,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.gcm.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.gcm.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.misc.com: o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.misc.com.dbg @@ -374,7 +374,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.misc.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.misc.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.nist_kw.com: o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.nist_kw.com.dbg @@ -385,7 +385,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.nist_kw.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.nist_kw.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.null.com: o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.null.com.dbg @@ -396,7 +396,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.null.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.null.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.padding.com: o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.padding.com.dbg @@ -407,7 +407,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.padding.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_cipher.padding.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_ctr_drbg.com: o/$(MODE)/third_party/mbedtls/test/test_suite_ctr_drbg.com.dbg @@ -418,7 +418,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_ctr_drbg.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_ctr_drbg.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_des.com: o/$(MODE)/third_party/mbedtls/test/test_suite_des.com.dbg @@ -429,7 +429,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_des.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_des.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_dhm.com: o/$(MODE)/third_party/mbedtls/test/test_suite_dhm.com.dbg @@ -442,7 +442,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_dhm.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/data/dhparams.pem.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_ecdh.com: o/$(MODE)/third_party/mbedtls/test/test_suite_ecdh.com.dbg @@ -453,7 +453,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_ecdh.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_ecdh.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_ecdsa.com: o/$(MODE)/third_party/mbedtls/test/test_suite_ecdsa.com.dbg @@ -464,7 +464,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_ecdsa.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_ecdsa.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_ecp.com: o/$(MODE)/third_party/mbedtls/test/test_suite_ecp.com.dbg @@ -475,7 +475,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_ecp.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_ecp.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_entropy.com: o/$(MODE)/third_party/mbedtls/test/test_suite_entropy.com.dbg @@ -486,7 +486,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_entropy.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_entropy.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_error.com: o/$(MODE)/third_party/mbedtls/test/test_suite_error.com.dbg @@ -497,7 +497,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_error.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_error.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_gcm.aes128_de.com: o/$(MODE)/third_party/mbedtls/test/test_suite_gcm.aes128_de.com.dbg @@ -508,7 +508,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_gcm.aes128_de.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_gcm.aes128_de.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_gcm.aes128_en.com: o/$(MODE)/third_party/mbedtls/test/test_suite_gcm.aes128_en.com.dbg @@ -519,7 +519,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_gcm.aes128_en.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_gcm.aes128_en.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_gcm.aes192_de.com: o/$(MODE)/third_party/mbedtls/test/test_suite_gcm.aes192_de.com.dbg @@ -530,7 +530,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_gcm.aes192_de.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_gcm.aes192_de.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_gcm.aes192_en.com: o/$(MODE)/third_party/mbedtls/test/test_suite_gcm.aes192_en.com.dbg @@ -541,7 +541,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_gcm.aes192_en.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_gcm.aes192_en.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_gcm.aes256_de.com: o/$(MODE)/third_party/mbedtls/test/test_suite_gcm.aes256_de.com.dbg @@ -552,7 +552,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_gcm.aes256_de.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_gcm.aes256_de.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_gcm.aes256_en.com: o/$(MODE)/third_party/mbedtls/test/test_suite_gcm.aes256_en.com.dbg @@ -563,7 +563,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_gcm.aes256_en.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_gcm.aes256_en.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_gcm.misc.com: o/$(MODE)/third_party/mbedtls/test/test_suite_gcm.misc.com.dbg @@ -574,7 +574,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_gcm.misc.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_gcm.misc.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_hkdf.com: o/$(MODE)/third_party/mbedtls/test/test_suite_hkdf.com.dbg @@ -585,7 +585,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_hkdf.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_hkdf.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_hmac_drbg.misc.com: o/$(MODE)/third_party/mbedtls/test/test_suite_hmac_drbg.misc.com.dbg @@ -596,7 +596,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_hmac_drbg.misc.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_hmac_drbg.misc.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_hmac_drbg.no_reseed.com: o/$(MODE)/third_party/mbedtls/test/test_suite_hmac_drbg.no_reseed.com.dbg @@ -607,7 +607,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_hmac_drbg.no_reseed.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_hmac_drbg.no_reseed.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_hmac_drbg.nopr.com: o/$(MODE)/third_party/mbedtls/test/test_suite_hmac_drbg.nopr.com.dbg @@ -618,7 +618,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_hmac_drbg.nopr.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_hmac_drbg.nopr.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_hmac_drbg.pr.com: o/$(MODE)/third_party/mbedtls/test/test_suite_hmac_drbg.pr.com.dbg @@ -629,7 +629,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_hmac_drbg.pr.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_hmac_drbg.pr.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_md.com: o/$(MODE)/third_party/mbedtls/test/test_suite_md.com.dbg @@ -645,7 +645,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_md.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/data/hash_file_5.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_mdx.com: o/$(MODE)/third_party/mbedtls/test/test_suite_mdx.com.dbg @@ -656,7 +656,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_mdx.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_mdx.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_memory_buffer_alloc.com: o/$(MODE)/third_party/mbedtls/test/test_suite_memory_buffer_alloc.com.dbg @@ -667,7 +667,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_memory_buffer_alloc.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_memory_buffer_alloc.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_mpi.com: o/$(MODE)/third_party/mbedtls/test/test_suite_mpi.com.dbg @@ -683,7 +683,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_mpi.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/data/mpi_write.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_net.com: o/$(MODE)/third_party/mbedtls/test/test_suite_net.com.dbg @@ -694,7 +694,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_net.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_net.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_nist_kw.com: o/$(MODE)/third_party/mbedtls/test/test_suite_nist_kw.com.dbg @@ -705,7 +705,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_nist_kw.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_nist_kw.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_oid.com: o/$(MODE)/third_party/mbedtls/test/test_suite_oid.com.dbg @@ -716,7 +716,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_oid.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_oid.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_pem.com: o/$(MODE)/third_party/mbedtls/test/test_suite_pem.com.dbg @@ -727,7 +727,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_pem.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_pem.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_pk.com: o/$(MODE)/third_party/mbedtls/test/test_suite_pk.com.dbg @@ -744,7 +744,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_pk.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/data/server5.key.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_pkcs1_v15.com: o/$(MODE)/third_party/mbedtls/test/test_suite_pkcs1_v15.com.dbg @@ -755,7 +755,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_pkcs1_v15.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_pkcs1_v15.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_pkcs1_v21.com: o/$(MODE)/third_party/mbedtls/test/test_suite_pkcs1_v21.com.dbg @@ -766,7 +766,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_pkcs1_v21.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_pkcs1_v21.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_pkcs5.com: o/$(MODE)/third_party/mbedtls/test/test_suite_pkcs5.com.dbg @@ -777,7 +777,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_pkcs5.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_pkcs5.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_pkparse.com: o/$(MODE)/third_party/mbedtls/test/test_suite_pkparse.com.dbg @@ -917,7 +917,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_pkparse.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/data/test-ca.key.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_pkwrite.com: o/$(MODE)/third_party/mbedtls/test/test_suite_pkwrite.com.dbg @@ -940,7 +940,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_pkwrite.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/data/server1.pubkey.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_poly1305.com: o/$(MODE)/third_party/mbedtls/test/test_suite_poly1305.com.dbg @@ -951,7 +951,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_poly1305.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_poly1305.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_random.com: o/$(MODE)/third_party/mbedtls/test/test_suite_random.com.dbg @@ -962,7 +962,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_random.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_random.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_rsa.com: o/$(MODE)/third_party/mbedtls/test/test_suite_rsa.com.dbg @@ -973,7 +973,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_rsa.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_rsa.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_shax.com: o/$(MODE)/third_party/mbedtls/test/test_suite_shax.com.dbg @@ -984,7 +984,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_shax.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_shax.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_ssl.com: o/$(MODE)/third_party/mbedtls/test/test_suite_ssl.com.dbg @@ -996,7 +996,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_ssl.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/data/server5.crt.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_timing.com: o/$(MODE)/third_party/mbedtls/test/test_suite_timing.com.dbg @@ -1007,7 +1007,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_timing.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_timing.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_version.com: o/$(MODE)/third_party/mbedtls/test/test_suite_version.com.dbg @@ -1018,7 +1018,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_version.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test_suite_version.datax.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_x509parse.com: o/$(MODE)/third_party/mbedtls/test/test_suite_x509parse.com.dbg @@ -1303,7 +1303,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_x509parse.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/data/test-int-ca3.crt.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_x509write.com: o/$(MODE)/third_party/mbedtls/test/test_suite_x509write.com.dbg @@ -1339,7 +1339,7 @@ o/$(MODE)/third_party/mbedtls/test/test_suite_x509write.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/data/test-ca.key.zip.o \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/everest_test.com: o/$(MODE)/third_party/mbedtls/test/everest_test.com.dbg @@ -1350,7 +1350,7 @@ o/$(MODE)/third_party/mbedtls/test/everest_test.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(LIBC_TESTMAIN) \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/secp384r1_test.com: o/$(MODE)/third_party/mbedtls/test/secp384r1_test.com.dbg @@ -1360,7 +1360,7 @@ o/$(MODE)/third_party/mbedtls/test/secp384r1_test.com.dbg: \ o/$(MODE)/third_party/mbedtls/test/test.pkg \ $(LIBC_TESTMAIN) \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/mbedtls/test/test_suite_asn1parse.com.runs: QUOTA = -M512m diff --git a/third_party/python/python.mk b/third_party/python/python.mk index 412fbae67..a623b04a8 100644 --- a/third_party/python/python.mk +++ b/third_party/python/python.mk @@ -2111,1495 +2111,1495 @@ o/$(MODE)/third_party/python/pythontester.com.dbg: \ $(THIRD_PARTY_PYTHON_PYTEST_TODOS:%.py=o/$(MODE)/%.o) \ o/$(MODE)/third_party/python/pythontester.o \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/python/Lib/test/test_grammar.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_grammar $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_set.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_set $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_genexps.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_genexps $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_sqlite.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_sqlite $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_bz2.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_bz2 $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_zlib.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_zlib $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_opcodes.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_opcodes $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_marshal.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_marshal $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_pow.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_pow $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_binascii.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_binascii $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_binhex.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_binhex $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_capi.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_capi $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test__locale.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test__locale $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_binop.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_binop $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test___future__.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test___future__ $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test__opcode.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test__opcode $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_abc.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_abc $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_bytes.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_bytes $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_setcomps.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_setcomps $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_itertools.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_itertools $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_listcomps.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_listcomps $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_aifc.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_aifc $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_audioop.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_audioop $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_bool.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_bool $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_base64.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_base64 $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_baseexception.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_baseexception $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_array.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_array $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_builtin.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_builtin $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_charmapcodec.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_charmapcodec $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_codecs.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_codecs $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_codeop.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_codeop $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_cgi.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_cgi $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_abstract_numbers.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_abstract_numbers $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_augassign.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_augassign $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_bigaddrspace.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_bigaddrspace $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_class.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_class $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_call.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_call $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_buffer.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_buffer $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_bufio.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_bufio $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_enum.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_enum $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_code.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_code $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_cmd.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_cmd $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_pwd.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_pwd $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_cmath.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_cmath $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_defaultdict.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_defaultdict $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_decorators.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_decorators $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_copy.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_copy $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_csv.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_csv $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_difflib.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_difflib $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_colorsys.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_colorsys $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_compare.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_compare $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_copyreg.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_copyreg $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_collections.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_collections $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_format.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_format $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_fractions.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_fractions $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_eof.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_eof $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_fnmatch.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_fnmatch $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_frame.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_frame $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_dummy_threading.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_dummy_threading $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_dynamic.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_dynamic $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_dict.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_dict $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_wsgiref.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_wsgiref $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_wave.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_wave $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_urlparse.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_urlparse $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_userdict.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_userdict $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_userlist.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_userlist $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_userstring.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_userstring $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_utf8source.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_utf8source $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_uu.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_uu $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_email/test__encoded_words.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_email.test__encoded_words $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_email/test__header_value_parser.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_email.test__header_value_parser $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_email/test_asian_codecs.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_email.test_asian_codecs $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_email/test_contentmanager.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_email.test_contentmanager $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_email/test_defect_handling.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_email.test_defect_handling $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_email/test_email.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_email.test_email $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_email/test_generator.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_email.test_generator $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_email/test_headerregistry.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_email.test_headerregistry $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_email/test_inversion.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_email.test_inversion $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_email/test_message.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_email.test_message $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_email/test_parser.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_email.test_parser $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_email/test_pickleable.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_email.test_pickleable $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_email/test_policy.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_email.test_policy $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_email/test_utils.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_email.test_utils $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_strtod.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_strtod $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_struct.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_struct $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_structmembers.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_structmembers $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_hash.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_hash $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_heapq.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_heapq $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_operator.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_operator $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_optparse.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_optparse $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_finalization.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_finalization $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_enumerate.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_enumerate $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_errno.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_errno $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_html.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_html $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_htmlparser.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_htmlparser $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_http_cookiejar.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_http_cookiejar $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_http_cookies.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_http_cookies $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_list.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_list $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_long.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_long $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_longexp.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_longexp $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_glob.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_glob $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_global.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_global $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_ipaddress.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_ipaddress $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_isinstance.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_isinstance $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_iter.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_iter $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_json/__main__.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_json $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_tarfile.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_tarfile $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_iterlen.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_iterlen $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_stat.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_stat $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_memoryio.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_memoryio $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_memoryview.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_memoryview $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_metaclass.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_metaclass $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_mimetypes.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_mimetypes $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_kdf.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_kdf $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_cosmo.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_cosmo $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_scratch.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_scratch $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_hashlib.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_hashlib $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_complex.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_complex $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_funcattrs.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_funcattrs $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_functools.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_functools $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_int.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_int $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_int_literal.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_int_literal $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_bisect.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_bisect $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_pyexpat.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_pyexpat $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_ioctl.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_ioctl $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_getopt.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_getopt $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_sort.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_sort $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_slice.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_slice $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_decimal.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_decimal $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_deque.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_deque $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_mmap.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_mmap $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_poll.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_poll $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_robotparser.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_robotparser $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_re.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_re $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_range.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_range $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_sax.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_sax $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_scope.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_scope $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_stringprep.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_stringprep $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_syntax.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_syntax $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_unicodedata.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_unicodedata $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_unpack.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_unpack $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_unpack_ex.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_unpack_ex $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_file.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_file $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_uuid.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_uuid $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_filecmp.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_filecmp $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_fileinput.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_fileinput $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_fileio.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_fileio $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_float.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_float $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_pickle.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_pickle $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_pickletools.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_pickletools $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_tuple.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_tuple $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_reprlib.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_reprlib $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_strftime.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_strftime $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_quopri.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_quopri $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_with.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_with $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_raise.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_raise $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_yield_from.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_yield_from $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_typechecks.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_typechecks $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_types.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_types $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_random.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_random $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_typing.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_typing $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_unary.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_unary $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_print.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_print $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_pprint.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_pprint $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_secrets.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_secrets $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_select.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_select $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_selectors.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_selectors $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_contains.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_contains $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_super.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_super $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_unicode.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_unicode $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_unicode_file.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_unicode_file $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_unicode_identifiers.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_unicode_identifiers $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_unicode_file_functions.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_unicode_file_functions $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_textwrap.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_textwrap $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_pulldom.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_pulldom $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_minidom.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_minidom $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_xml_dom_minicompat.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_xml_dom_minicompat $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_xml_etree_c.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_xml_etree_c $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_coroutines.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_coroutines $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_tempfile.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_tempfile $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_normalization.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_normalization $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_os.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_os $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_logging.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_logging $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_io.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_io $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_gzip.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_gzip $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_tracemalloc.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_tracemalloc $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_configparser.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_configparser $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_flufl.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_flufl $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_keyword.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_keyword $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_keywordonlyarg.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_keywordonlyarg $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_sys.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_sys $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_cgitb.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_cgitb $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_asyncgen.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_asyncgen $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_runpy.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_runpy $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_doctest.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_doctest $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_doctest2.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_doctest2 $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_calendar.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_calendar $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_asynchat.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_asynchat $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_asdl_parser.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_asdl_parser $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_atexit.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_atexit $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_dis.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_dis $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_asyncore.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_asyncore $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_epoll.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_epoll $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_cmd_line.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_cmd_line $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_cmd_line_script.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_cmd_line_script $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_code_module.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_code_module $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_codeccallbacks.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_codeccallbacks $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_codecmaps_cn.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_codecmaps_cn $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_codecmaps_jp.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_codecmaps_jp $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_codecencodings_cn.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_codecencodings_cn $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_codecencodings_hk.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_codecencodings_hk $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_codecmaps_hk.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_codecmaps_hk $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_codecmaps_kr.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_codecmaps_kr $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_codecmaps_tw.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_codecmaps_tw $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_codecencodings_iso2022.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_codecencodings_iso2022 $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_codecencodings_jp.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_codecencodings_jp $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_codecencodings_kr.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_codecencodings_kr $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_codecencodings_tw.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_codecencodings_tw $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_compile.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_compile $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_contextlib.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_contextlib $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_cprofile.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_cprofile $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_crashers.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_crashers $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_crypt.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_crypt $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_datetime.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_datetime $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_descrtut.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_descrtut $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_devpoll.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_devpoll $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_dict_version.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_dict_version $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_dictcomps.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_dictcomps $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_dictviews.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_dictviews $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_dtrace.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_dtrace $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_dynamicclassattribute.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_dynamicclassattribute $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_eintr.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_eintr $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_exception_hierarchy.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_exception_hierarchy $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_xmlrpc_net.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_xmlrpc_net $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_bigmem.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_bigmem $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_exception_variations.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_exception_variations $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_exceptions.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_exceptions $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_time.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_time $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_docxmlrpc.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_docxmlrpc $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_extcall.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_extcall $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_faulthandler.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_faulthandler $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_fcntl.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_fcntl $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_file_eintr.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_file_eintr $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_fork1.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_fork1 $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_fstring.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_fstring $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_ftplib.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_ftplib $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_future.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_future $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_future3.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_future3 $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_future4.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_future4 $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_future5.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_future5 $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_gc.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_gc $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_gdb.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_gdb $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_generator_stop.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_generator_stop $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_generators.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_generators $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_genericpath.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_genericpath $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_getargs2.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_getargs2 $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_getpass.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_getpass $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_gettext.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_gettext $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_grp.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_grp $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_imaplib.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_imaplib $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_imghdr.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_imghdr $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_imp.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_imp $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_index.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_index $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_kqueue.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_kqueue $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_largefile.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_largefile $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_linecache.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_linecache $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_locale.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_locale $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_macpath.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_macpath $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_macurl2path.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_macurl2path $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_mailbox.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_mailbox $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_mailcap.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_mailcap $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_module.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_module $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_modulefinder.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_modulefinder $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_multibytecodec.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_multibytecodec $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_multiprocessing_fork.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_multiprocessing_fork $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_multiprocessing_forkserver.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_multiprocessing_forkserver $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_multiprocessing_main_handling.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_multiprocessing_main_handling $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_multiprocessing_spawn.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_multiprocessing_spawn $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_netrc.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_netrc $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_nis.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_nis $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_nntplib.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_nntplib $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_ntpath.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_ntpath $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_numeric_tower.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_numeric_tower $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_ossaudiodev.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_ossaudiodev $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_parser.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_parser $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_pathlib.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_pathlib $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_pdb.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_pdb $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_peepholer.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_peepholer $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_pipes.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_pipes $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_pkgimport.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_pkgimport $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_platform.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_platform $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_plistlib.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_plistlib $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_httplib.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_httplib $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_popen.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_popen $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_poplib.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_poplib $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_posix.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_posix $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_posixpath.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_posixpath $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_profile.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_profile $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_property.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_property $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_pstats.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_pstats $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_pty.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_pty $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_py_compile.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_py_compile $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_pyclbr.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_pyclbr $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_pydoc.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_pydoc $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_readline.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_readline $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_regrtest.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_regrtest $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_repl.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_repl $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_resource.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_resource $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_richcmp.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_richcmp $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_sched.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_sched $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_script_helper.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_script_helper $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_shlex.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_shlex $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_shutil.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_shutil $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_signal.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_signal $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_site.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_site $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_smtpd.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_smtpd $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_smtplib.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_smtplib $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_smtpnet.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_smtpnet $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_sndhdr.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_sndhdr $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_socket.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_socket $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_socketserver.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_socketserver $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_spwd.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_spwd $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_startfile.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_startfile $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_statistics.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_statistics $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_string.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_string $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_string_literals.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_string_literals $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_strptime.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_strptime $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_structseq.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_structseq $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_subclassinit.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_subclassinit $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_subprocess.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_subprocess $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_sunau.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_sunau $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_support.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_support $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_symbol.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_symbol $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_symtable.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_symtable $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_sys_setprofile.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_sys_setprofile $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_syslog.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_syslog $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_telnetlib.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_telnetlib $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_threadedtempfile.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_threadedtempfile $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_timeit.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_timeit $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_timeout.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_timeout $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_tokenize.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_tokenize $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_trace.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_trace $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_traceback.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_traceback $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_turtle.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_turtle $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_unittest.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_unittest $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_univnewlines.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_univnewlines $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_urllib.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_urllib $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_urllib2.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_urllib2 $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_urllib2_localnet.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_urllib2_localnet $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_urllib2net.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_urllib2net $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_urllib_response.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_urllib_response $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_urllibnet.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_urllibnet $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_wait3.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_wait3 $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_wait4.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_wait4 $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_webbrowser.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_webbrowser $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_xdrlib.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_xdrlib $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_weakref.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_weakref $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_weakset.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_weakset $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_zipapp.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_zipapp $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_zipimport.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_zipimport $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_zipfile.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_zipfile $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_zipfile64.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_zipfile64 $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/mp_preload.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.mp_preload $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/bisect.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.bisect $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/signalinterproctester.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.signalinterproctester $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/pythoninfo.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.pythoninfo $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/datetimetester.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.datetimetester $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/outstanding_bugs.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.outstanding_bugs $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/sortperf.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.sortperf $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_openpty.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_openpty $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_queue.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_queue $(PYTESTARGS) o/$(MODE)/third_party/python/Lib/test/test_ordered_dict.py.runs: \ - o/$(MODE)/third_party/python/pythontester.com.dbg + o/$(MODE)/third_party/python/pythontester.com @$(COMPILE) -ACHECK -tT$@ $(PYHARNESSARGS) $< -m test.test_ordered_dict $(PYTESTARGS) ################################################################################ diff --git a/third_party/quickjs/quickjs.mk b/third_party/quickjs/quickjs.mk index 72c17d6b4..8172f7d45 100644 --- a/third_party/quickjs/quickjs.mk +++ b/third_party/quickjs/quickjs.mk @@ -174,7 +174,7 @@ o/$(MODE)/third_party/quickjs/run-test262.com.dbg: \ $(THIRD_PARTY_QUICKJS_A).pkg \ o/$(MODE)/third_party/quickjs/run-test262.o \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/quickjs/unicode_gen.com.dbg: \ @@ -183,7 +183,7 @@ o/$(MODE)/third_party/quickjs/unicode_gen.com.dbg: \ $(THIRD_PARTY_QUICKJS_A).pkg \ o/$(MODE)/third_party/quickjs/unicode_gen.o \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) $(THIRD_PARTY_QUICKJS_OBJS): \ diff --git a/third_party/smallz4/smallz4.mk b/third_party/smallz4/smallz4.mk index aea621222..a47b7ca86 100644 --- a/third_party/smallz4/smallz4.mk +++ b/third_party/smallz4/smallz4.mk @@ -60,14 +60,14 @@ o/$(MODE)/third_party/smallz4/smallz4.com.dbg: \ $(THIRD_PARTY_SMALLZ4) \ o/$(MODE)/third_party/smallz4/smallz4.o \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/third_party/smallz4/smallz4cat.com.dbg: \ $(THIRD_PARTY_SMALLZ4) \ o/$(MODE)/third_party/smallz4/smallz4cat.o \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) THIRD_PARTY_SMALLZ4_COMS = \ diff --git a/tool/build/ar.c b/tool/build/ar.c index 2f62f31eb..c33da4e07 100644 --- a/tool/build/ar.c +++ b/tool/build/ar.c @@ -17,6 +17,7 @@ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/alg/arraylist2.internal.h" +#include "libc/assert.h" #include "libc/bits/bits.h" #include "libc/bits/safemacros.internal.h" #include "libc/calls/calls.h" @@ -26,12 +27,16 @@ #include "libc/errno.h" #include "libc/fmt/conv.h" #include "libc/fmt/itoa.h" +#include "libc/intrin/kprintf.h" #include "libc/log/check.h" +#include "libc/log/log.h" #include "libc/macros.internal.h" +#include "libc/mem/mem.h" #include "libc/runtime/runtime.h" #include "libc/sock/sock.h" #include "libc/stdio/stdio.h" #include "libc/str/str.h" +#include "libc/sysv/consts/ex.h" #include "libc/sysv/consts/madv.h" #include "libc/sysv/consts/map.h" #include "libc/sysv/consts/o.h" @@ -53,6 +58,8 @@ * This tool also adds a feature: it ignores directory parameters. This * is important because good Makefiles on Linux will generally have the * directory be a .a prerequisite so archives rebuild on file deletion. + * + * @see https://www.unix.com/man-page/opensolaris/3head/ar.h/ */ struct Args { @@ -80,29 +87,68 @@ struct Header { char fmag[2]; }; +static void *Realloc(void *p, size_t n) { + void *q; + if (!(q = realloc(p, n))) { + fputs("error: ar: out of memory\n", stderr); + exit(1); + } + return q; +} + +static void *Malloc(size_t n) { + return Realloc(0, n); +} + +static void NewArgs(struct Args *l, size_t n) { + l->i = 0; + l->n = MAX(2, n); + l->p = Malloc(l->n * sizeof(*l->p)); + l->p[0] = 0; +} + static void NewInts(struct Ints *l, size_t n) { l->i = 0; - l->n = n; - l->p = xmalloc(n * sizeof(int)); + l->n = MAX(2, n); + l->p = Malloc(l->n * sizeof(*l->p)); + l->p[0] = 0; } static void NewString(struct String *s, size_t n) { s->i = 0; - s->n = n; - s->p = xmalloc(n); + s->n = MAX(2, n); + s->p = Malloc(s->n * sizeof(*s->p)); + s->p[0] = 0; } static void AppendInt(struct Ints *l, int i) { - APPEND(&l->p, &l->i, &l->n, &i); + assert(l->n > 1); + if (l->i + 1 >= l->n) { + do { + l->n += l->n >> 1; + } while (l->i + 1 >= l->n); + l->p = Realloc(l->p, l->n * sizeof(*l->p)); + } + l->p[l->i++] = i; + l->p[l->i] = 0; } static void AppendArg(struct Args *l, char *s) { - APPEND(&l->p, &l->i, &l->n, &s); + assert(l->n > 1); + if (l->i + 1 >= l->n) { + do { + l->n += l->n >> 1; + } while (l->i + 1 >= l->n); + l->p = Realloc(l->p, l->n * sizeof(*l->p)); + } + l->p[l->i++] = s; + l->p[l->i] = 0; } static void MakeHeader(struct Header *h, const char *name, int ref, int mode, int size) { size_t n; + char ibuf[13], *p; memset(h, ' ', sizeof(*h)); n = strlen(name); memcpy(h->name, name, n); @@ -113,11 +159,15 @@ static void MakeHeader(struct Header *h, const char *name, int ref, int mode, h->date[0] = '0'; h->uid[0] = '0'; h->gid[0] = '0'; - FormatOctal32(h->mode, mode & 0777, false); + p = FormatOctal32(ibuf, mode & 0777, false); + CHECK_LE(p - ibuf, sizeof(h->mode)); + memcpy(h->mode, ibuf, p - ibuf); } h->fmag[0] = '`'; h->fmag[1] = '\n'; - FormatUint32(h->size, size); + p = FormatUint32(ibuf, size); + CHECK_LE(p - ibuf, sizeof(h->size)); + memcpy(h->size, ibuf, p - ibuf); } int main(int argc, char *argv[]) { @@ -151,15 +201,24 @@ int main(int argc, char *argv[]) { struct Header *header1, *header2; int i, j, fd, err, name, outfd, tablebufsize; - if (argc == 2 && !strcmp(argv[1], "-n")) exit(0); + // TODO(jart): Delete this. + if (argc == 2 && !strcmp(argv[1], "-n")) { + exit(0); + } + + // we only support one mode of operation, which is creating a new + // deterministic archive. this tool is so fast that we don't need + // database-like tools when editing static archives if (!(argc > 2 && strcmp(argv[1], "rcsD") == 0)) { - fprintf(stderr, "%s%s%s\n", "Usage: ", argv[0], " rcsD ARCHIVE FILE..."); - return 1; + fputs("usage: ", stderr); + if (argc > 0) fputs(argv[0], stderr); + fputs(" rcsD ARCHIVE FILE...", stderr); + exit(EX_USAGE); } outpath = argv[2]; - bzero(&args, sizeof(args)); - st = xmalloc(sizeof(struct stat)); + NewArgs(&args, 4); + st = Malloc(sizeof(struct stat)); NewInts(&modes, 128); NewInts(&names, 128); NewInts(&sizes, 128); @@ -206,10 +265,10 @@ int main(int argc, char *argv[]) { // compute length of output archive outsize = 0; tablebufsize = 4 + symnames.i * 4; - tablebuf = xmalloc(tablebufsize); - offsets = xmalloc(args.i * 4); - header1 = xmalloc(sizeof(struct Header)); - header2 = xmalloc(sizeof(struct Header)); + tablebuf = Malloc(tablebufsize); + offsets = Malloc(args.i * 4); + header1 = Malloc(sizeof(struct Header)); + header2 = Malloc(sizeof(struct Header)); iov[0].iov_base = "!\n"; outsize += (iov[0].iov_len = 8); iov[1].iov_base = header1; diff --git a/tool/build/build.mk b/tool/build/build.mk index 9df4dace4..e81c3f03b 100644 --- a/tool/build/build.mk +++ b/tool/build/build.mk @@ -56,9 +56,11 @@ TOOL_BUILD_DIRECTDEPS = \ THIRD_PARTY_GDTOA \ THIRD_PARTY_GETOPT \ THIRD_PARTY_MBEDTLS \ + THIRD_PARTY_MUSL \ THIRD_PARTY_STB \ THIRD_PARTY_XED \ THIRD_PARTY_ZLIB \ + THIRD_PARTY_ZLIB_GZ \ TOOL_BUILD_LIB TOOL_BUILD_DEPS := \ @@ -78,7 +80,7 @@ o/$(MODE)/tool/build/%.com.dbg: \ o/$(MODE)/tool/build/build.pkg \ o/$(MODE)/tool/build/%.o \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/tool/build/blinkenlights.com.dbg: \ @@ -105,7 +107,7 @@ o/$(MODE)/tool/build/ar.com.dbg: \ o/$(MODE)/tool/build/build.pkg \ o/$(MODE)/tool/build/ar.o \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/tool/build/package.com.dbg: \ @@ -113,7 +115,7 @@ o/$(MODE)/tool/build/package.com.dbg: \ o/$(MODE)/tool/build/build.pkg \ o/$(MODE)/tool/build/package.o \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/tool/build/mkdeps.com.dbg: \ @@ -121,7 +123,7 @@ o/$(MODE)/tool/build/mkdeps.com.dbg: \ o/$(MODE)/tool/build/build.pkg \ o/$(MODE)/tool/build/mkdeps.o \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/tool/build/compile.com.dbg: \ @@ -129,7 +131,7 @@ o/$(MODE)/tool/build/compile.com.dbg: \ o/$(MODE)/tool/build/build.pkg \ o/$(MODE)/tool/build/compile.o \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/tool/build/zipobj.com.dbg: \ @@ -137,7 +139,7 @@ o/$(MODE)/tool/build/zipobj.com.dbg: \ o/$(MODE)/tool/build/build.pkg \ o/$(MODE)/tool/build/zipobj.o \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/tool/build/emulator.o: \ diff --git a/tool/build/cocmd.c b/tool/build/cocmd.c new file mode 100644 index 000000000..c0e717803 --- /dev/null +++ b/tool/build/cocmd.c @@ -0,0 +1,220 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Copyright 2022 Justine Alexandra Roberts Tunney │ +│ │ +│ Permission to use, copy, modify, and/or distribute this software for │ +│ any purpose with or without fee is hereby granted, provided that the │ +│ above copyright notice and this permission notice appear in all copies. │ +│ │ +│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │ +│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │ +│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │ +│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │ +│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │ +│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │ +│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ +│ PERFORMANCE OF THIS SOFTWARE. │ +╚─────────────────────────────────────────────────────────────────────────────*/ +#include "libc/calls/calls.h" +#include "libc/errno.h" +#include "libc/fmt/itoa.h" +#include "libc/macros.internal.h" +#include "libc/mem/mem.h" +#include "libc/runtime/runtime.h" +#include "libc/stdio/stdio.h" +#include "libc/str/str.h" +#include "libc/sysv/consts/o.h" + +/** + * @fileoverview Cosmopolitan Command Interpreter + * + * This is a lightweight command interpreter for GNU Make. It has just + * enough shell script language support to support our build config. + */ + +#define STATE_SHELL 0 +#define STATE_STR 1 + +char *p; +char *q; +char *cmd; +char *args[8192]; +const char *prog; +char argbuf[ARG_MAX]; +bool unsupported[256]; + +wontreturn void UnsupportedSyntax(unsigned char c) { + char ibuf[13]; + FormatOctal32(ibuf, c, true); + fputs(prog, stderr); + fputs(": unsupported shell syntax '", stderr); + fputc(c, stderr); + fputs("' (", stderr); + fputs(ibuf, stderr); + fputs("): ", stderr); + fputs(cmd, stderr); + fputs("\n", stderr); + exit(1); +} + +void Open(const char *path, int fd, int flags) { + const char *err; + close(fd); + if (open(path, flags, 0644) == -1) { + err = strerdoc(errno); + fputs(prog, stderr); + fputs(": failed to open '", stderr); + fputs(path, stderr); + fputs("': ", stderr); + fputs(err, stderr); + fputs("\n", stderr); + exit(1); + } +} + +char *Tokenize(void) { + int t; + char *r; + while (*p == ' ' || *p == '\t' || *p == '\n' || + (p[0] == '\\' && p[1] == '\n')) { + ++p; + } + if (!*p) return 0; + t = STATE_SHELL; + for (r = q;; ++p) { + switch (t) { + + case STATE_SHELL: + if (unsupported[*p & 255]) { + UnsupportedSyntax(*p); + } + if (!*p || *p == ' ' || *p == '\t') { + *q++ = 0; + return r; + } else if (*p == '\'') { + t = STATE_STR; + } else if (*p == '\\') { + if (!p[1]) UnsupportedSyntax(*p); + *q++ = *++p; + } else { + *q++ = *p; + } + break; + + case STATE_STR: + if (!*p) { + fputs("cmd: error: unterminated string\n", stderr); + exit(1); + } + if (*p == '\'') { + t = STATE_SHELL; + } else { + *q++ = *p; + } + break; + + default: + unreachable; + } + } +} + +int main(int argc, char *argv[]) { + char *s, *arg; + size_t i, j, n; + prog = argc > 0 ? argv[0] : "cocmd.com"; + + for (i = 1; i < 32; ++i) { + unsupported[i] = true; + } + unsupported['\t'] = false; + unsupported[0177] = true; + unsupported['~'] = true; + unsupported['`'] = true; + unsupported['#'] = true; + unsupported['$'] = true; + unsupported['*'] = true; + unsupported['('] = true; + unsupported[')'] = true; + unsupported['|'] = true; + unsupported['['] = true; + unsupported[']'] = true; + unsupported['{'] = true; + unsupported['}'] = true; + unsupported[';'] = true; + unsupported['"'] = true; + unsupported['?'] = true; + unsupported['!'] = true; + + if (argc != 3) { + fputs(prog, stderr); + fputs(": error: wrong number of args\n", stderr); + return 1; + } + + if (strcmp(argv[1], "-c")) { + fputs(prog, stderr); + fputs(": error: argv[1] should -c\n", stderr); + return 1; + } + + p = cmd = argv[2]; + if (strlen(cmd) >= ARG_MAX) { + fputs(prog, stderr); + fputs(": error: cmd too long: ", stderr); + fputs(cmd, stderr); + fputs("\n", stderr); + return 1; + } + + n = 0; + q = argbuf; + while ((arg = Tokenize())) { + if (n + 1 < ARRAYLEN(args)) { + if (!strcmp(arg, "2>&1")) { + close(1); + dup(2); + } else if (!strcmp(arg, ">&2")) { + close(2); + dup(1); + } else if (arg[0] == '2' && arg[1] == '>' && arg[2] == '>') { + Open(arg + 3, 2, O_WRONLY | O_CREAT | O_APPEND); + } else if (arg[0] == '>' && arg[1] == '>') { + Open(arg + 2, 1, O_WRONLY | O_CREAT | O_APPEND); + } else if (arg[0] == '2' && arg[1] == '>') { + Open(arg + 2, 2, O_WRONLY | O_CREAT | O_TRUNC); + } else if (arg[0] == '>') { + Open(arg + 1, 1, O_WRONLY | O_CREAT | O_TRUNC); + } else if (arg[0] == '<') { + Open(arg + 1, 0, O_RDONLY); + } else { + args[n++] = arg; + } + } else { + fputs(prog, stderr); + fputs(": error: too many args\n", stderr); + return 1; + } + } + + if (!n) { + fputs(prog, stderr); + fputs(": error: too few args\n", stderr); + return 1; + } + + execv(args[0], args); + if (!n) { + s = strerdoc(errno); + fputs(prog, stderr); + fputs(": execve '", stderr); + fputs(args[0], stderr); + fputs("' failed: ", stderr); + fputs(s, stderr); + fputs("\n", stderr); + return 1; + } + + return 127; +} diff --git a/tool/build/compile.c b/tool/build/compile.c index 4088fc917..7705c048d 100644 --- a/tool/build/compile.c +++ b/tool/build/compile.c @@ -32,6 +32,7 @@ #include "libc/errno.h" #include "libc/fmt/conv.h" #include "libc/fmt/itoa.h" +#include "libc/intrin/kprintf.h" #include "libc/limits.h" #include "libc/log/color.internal.h" #include "libc/log/log.h" @@ -170,9 +171,7 @@ char *output; char *outpath; char *command; char *shortened; -char *cachedcmd; char *colorflag; -char *originalcmd; char ccpath[PATH_MAX]; struct stat st; @@ -582,7 +581,7 @@ int Launch(void) { timer.it_interval.tv_sec = timeout; setitimer(ITIMER_REAL, &timer, 0); } - pid = fork(); + pid = vfork(); #if 0 int fd; @@ -665,6 +664,8 @@ int Launch(void) { kill(pid, SIGKILL); gotalrm = 1; } + } else if (errno == ECHILD) { + break; } else { /* this should never happen */ PrintRed(); @@ -1040,44 +1041,6 @@ int main(int argc, char *argv[]) { } } - /* - * help error reporting code find symbol table - */ - if (startswith(cmd, "o/")) { - if (endswith(cmd, ".com")) { - s = xstrcat(cmd, ".dbg"); - } else { - s = xstrcat(cmd, ".com.dbg"); - } - if (fileexists(s)) { - AddEnv(xstrcat("COMDBG=", getcwd(0, 0), '/', s)); - } - } - - /* - * create assimilated atomic copies of ape binaries - */ - if (!IsWindows() && endswith(cmd, ".com")) { - if (!startswith(cmd, "o/")) { - cachedcmd = xstrcat("o/", cmd); - } else { - cachedcmd = xstrcat(xstripext(cmd), ".elf"); - } - if (FileExistsAndIsNewerThan(cachedcmd, cmd)) { - cmd = cachedcmd; - } else { - originalcmd = cmd; - FormatInt64(buf, getpid()); - cmd = xstrcat(originalcmd, ".tmp.", buf); - if (copyfile(originalcmd, cmd, COPYFILE_PRESERVE_TIMESTAMPS) == -1) { - fputs("error: compile.com failed to copy ape executable\n", stderr); - unlink(cmd); - exit(97); - } - } - args.p[0] = cmd; - } - /* * make sense of standard i/o file descriptors * we want to permit pipelines but prevent talking to terminal @@ -1117,26 +1080,6 @@ int main(int argc, char *argv[]) { * run command */ ws = Launch(); - if (ws != -1 && WIFEXITED(ws) && WEXITSTATUS(ws) == 127) { - if (startswith(cmd, "o/third_party/gcc") && - fileexists("third_party/gcc/unbundle.sh")) { - system("third_party/gcc/unbundle.sh"); - ws = Launch(); - } - } - - /* - * cleanup temporary copy of ape executable - */ - if (originalcmd) { - if (cachedcmd && WIFEXITED(ws) && !WEXITSTATUS(ws) && - IsNativeExecutable(cmd)) { - makedirs(xdirname(cachedcmd), 0755); - rename(cmd, cachedcmd); - } else { - unlink(cmd); - } - } /* * propagate exit diff --git a/tool/build/cp.c b/tool/build/cp.c new file mode 100644 index 000000000..f8c41dac7 --- /dev/null +++ b/tool/build/cp.c @@ -0,0 +1,234 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Copyright 2022 Justine Alexandra Roberts Tunney │ +│ │ +│ Permission to use, copy, modify, and/or distribute this software for │ +│ any purpose with or without fee is hereby granted, provided that the │ +│ above copyright notice and this permission notice appear in all copies. │ +│ │ +│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │ +│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │ +│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │ +│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │ +│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │ +│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │ +│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ +│ PERFORMANCE OF THIS SOFTWARE. │ +╚─────────────────────────────────────────────────────────────────────────────*/ +#include "libc/calls/calls.h" +#include "libc/calls/copyfile.h" +#include "libc/calls/struct/stat.h" +#include "libc/errno.h" +#include "libc/fmt/conv.h" +#include "libc/fmt/fmt.h" +#include "libc/intrin/kprintf.h" +#include "libc/runtime/gc.h" +#include "libc/runtime/runtime.h" +#include "libc/stdio/stdio.h" +#include "libc/str/str.h" +#include "libc/sysv/consts/at.h" +#include "libc/sysv/consts/ex.h" +#include "libc/sysv/consts/exit.h" +#include "libc/sysv/consts/ok.h" +#include "libc/x/x.h" +#include "third_party/getopt/getopt.h" +#include "third_party/musl/ftw.h" + +#define USAGE \ + " SRC... DST\n\ +\n\ +SYNOPSIS\n\ +\n\ + Copies Files\n\ +\n\ +FLAGS\n\ +\n\ + -?\n\ + -h help\n\ + -f force\n\ + -r recursive\n\ + -n no clobber\n\ + -a preserve all\n\ + -p preserve owner and timestamps\n\ +\n" + +int flags; +bool force; +int striplen; +bool recursive; +const char *prog; +char mkbuf[PATH_MAX]; +char srcdir[PATH_MAX]; +char dstdir[PATH_MAX]; +char srcfile[PATH_MAX]; +char dstfile[PATH_MAX]; +char linkbuf[PATH_MAX]; + +void Cp(char *, char *); + +bool IsDirectory(const char *path) { + int e; + bool res; + struct stat st; + e = errno; + res = stat(path, &st) != -1 && S_ISDIR(st.st_mode); + errno = e; + return res; +} + +bool IsSymlink(const char *path) { + int e; + bool res; + struct stat st; + e = errno; + res = fstatat(AT_FDCWD, path, &st, AT_SYMLINK_NOFOLLOW) != -1 && + S_ISLNK(st.st_mode); + errno = e; + return res; +} + +wontreturn void PrintUsage(int rc, FILE *f) { + fputs("usage: ", f); + fputs(prog, f); + fputs(USAGE, f); + exit(rc); +} + +void GetOpts(int argc, char *argv[]) { + int opt; + while ((opt = getopt(argc, argv, "?hfnaprR")) != -1) { + switch (opt) { + case 'f': + force = true; + break; + case 'r': + case 'R': + recursive = true; + break; + case 'n': + flags |= COPYFILE_NOCLOBBER; + break; + case 'a': + case 'p': + flags |= COPYFILE_PRESERVE_OWNER; + flags |= COPYFILE_PRESERVE_TIMESTAMPS; + break; + case 'h': + case '?': + PrintUsage(EXIT_SUCCESS, stdout); + default: + PrintUsage(EX_USAGE, stderr); + } + } +} + +int Visit(const char *fpath, const struct stat *sb, int tflag, + struct FTW *ftwbuf) { + char *src; + strcpy(srcfile, fpath); + src = srcfile + striplen; + strcpy(dstfile, dstdir); + if (!endswith(dstfile, "/")) { + strcat(dstfile, "/"); + } + strcat(dstfile, src); + strcpy(srcfile, fpath); + switch (tflag) { + case FTW_D: + return 0; + case FTW_F: + case FTW_SL: + case FTW_SLN: + Cp(srcfile, dstfile); + return 0; + default: + fputs(fpath, stderr); + fputs(": can't handle file type\n", stderr); + exit(1); + } +} + +char *Join(const char *a, const char *b) { + size_t n, m; + n = strlen(a); + m = strlen(b); + if (n + 1 + m + 1 > sizeof(dstfile)) { + fputs("error: cp: path too long\n", stderr); + exit(1); + } + stpcpy(stpcpy(stpcpy(dstfile, a), "/"), b); + return dstfile; +} + +void Cp(char *src, char *dst) { + ssize_t rc; + const char *s; + if (strlen(src) + 1 > PATH_MAX) _Exit(2); + if (strlen(dst) + 1 > PATH_MAX) _Exit(2); + basename(src); + basename(dst); + if (IsDirectory(src)) { + if (!recursive) { + fputs(prog, stderr); + fputs(": won't copy directory without -r flag.\n", stderr); + exit(1); + } + strcpy(dstdir, dst); + if (IsDirectory(dst)) { + strcpy(srcdir, src); + basename(srcdir); + striplen = 0; + strcpy(srcdir, basename(src)); + } else { + strcpy(srcdir, src); + basename(srcdir); + striplen = strlen(srcdir); + strcpy(srcdir, ""); + } + if (nftw(src, Visit, 20, 0) == -1) { + fputs(prog, stderr); + fputs(": nftw failed: ", stderr); + fputs(strerdoc(errno), stderr); + fputs("\n", stderr); + exit(1); + } + return; + } + if (IsDirectory(dst)) { + dst = Join(dst, basename(src)); + } + if (!force && access(dst, W_OK) == -1 && errno != ENOENT) goto OnFail; + strcpy(mkbuf, dst); + if (makedirs(dirname(mkbuf), 0755) == -1) goto OnFail; + if (IsSymlink(src)) { + if ((rc = readlink(src, linkbuf, sizeof(linkbuf) - 1)) == -1) goto OnFail; + linkbuf[rc] = 0; + if (symlink(linkbuf, dst) == -1) goto OnFail; + } else { + if (copyfile(src, dst, flags) == -1) goto OnFail; + } + return; +OnFail: + s = strerdoc(errno); + fputs(prog, stderr); + fputs(": ", stderr); + fputs(src, stderr); + fputs(" ", stderr); + fputs(dst, stderr); + fputs(": ", stderr); + fputs(s, stderr); + fputs("\n", stderr); + exit(1); +} + +int main(int argc, char *argv[]) { + int i; + prog = argc > 0 ? argv[0] : "cp.com"; + GetOpts(argc, argv); + if (argc - optind < 2) PrintUsage(EX_USAGE, stderr); + for (i = optind; i < argc - 1; ++i) { + Cp(argv[i], argv[argc - 1]); + } + return 0; +} diff --git a/tool/build/echo.c b/tool/build/echo.c new file mode 100644 index 000000000..4cc0fe8e8 --- /dev/null +++ b/tool/build/echo.c @@ -0,0 +1,46 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Copyright 2022 Justine Alexandra Roberts Tunney │ +│ │ +│ Permission to use, copy, modify, and/or distribute this software for │ +│ any purpose with or without fee is hereby granted, provided that the │ +│ above copyright notice and this permission notice appear in all copies. │ +│ │ +│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │ +│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │ +│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │ +│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │ +│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │ +│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │ +│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ +│ PERFORMANCE OF THIS SOFTWARE. │ +╚─────────────────────────────────────────────────────────────────────────────*/ +#include "libc/stdio/stdio.h" +#include "libc/str/str.h" + +int main(int argc, char *argv[]) { + int i, j; + FILE *stream = stdout; + bool wantnewline = true; + + for (i = 1; i < argc; ++i) { + if (!strcmp(argv[i], "-n")) { + wantnewline = false; + } else if (!strcmp(argv[i], "-2")) { + stream = stderr; + } else { + break; + } + } + + for (j = 0; i + j < argc; ++j) { + if (j) fputc(' ', stream); + fputs(argv[i + j], stream); + } + if (wantnewline) { + fputc('\n', stream); + } + + return 0; +} diff --git a/tool/build/gzip.c b/tool/build/gzip.c new file mode 100644 index 000000000..ce86f8217 --- /dev/null +++ b/tool/build/gzip.c @@ -0,0 +1,310 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Copyright 2022 Justine Alexandra Roberts Tunney │ +│ │ +│ Permission to use, copy, modify, and/or distribute this software for │ +│ any purpose with or without fee is hereby granted, provided that the │ +│ above copyright notice and this permission notice appear in all copies. │ +│ │ +│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │ +│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │ +│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │ +│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │ +│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │ +│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │ +│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ +│ PERFORMANCE OF THIS SOFTWARE. │ +╚─────────────────────────────────────────────────────────────────────────────*/ +#include "libc/calls/calls.h" +#include "libc/errno.h" +#include "libc/mem/mem.h" +#include "libc/runtime/runtime.h" +#include "libc/stdio/stdio.h" +#include "libc/str/str.h" +#include "libc/sysv/consts/ex.h" +#include "libc/sysv/consts/exit.h" +#include "libc/sysv/consts/ok.h" +#include "third_party/getopt/getopt.h" +#include "third_party/zlib/zlib.h" + +#define USAGE \ + " PATH...\n\ +\n\ +SYNOPSIS\n\ +\n\ + Compress Files\n\ +\n\ +FLAGS\n\ +\n\ + -?\n\ + -h help\n\ + -f force\n\ + -c use stdout\n\ + -d decompress\n\ + -A append mode\n\ + -x exclusive mode\n\ + -k keep input file\n\ + -0 disable compression\n\ + -1 fastest compression\n\ + -4 coolest compression\n\ + -9 maximum compression\n\ + -a ascii mode (ignored)\n\ + -F fixed strategy (advanced)\n\ + -L filtered strategy (advanced)\n\ + -R run length strategy (advanced)\n\ + -H huffman only strategy (advanced)\n\ +\n" + +bool opt_keep; +bool opt_force; +char opt_level; +bool opt_append; +char opt_strategy; +bool opt_exclusive; +bool opt_usestdout; +bool opt_decompress; + +const char *prog; +char databuf[32768]; +char pathbuf[PATH_MAX]; + +wontreturn void PrintUsage(int rc, FILE *f) { + fputs("usage: ", f); + fputs(prog, f); + fputs(USAGE, f); + exit(rc); +} + +void GetOpts(int argc, char *argv[]) { + int opt; + while ((opt = getopt(argc, argv, "?hfcdakxALFRHF0123456789")) != -1) { + switch (opt) { + case 'k': + opt_keep = true; + break; + case 'f': + opt_force = true; + break; + case 'A': + opt_append = true; + break; + case 'c': + opt_usestdout = true; + break; + case 'x': + opt_exclusive = true; + break; + case 'd': + opt_decompress = true; + break; + case 'F': + opt_strategy = 'F'; // Z_FIXED + break; + case 'L': + opt_strategy = 'f'; // Z_FILTERED + break; + case 'R': + opt_strategy = 'R'; // Z_RLE + break; + case 'H': + opt_strategy = 'h'; // Z_HUFFMAN_ONLY + break; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + opt_level = opt; + break; + case 'h': + case '?': + PrintUsage(EXIT_SUCCESS, stdout); + default: + PrintUsage(EX_USAGE, stderr); + } + } +} + +void Compress(const char *inpath) { + FILE *input; + gzFile output; + int rc, n, errnum; + const char *outpath; + char *p, openflags[5]; + outpath = 0; + if (inpath) { + input = fopen(inpath, "rb"); + } else if (opt_usestdout && (opt_force || !isatty(1))) { + opt_usestdout = true; + inpath = "/dev/stdin"; + input = stdin; + } else { + fputs(prog, stderr); + fputs(": compressed data not written to a terminal." + " Use -f to force compression.\n", + stderr); + exit(1); + } + p = openflags; + *p++ = opt_append ? 'a' : 'w'; + *p++ = 'b'; + if (opt_exclusive) *p++ = 'x'; + if (opt_level) *p++ = opt_level; + if (opt_strategy) *p++ = opt_strategy; + *p = 0; + if (opt_usestdout) { + outpath = "/dev/stdout"; + output = gzdopen(0, openflags); + } else { + if (strlen(inpath) + 3 + 1 > PATH_MAX) _Exit(2); + stpcpy(stpcpy(pathbuf, inpath), ".gz"); + outpath = pathbuf; + output = gzopen(outpath, openflags); + } + if (!output) { + fputs(outpath, stderr); + fputs(": gzopen() failed\n", stderr); + fputs(strerdoc(errno), stderr); + fputs("\n", stderr); + exit(1); + } + do { + rc = fread(databuf, 1, sizeof(databuf), input); + if (rc == -1) { + errnum = 0; + fputs(inpath, stderr); + fputs(": read failed: ", stderr); + fputs(strerdoc(ferror(input)), stderr); + fputs("\n", stderr); + _Exit(1); + } + if (!gzwrite(output, databuf, rc)) { + fputs(outpath, stderr); + fputs(": gzwrite failed: ", stderr); + fputs(gzerror(output, &errnum), stderr); + fputs("\n", stderr); + _Exit(1); + } + } while (rc == sizeof(databuf)); + if (input != stdin) { + if (fclose(input)) { + fputs(inpath, stderr); + fputs(": close failed\n", stderr); + _Exit(1); + } + } + if (gzclose(output)) { + fputs(outpath, stderr); + fputs(": gzclose failed\n", stderr); + _Exit(1); + } + if (!opt_keep && !opt_usestdout && (opt_force || !access(inpath, W_OK))) { + unlink(inpath); + } +} + +void Decompress(const char *inpath) { + FILE *output; + gzFile input; + int rc, n, errnum; + const char *outpath; + outpath = 0; + if (inpath) { + input = gzopen(inpath, "rb"); + } else { + opt_usestdout = true; + inpath = "/dev/stdin"; + input = gzdopen(0, "rb"); + } + if (!input) { + fputs(inpath, stderr); + fputs(": gzopen() failed\n", stderr); + fputs(strerdoc(errno), stderr); + fputs("\n", stderr); + exit(1); + } + if (opt_usestdout) { + output = stdout; + outpath = "/dev/stdout"; + } else if (endswith(inpath, ".gz")) { + n = strlen(inpath); + if (n - 3 + 1 > PATH_MAX) _Exit(2); + memcpy(pathbuf, inpath, n - 3); + pathbuf[n - 3] = 0; + outpath = pathbuf; + if (!(output = fopen(outpath, opt_append ? "wa" : "wb"))) { + fputs(outpath, stderr); + fputs(": open failed: ", stderr); + fputs(strerdoc(errno), stderr); + fputs("\n", stderr); + _Exit(1); + } + } else { + fputs(inpath, stderr); + fputs(": needs to end with .gz unless -c is passed\n", stderr); + _Exit(1); + } + do { + rc = gzread(input, databuf, sizeof(databuf)); + if (rc == -1) { + errnum = 0; + fputs(inpath, stderr); + fputs(": gzread failed: ", stderr); + fputs(gzerror(input, &errnum), stderr); + fputs("\n", stderr); + _Exit(1); + } + if (fwrite(databuf, rc, 1, output) != 1) { + fputs(outpath, stderr); + fputs(": write failed: ", stderr); + fputs(strerdoc(ferror(output)), stderr); + fputs("\n", stderr); + _Exit(1); + } + } while (rc == sizeof(databuf)); + if (gzclose(input)) { + fputs(inpath, stderr); + fputs(": gzclose failed\n", stderr); + _Exit(1); + } + if (output != stdout) { + if (fclose(output)) { + fputs(outpath, stderr); + fputs(": close failed\n", stderr); + _Exit(1); + } + } + if (!opt_keep && !opt_usestdout && (opt_force || !access(inpath, W_OK))) { + unlink(inpath); + } +} + +int main(int argc, char *argv[]) { + int i; + prog = argc > 0 ? argv[0] : "cp.com"; + GetOpts(argc, argv); + if (opt_decompress) { + if (optind == argc) { + Decompress(0); + } else { + for (i = optind; i < argc; ++i) { + Decompress(argv[i]); + } + } + } else { + if (optind == argc) { + Compress(0); + } else { + for (i = optind; i < argc; ++i) { + Compress(argv[i]); + } + } + } + return 0; +} diff --git a/tool/build/mkdeps.c b/tool/build/mkdeps.c index ed828227f..a49b4cfc2 100644 --- a/tool/build/mkdeps.c +++ b/tool/build/mkdeps.c @@ -28,6 +28,7 @@ #include "libc/dce.h" #include "libc/errno.h" #include "libc/fmt/fmt.h" +#include "libc/intrin/kprintf.h" #include "libc/log/check.h" #include "libc/log/log.h" #include "libc/macros.internal.h" @@ -225,7 +226,7 @@ wontreturn void OnMissingFile(const char *list, const char *src) { * automatically restart itself. */ if (list) { - fprintf(stderr, "%s %s...\n", "Refreshing", list); + kprintf("%s %s...\n", "Refreshing", list); unlink(list); } exit(1); @@ -249,7 +250,9 @@ void LoadRelationships(int argc, char *argv[]) { while ((src = getargs_next(&ga))) { if (ShouldSkipSource(src)) continue; srcid = GetSourceId(src, strlen(src)); - if ((fd = open(src, O_RDONLY)) == -1) OnMissingFile(ga.path, src); + if ((fd = open(src, O_RDONLY)) == -1) { + OnMissingFile(ga.path, src); + } CHECK_NE(-1, (rc = read(fd, buf, MAX_READ))); close(fd); size = rc; @@ -282,13 +285,13 @@ void GetOpts(int argc, char *argv[]) { buildroot = optarg; break; default: - fprintf(stderr, "%s: %s [-r %s] [-o %s] [%s...]\n", "Usage", argv[0], + kprintf("%s: %s [-r %s] [-o %s] [%s...]\n", "Usage", argv[0], "BUILDROOT", "OUTPUT", "PATHSFILE"); exit(1); } } - if (isempty(out)) fprintf(stderr, "need -o FILE"), exit(1); - if (isempty(buildroot)) fprintf(stderr, "need -r o/$(MODE)"), exit(1); + if (isempty(out)) kprintf("need -o FILE"), exit(1); + if (isempty(buildroot)) kprintf("need -r o/$(MODE)"), exit(1); } const char *StripExt(const char *s) { @@ -352,7 +355,7 @@ bool HasSameContent(void) { s = GetFileSizeOrZero(out); if (s == appendz(bout).i) { if (s) { - CHECK_NE(-1, (fd = open(out, O_RDONLY))); + CHECK_NE(-1, (fd = open(out, O_RDONLY)), "open(%#s)", out); CHECK_NE(MAP_FAILED, (m = mmap(0, s, PROT_READ, MAP_SHARED, fd, 0))); r = !bcmp(bout, m, s); munmap(m, s); @@ -394,7 +397,7 @@ int main(int argc, char *argv[]) { appendw(&bout, '\n'); } /* if (!fileexists(out) || !HasSameContent()) { */ - CHECK_NE(-1, (fd = open(out, O_CREAT | O_WRONLY, 0644))); + CHECK_NE(-1, (fd = open(out, O_CREAT | O_WRONLY, 0644)), "open(%#s)", out); CHECK_NE(-1, ftruncate(fd, appendz(bout).i)); CHECK_NE(-1, xwrite(fd, bout, appendz(bout).i)); CHECK_NE(-1, close(fd)); diff --git a/tool/build/mkdir.c b/tool/build/mkdir.c new file mode 100644 index 000000000..45b1d5bdc --- /dev/null +++ b/tool/build/mkdir.c @@ -0,0 +1,82 @@ +#if 0 +/*─────────────────────────────────────────────────────────────────╗ +│ To the extent possible under law, Justine Tunney has waived │ +│ all copyright and related or neighboring rights to this file, │ +│ as it is written in the following disclaimers: │ +│ • http://unlicense.org/ │ +│ • http://creativecommons.org/publicdomain/zero/1.0/ │ +╚─────────────────────────────────────────────────────────────────*/ +#endif +#include "libc/calls/calls.h" +#include "libc/errno.h" +#include "libc/fmt/conv.h" +#include "libc/runtime/runtime.h" +#include "libc/stdio/stdio.h" +#include "libc/str/str.h" +#include "libc/sysv/consts/ex.h" +#include "libc/x/x.h" +#include "third_party/getopt/getopt.h" + +#define USAGE \ + " [-p] [-m MODE] DIR...\n\ +Utility for creating directories.\n\ +\n\ +FLAGS\n\ +\n\ + -h Help\n\ + -m MODE Octal mode\n\ + -p Make parent directories\n" + +const char *prog; + +wontreturn void PrintUsage(int rc, FILE *f) { + fputs("Usage: ", f); + fputs(prog, f); + fputs(USAGE, f); + exit(rc); +} + +int main(int argc, char *argv[]) { + int i, mode = 0755; + int (*mkdirp)(const char *, unsigned) = mkdir; + prog = argc > 0 ? argv[0] : "mkdir.com"; + + while ((i = getopt(argc, argv, "?hpm:")) != -1) { + switch (i) { + case 'p': + mkdirp = makedirs; + break; + case 'm': + mode = strtol(optarg, 0, 8); + break; + case '?': + case 'h': + PrintUsage(0, stdout); + default: + PrintUsage(EX_USAGE, stderr); + } + } + + if (optind == argc) { + fputs(prog, stderr); + fputs(": missing argument\n", stderr); + fputs("Try '", stderr); + fputs(prog, stderr); + fputs(" -h' for more information.\n", stderr); + exit(1); + } + + for (i = optind; i < argc; ++i) { + if (mkdirp(argv[i], mode) == -1) { + fputs(prog, stderr); + fputs(": cannot create directory '", stderr); + fputs(argv[i], stderr); + fputs("' ", stderr); + fputs(strerdoc(errno), stderr); + fputc('\n', stderr); + exit(1); + } + } + + return 0; +} diff --git a/tool/build/pwd.c b/tool/build/pwd.c new file mode 100644 index 000000000..2b7f59f01 --- /dev/null +++ b/tool/build/pwd.c @@ -0,0 +1,37 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Copyright 2022 Justine Alexandra Roberts Tunney │ +│ │ +│ Permission to use, copy, modify, and/or distribute this software for │ +│ any purpose with or without fee is hereby granted, provided that the │ +│ above copyright notice and this permission notice appear in all copies. │ +│ │ +│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │ +│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │ +│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │ +│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │ +│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │ +│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │ +│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ +│ PERFORMANCE OF THIS SOFTWARE. │ +╚─────────────────────────────────────────────────────────────────────────────*/ +#include "libc/calls/calls.h" +#include "libc/stdio/stdio.h" + +/** + * @fileoverview Tool for printing current directory. + */ + +char path[PATH_MAX]; + +int main(int argc, char *argv[]) { + char *p; + if ((p = getcwd(path, sizeof(path)))) { + fputs(p, stdout); + fputc('\n', stdout); + return 0; + } else { + return 1; + } +} diff --git a/tool/build/rm.c b/tool/build/rm.c new file mode 100644 index 000000000..a3d808f19 --- /dev/null +++ b/tool/build/rm.c @@ -0,0 +1,103 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Copyright 2022 Justine Alexandra Roberts Tunney │ +│ │ +│ Permission to use, copy, modify, and/or distribute this software for │ +│ any purpose with or without fee is hereby granted, provided that the │ +│ above copyright notice and this permission notice appear in all copies. │ +│ │ +│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │ +│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │ +│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │ +│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │ +│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │ +│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │ +│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ +│ PERFORMANCE OF THIS SOFTWARE. │ +╚─────────────────────────────────────────────────────────────────────────────*/ +#include "libc/calls/calls.h" +#include "libc/errno.h" +#include "libc/runtime/runtime.h" +#include "libc/stdio/stdio.h" +#include "libc/str/str.h" +#include "libc/sysv/consts/ex.h" +#include "libc/sysv/consts/exit.h" +#include "libc/sysv/consts/ok.h" +#include "third_party/getopt/getopt.h" + +#define USAGE \ + " FILE...\n\ +\n\ +SYNOPSIS\n\ +\n\ + Removes Files\n\ +\n\ +FLAGS\n\ +\n\ + -?\n\ + -h help\n\ + -f force\n\ +\n" + +bool force; +const char *prog; + +wontreturn void PrintUsage(int rc, FILE *f) { + fputs("usage: ", f); + fputs(prog, f); + fputs(USAGE, f); + exit(rc); +} + +void GetOpts(int argc, char *argv[]) { + int opt; + while ((opt = getopt(argc, argv, "?hf")) != -1) { + switch (opt) { + case 'f': + force = true; + break; + case 'h': + case '?': + PrintUsage(EXIT_SUCCESS, stdout); + default: + PrintUsage(EX_USAGE, stderr); + } + } +} + +void Remove(const char *path) { + const char *s; + if (!force && access(path, W_OK) == -1) goto OnFail; + if (unlink(path) == -1) goto OnFail; + return; +OnFail: + if (force && errno == ENOENT) return; + s = strerdoc(errno); + fputs(prog, stderr); + fputs(": cannot remove '", stderr); + fputs(path, stderr); + fputs("': ", stderr); + fputs(s, stderr); + fputs("\n", stderr); + exit(1); +} + +int main(int argc, char *argv[]) { + int i; + prog = argc > 0 ? argv[0] : "rm.com"; + + if (argc < 2) { + fputs(prog, stderr); + fputs(": missing operand\n" + "Try 'rm -h' for more information.\n", + stderr); + exit(1); + } + + GetOpts(argc, argv); + + for (i = optind; i < argc; ++i) { + Remove(argv[i]); + } +} diff --git a/tool/build/runitd.c b/tool/build/runitd.c index cf4d92128..0d0d54cee 100644 --- a/tool/build/runitd.c +++ b/tool/build/runitd.c @@ -305,6 +305,7 @@ void Recv(void *output, size_t outputsize) { // pass along eof condition to zlib INFOF("mbedtls_ssl_read"); received = mbedtls_ssl_read(&ezssl, buf, sizeof(buf)); + if (!received) TlsDie("got unexpected eof", received); if (received < 0) TlsDie("read failed", received); // decompress packet completely // into a dynamical size buffer diff --git a/tool/build/touch.c b/tool/build/touch.c new file mode 100644 index 000000000..f9be6e8b7 --- /dev/null +++ b/tool/build/touch.c @@ -0,0 +1,46 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Copyright 2022 Justine Alexandra Roberts Tunney │ +│ │ +│ Permission to use, copy, modify, and/or distribute this software for │ +│ any purpose with or without fee is hereby granted, provided that the │ +│ above copyright notice and this permission notice appear in all copies. │ +│ │ +│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │ +│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │ +│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │ +│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │ +│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │ +│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │ +│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ +│ PERFORMANCE OF THIS SOFTWARE. │ +╚─────────────────────────────────────────────────────────────────────────────*/ +#include "libc/calls/calls.h" +#include "libc/errno.h" +#include "libc/runtime/runtime.h" +#include "libc/stdio/stdio.h" +#include "libc/str/str.h" + +/** + * @fileoverview Command for updating timestamps on files. + */ + +int main(int argc, char *argv[]) { + int i; + const char *s, *prog; + prog = argc > 0 ? argv[0] : "touch.com"; + for (i = 1; i < argc; ++i) { + if (touch(argv[i], 0666) == -1) { + s = strerdoc(errno); + fputs(prog, stderr); + fputs(": cannot touch '", stderr); + fputs(argv[i], stderr); + fputs("': ", stderr); + fputs(s, stderr); + fputs("\n", stderr); + exit(1); + } + } + return 0; +} diff --git a/tool/build/unbundle.c b/tool/build/unbundle.c new file mode 100644 index 000000000..7614af4ac --- /dev/null +++ b/tool/build/unbundle.c @@ -0,0 +1,89 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Copyright 2022 Justine Alexandra Roberts Tunney │ +│ │ +│ Permission to use, copy, modify, and/or distribute this software for │ +│ any purpose with or without fee is hereby granted, provided that the │ +│ above copyright notice and this permission notice appear in all copies. │ +│ │ +│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │ +│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │ +│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │ +│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │ +│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │ +│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │ +│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ +│ PERFORMANCE OF THIS SOFTWARE. │ +╚─────────────────────────────────────────────────────────────────────────────*/ +#include "libc/calls/calls.h" +#include "libc/calls/struct/stat.h" +#include "libc/dce.h" +#include "libc/errno.h" +#include "libc/fmt/itoa.h" +#include "libc/runtime/runtime.h" +#include "libc/stdio/stdio.h" +#include "libc/str/str.h" +#include "libc/x/x.h" +#include "third_party/musl/ftw.h" + +const char *prog; +char tmpdir[PATH_MAX]; +char binpath[PATH_MAX]; + +bool IsDirectory(const char *path) { + int e; + bool res; + struct stat st; + e = errno; + res = stat(path, &st) != -1 && S_ISDIR(st.st_mode); + errno = e; + return res; +} + +void Execute(char *argv[]) { + int ws; + if (!vfork()) { + execv(argv[0], argv); + _Exit(127); + } + wait(&ws); + if (!WIFEXITED(ws) || WEXITSTATUS(ws)) { + fputs(argv[0], stderr); + fputs(": command failed\n", stderr); + exit(1); + } +} + +int Visit(const char *fpath, const struct stat *sb, int tflag, + struct FTW *ftwbuf) { + if (tflag == FTW_F && endswith(fpath, ".gz")) { + Execute((char *[]){"build/bootstrap/gzip.com", "-d", fpath, 0}); + strcpy(binpath, fpath); + binpath[strlen(binpath) - 3] = 0; + chmod(binpath, 0755); + } else if (tflag == FTW_F && endswith(fpath, ".sym")) { + strcpy(binpath, fpath); + binpath[strlen(binpath) - 4] = 0; + symlink(xslurp(fpath, 0), binpath); + } + return 0; +} + +int main(int argc, char *argv[]) { + if (!IsLinux()) return 0; + prog = argc > 0 ? argv[0] : "unbundle.com"; + if (IsDirectory("o/third_party/gcc")) return 0; + makedirs("o/third_party", 0755); + FormatInt32(stpcpy(tmpdir, "o/third_party/gcc."), getpid()); + Execute( + (char *[]){"build/bootstrap/cp.com", "-r", "third_party/gcc", tmpdir, 0}); + if (nftw(tmpdir, Visit, 20, 0) == -1) { + fputs(prog, stderr); + fputs(": nftw failed: ", stderr); + fputs(strerdoc(errno), stderr); + fputs("\n", stderr); + exit(1); + } + rename(tmpdir, "o/third_party/gcc"); +} diff --git a/tool/build/zipobj.c b/tool/build/zipobj.c index bdaa29025..1d92c2c1f 100644 --- a/tool/build/zipobj.c +++ b/tool/build/zipobj.c @@ -20,6 +20,7 @@ #include "libc/calls/struct/stat.h" #include "libc/elf/def.h" #include "libc/fmt/conv.h" +#include "libc/intrin/kprintf.h" #include "libc/limits.h" #include "libc/log/check.h" #include "libc/log/log.h" @@ -51,8 +52,8 @@ const char *path_prefix_; struct timespec timestamp; size_t kZipCdirHdrLinkableSizeBootstrap; -wontreturn void PrintUsage(int rc, FILE *f) { - fprintf(f, "%s%s%s\n", "Usage: ", program_invocation_name, +wontreturn void PrintUsage(int rc) { + kprintf("%s%s%s\n", "Usage: ", program_invocation_name, " [-n] [-B] [-C INT] [-P PREFIX] [-o FILE] [-s SYMBOL] [-y YOINK] " "[FILE...]"); exit(rc); @@ -99,9 +100,9 @@ void GetOpts(int *argc, char ***argv) { break; case '?': case 'h': - PrintUsage(EXIT_SUCCESS, stdout); + PrintUsage(EXIT_SUCCESS); default: - PrintUsage(EX_USAGE, stderr); + PrintUsage(EX_USAGE); } } *argc -= optind; @@ -137,7 +138,7 @@ void ProcessFile(struct ElfWriter *elf, const char *path) { if (S_ISDIR(st.st_mode)) { st.st_size = 0; if (!endswith(name, "/")) { - name = gc(xasprintf("%s/", name)); + name = gc(xstrcat(name, '/')); } } elfwriter_zip(elf, name, name, strlen(name), map, st.st_size, st.st_mode, diff --git a/tool/decode/ar.c b/tool/decode/ar.c index f27f3b983..1066ef70a 100644 --- a/tool/decode/ar.c +++ b/tool/decode/ar.c @@ -20,6 +20,7 @@ #include "libc/calls/calls.h" #include "libc/calls/struct/stat.h" #include "libc/fmt/conv.h" +#include "libc/intrin/kprintf.h" #include "libc/log/check.h" #include "libc/log/log.h" #include "libc/mem/mem.h" @@ -50,7 +51,7 @@ static void PrintString(uint8_t *p, long n, const char *name) { s = xmalloc(n + 1); s[n] = '\0'; memcpy(s, p, n); - printf("\t.ascii\t%`'.*s\t\t\t# %s\n", n, s, name); + printf("\t.ascii\t%-`'*.*s# %s\n", 35, n, s, name); free(s); } @@ -94,8 +95,8 @@ static void PrintHeader(uint8_t *p) { static void Print(void) { int arsize; - uint8_t *b, *p; uint64_t offset; + uint8_t *b, *p, *e; uint32_t i, n, o, table, entries, symbols, symbolslen; arsize = atoi((char *)(data + 8 + 48)); CHECK_LE(4, arsize); @@ -107,18 +108,19 @@ static void Print(void) { PrintHeader(data + 8); printf("\n"); - printf("\t.long\t%u\t\t\t# %s\n", entries, "symbol table entries"); + printf("\t.long\t%-*.u# %s\n", 35, entries, "symbol table entries"); table = 8 + 60 + 4; for (i = 0; i < entries; ++i) { - printf("\t.long\t%#x\t\t\t\t# %u\n", READ32BE(data + table + i * 4), i); + printf("\t.long\t%#-*.x# %u\n", 35, READ32BE(data + table + i * 4), i); } symbols = table + entries * 4; - symbolslen = arsize - (4 + entries * 4); + symbolslen = arsize - (entries + 1) * 4; for (i = o = 0; o < symbolslen; ++i, o += n + 1) { b = data + symbols + o; - CHECK_NOTNULL((p = memchr(b, '\0', symbolslen - (symbols + o)))); + CHECK_NOTNULL((p = memchr(b, '\0', symbolslen - o)), "%p %p %p %p %`.s", b, + data, symbols, o, b); n = p - b; - printf("\t.asciz\t%#`'.*s\t\t\t# %u\n", n, b, i); + printf("\t.asciz\t%#-`'*.*s# %u\n", 35, n, b, i); } offset = 8 + 60 + arsize; diff --git a/tool/decode/decode.mk b/tool/decode/decode.mk index 6ecf4d2e0..997b22a79 100644 --- a/tool/decode/decode.mk +++ b/tool/decode/decode.mk @@ -56,7 +56,7 @@ o/$(MODE)/tool/decode/%.com.dbg: \ o/$(MODE)/tool/decode/%.o \ o/$(MODE)/tool/decode/decode.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) $(TOOL_DECODE_OBJS): \ diff --git a/tool/decode/zip.c b/tool/decode/zip.c index 69acdc2c6..c735143b3 100644 --- a/tool/decode/zip.c +++ b/tool/decode/zip.c @@ -57,7 +57,6 @@ dontdiscard char *FormatDosTime(uint16_t dostime) { } void AdvancePosition(uint8_t *map, size_t *pos, size_t off) { - CHECK_GE(off, *pos); if (off > *pos) { printf("\n/\t<%s>\n", "LIMBO"); disassemblehex(&map[*pos], off - *pos, stdout); diff --git a/tool/hash/hash.mk b/tool/hash/hash.mk index 2e7c4628b..456c76c9f 100644 --- a/tool/hash/hash.mk +++ b/tool/hash/hash.mk @@ -37,7 +37,7 @@ o/$(MODE)/tool/hash/%.com.dbg: \ o/$(MODE)/tool/hash/%.o \ o/$(MODE)/tool/hash/hash.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) $(TOOL_HASH_OBJS): \ diff --git a/tool/lambda/lambda.mk b/tool/lambda/lambda.mk index c8cfdcc49..c7ede2705 100644 --- a/tool/lambda/lambda.mk +++ b/tool/lambda/lambda.mk @@ -44,7 +44,7 @@ o/$(MODE)/tool/lambda/%.com.dbg: \ o/$(MODE)/tool/lambda/%.o \ o/$(MODE)/tool/lambda/lambda.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/tool/lambda/tromp.o: \ diff --git a/tool/net/help.txt b/tool/net/help.txt index 5a2630317..dd5430e40 100644 --- a/tool/net/help.txt +++ b/tool/net/help.txt @@ -225,10 +225,16 @@ USAGE Your redbean is an actually portable executable, that's able to run on six different operating systems. To do that, it needs to - overwrite its own MZ header at startup, with ELF or Mach-O, and - then puts the original back once the program loads. If you want - your redbean to follow the platform-local executable convention - then delete the /.ape file from zip. + extract a 4kb loader program to ${TMPDIR:-/tmp}/ape that'll map + your redbean into memory. It does however check to see if `ape` + is on the system path beforehand. You can also "assimilate" any + redbean into the platform-local executable format by running: + + $ file redbean.com + redbean.com: DOS/MBR boot sector + $ ./redbean.com --assimilate + $ file redbean.com + redbean.com: ELF 64-bit LSB executable redbean contains software licensed ISC, MIT, BSD-2, BSD-3, zlib which makes it a permissively licensed gift to anyone who might @@ -331,18 +337,22 @@ REPL #!/usr/bin/redbean -i print('hello world') - However operating systems like Linux usually require that script - interperters be in the local executable format. You can "assimilate" - and install your redbean using the following commands: + However UNIX operating systems usually require that interperters be + encoded in its preferred executable format. You can assimilate your + redbean into the local format using the following commands: - zip -d redbean.com .ape # remove the ape header - ./redbean.com -h >/dev/null # assimilate the binary - sudo cp redbean.com /usr/bin/redbean + $ file redbean.com + redbean.com: DOS/MBR boot sector + $ ./redbean.com --assimilate + $ file redbean.com + redbean.com: ELF 64-bit LSB executable + $ sudo cp redbean.com /usr/bin/redbean By following the above steps, redbean can be installed systemwide for multiple user accounts. It's also possible to chmod the binary to have - setuid privileges, provided it's configured to drop privileges in the - most appropriate manner; see the UNIX section for further details. + setuid privileges. Please note that, if you do this, the UNIX section + provides further details on APIs like `unix.setuid` that will help you + remove root privileges from the process in the appropriate manner. ──────────────────────────────────────────────────────────────────────────────── diff --git a/tool/net/net.mk b/tool/net/net.mk index 6332a72b1..15b075934 100644 --- a/tool/net/net.mk +++ b/tool/net/net.mk @@ -21,7 +21,6 @@ TOOL_NET_COMS = \ o/$(MODE)/tool/net/redbean-static.com \ o/$(MODE)/tool/net/redbean-unsecure.com \ o/$(MODE)/tool/net/redbean-original.com \ - o/$(MODE)/tool/net/redbean-assimilate.com \ o/$(MODE)/tool/net/wb.com TOOL_NET_CHECKS = \ @@ -82,7 +81,7 @@ o/$(MODE)/tool/net/%.com.dbg: \ o/$(MODE)/tool/net/%.o \ o/$(MODE)/tool/net/net.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) # REDBEAN.COM @@ -100,7 +99,7 @@ o/$(MODE)/tool/net/redbean.com.dbg: \ o/$(MODE)/tool/net/largon2.o \ o/$(MODE)/tool/net/net.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) ifneq ($(MODE),tiny) @@ -115,13 +114,11 @@ o/$(MODE)/tool/net/redbean.com: \ tool/net/favicon.ico \ tool/net/redbean.png @$(COMPILE) -AOBJCOPY -T$@ $(OBJCOPY) -S -O binary $< $@ - @$(COMPILE) -AMKDIR -T$@ mkdir -p o/$(MODE)/tool/net/.redbean - @$(COMPILE) -ADD -T$@ dd if=$@ of=o/$(MODE)/tool/net/.redbean/.ape bs=64 count=11 conv=notrunc 2>/dev/null + @$(COMPILE) -AMKDIR -T$@ $(MKDIR) o/$(MODE)/tool/net/.redbean @$(COMPILE) -ASYMTAB o/$(MODE)/tool/build/symtab.com -o o/$(MODE)/tool/net/.redbean/.symtab $< @$(COMPILE) -AZIP -T$@ o/$(MODE)/third_party/zip/zip.com -0qj $@ \ o/$(MODE)/tool/net/.redbean/.symtab @$(COMPILE) -AZIP -T$@ o/$(MODE)/third_party/zip/zip.com -9qj $@ \ - o/$(MODE)/tool/net/.redbean/.ape \ tool/net/help.txt \ tool/net/.init.lua \ tool/net/favicon.ico \ @@ -138,10 +135,8 @@ o/tiny/tool/net/redbean.com: \ tool/net/favicon.ico \ tool/net/redbean.png @$(COMPILE) -AOBJCOPY -T$@ $(OBJCOPY) -S -O binary $< $@ - @$(COMPILE) -AMKDIR -T$@ mkdir -p o/tiny/tool/net/.redbean - @$(COMPILE) -ADD -T$@ dd if=$@ of=o/tiny/tool/net/.redbean/.ape bs=64 count=11 conv=notrunc 2>/dev/null + @$(COMPILE) -AMKDIR -T$@ $(MKDIR) o/tiny/tool/net/.redbean @$(COMPILE) -AZIP -T$@ o/tiny/third_party/zip/zip.com -9qj $@ \ - o/tiny/tool/net/.redbean/.ape \ tool/net/tiny/help.txt \ tool/net/.init.lua \ tool/net/favicon.ico \ @@ -156,10 +151,8 @@ o/tinylinux/tool/net/redbean.com: \ tool/net/favicon.ico \ tool/net/redbean.png @$(COMPILE) -AOBJCOPY -T$@ $(OBJCOPY) -S -O binary $< $@ - @$(COMPILE) -AMKDIR -T$@ mkdir -p o/tinylinux/tool/net/.redbean - @$(COMPILE) -ADD -T$@ dd if=$@ of=o/tinylinux/tool/net/.redbean/.ape bs=64 count=11 conv=notrunc 2>/dev/null + @$(COMPILE) -AMKDIR -T$@ $(MKDIR) o/tinylinux/tool/net/.redbean @$(COMPILE) -AZIP -T$@ o/tinylinux/third_party/zip/zip.com -9qj $@ \ - o/tinylinux/tool/net/.redbean/.ape \ tool/net/tiny/help.txt \ tool/net/.init.lua \ tool/net/favicon.ico \ @@ -255,7 +248,7 @@ o/$(MODE)/tool/net/redbean-demo.com.dbg: \ o/$(MODE)/tool/net/demo/.reload.lua.zip.o \ o/$(MODE)/tool/net/demo/.init.lua.zip.o \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/tool/net/redbean-demo.com: \ @@ -264,14 +257,12 @@ o/$(MODE)/tool/net/redbean-demo.com: \ o/$(MODE)/third_party/zip/zip.com \ tool/net/help.txt @$(COMPILE) -AOBJCOPY -T$@ $(OBJCOPY) -S -O binary $< $@ - @$(COMPILE) -AMKDIR -T$@ mkdir -p o/$(MODE)/tool/net/.redbean-demo - @$(COMPILE) -ADD -T$@ dd if=$@ of=o/$(MODE)/tool/net/.redbean-demo/.ape bs=64 count=11 conv=notrunc 2>/dev/null + @$(COMPILE) -AMKDIR -T$@ $(MKDIR) o/$(MODE)/tool/net/.redbean-demo @$(COMPILE) -ASYMTAB o/$(MODE)/tool/build/symtab.com \ -o o/$(MODE)/tool/net/.redbean-demo/.symtab $< @$(COMPILE) -AZIP -T$@ o/$(MODE)/third_party/zip/zip.com -0qj $@ \ o/$(MODE)/tool/net/.redbean-demo/.symtab @$(COMPILE) -AZIP -T$@ o/$(MODE)/third_party/zip/zip.com -9qj $@ \ - o/$(MODE)/tool/net/.redbean-demo/.ape \ tool/net/help.txt # REDBEAN-STATIC.COM @@ -287,14 +278,12 @@ o/$(MODE)/tool/net/redbean-static.com: \ tool/net/favicon.ico \ tool/net/redbean.png @$(COMPILE) -AOBJCOPY -T$@ $(OBJCOPY) -S -O binary $< $@ - @$(COMPILE) -AMKDIR -T$@ mkdir -p o/$(MODE)/tool/net/.redbean-static - @$(COMPILE) -ADD -T$@ dd if=$@ of=o/$(MODE)/tool/net/.redbean-static/.ape bs=64 count=11 conv=notrunc 2>/dev/null + @$(COMPILE) -AMKDIR -T$@ $(MKDIR) o/$(MODE)/tool/net/.redbean-static @$(COMPILE) -ASYMTAB o/$(MODE)/tool/build/symtab.com \ -o o/$(MODE)/tool/net/.redbean-static/.symtab $< @$(COMPILE) -AZIP -T$@ o/$(MODE)/third_party/zip/zip.com -0qj $@ \ o/$(MODE)/tool/net/.redbean-static/.symtab @$(COMPILE) -AZIP -T$@ o/$(MODE)/third_party/zip/zip.com -9qj $@ \ - o/$(MODE)/tool/net/.redbean-static/.ape \ tool/net/help.txt \ tool/net/favicon.ico \ tool/net/redbean.png @@ -304,7 +293,7 @@ o/$(MODE)/tool/net/redbean-static.com.dbg: \ o/$(MODE)/tool/net/redbean-static.o \ o/$(MODE)/tool/net/net.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/tool/net/redbean-static.o: tool/net/redbean.c o/$(MODE)/tool/net/redbean.o @@ -324,14 +313,12 @@ o/$(MODE)/tool/net/redbean-unsecure.com: \ tool/net/favicon.ico \ tool/net/redbean.png @$(COMPILE) -AOBJCOPY -T$@ $(OBJCOPY) -S -O binary $< $@ - @$(COMPILE) -AMKDIR -T$@ mkdir -p o/$(MODE)/tool/net/.redbean-unsecure - @$(COMPILE) -ADD -T$@ dd if=$@ of=o/$(MODE)/tool/net/.redbean-unsecure/.ape bs=64 count=11 conv=notrunc 2>/dev/null + @$(COMPILE) -AMKDIR -T$@ $(MKDIR) o/$(MODE)/tool/net/.redbean-unsecure @$(COMPILE) -ASYMTAB o/$(MODE)/tool/build/symtab.com \ -o o/$(MODE)/tool/net/.redbean-unsecure/.symtab $< @$(COMPILE) -AZIP -T$@ o/$(MODE)/third_party/zip/zip.com -0qj $@ \ o/$(MODE)/tool/net/.redbean-unsecure/.symtab @$(COMPILE) -AZIP -T$@ o/$(MODE)/third_party/zip/zip.com -9qj $@ \ - o/$(MODE)/tool/net/.redbean-unsecure/.ape \ tool/net/help.txt \ tool/net/favicon.ico \ tool/net/redbean.png @@ -346,7 +333,7 @@ o/$(MODE)/tool/net/redbean-unsecure.com.dbg: \ o/$(MODE)/tool/net/lsqlite3.o \ o/$(MODE)/tool/net/net.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/tool/net/redbean-unsecure.o: tool/net/redbean.c o/$(MODE)/tool/net/redbean.o @@ -368,14 +355,12 @@ o/$(MODE)/tool/net/redbean-original.com: \ tool/net/favicon.ico \ tool/net/redbean.png @$(COMPILE) -AOBJCOPY -T$@ $(OBJCOPY) -S -O binary $< $@ - @$(COMPILE) -AMKDIR -T$@ mkdir -p o/$(MODE)/tool/net/.redbean-original - @$(COMPILE) -ADD -T$@ dd if=$@ of=o/$(MODE)/tool/net/.redbean-original/.ape bs=64 count=11 conv=notrunc 2>/dev/null + @$(COMPILE) -AMKDIR -T$@ $(MKDIR) o/$(MODE)/tool/net/.redbean-original @$(COMPILE) -ASYMTAB o/$(MODE)/tool/build/symtab.com \ -o o/$(MODE)/tool/net/.redbean-original/.symtab $< @$(COMPILE) -AZIP -T$@ o/$(MODE)/third_party/zip/zip.com -0qj $@ \ o/$(MODE)/tool/net/.redbean-original/.symtab @$(COMPILE) -AZIP -T$@ o/$(MODE)/third_party/zip/zip.com -9qj $@ \ - o/$(MODE)/tool/net/.redbean-original/.ape \ tool/net/help.txt \ tool/net/favicon.ico \ tool/net/redbean.png @@ -389,10 +374,8 @@ o/tiny/tool/net/redbean-original.com: \ tool/net/favicon.ico \ tool/net/redbean.png @$(COMPILE) -AOBJCOPY -T$@ $(OBJCOPY) -S -O binary $< $@ - @$(COMPILE) -AMKDIR -T$@ mkdir -p o/tiny/tool/net/.redbean-original - @$(COMPILE) -ADD -T$@ dd if=$@ of=o/tiny/tool/net/.redbean-original/.ape bs=64 count=11 conv=notrunc 2>/dev/null + @$(COMPILE) -AMKDIR -T$@ $(MKDIR) o/tiny/tool/net/.redbean-original @$(COMPILE) -AZIP -T$@ o/tiny/third_party/zip/zip.com -9qj $@ \ - o/tiny/tool/net/.redbean-original/.ape \ tool/net/tiny/help.txt \ tool/net/favicon.ico \ tool/net/redbean.png @@ -404,10 +387,8 @@ o/tinylinux/tool/net/redbean-original.com: \ tool/net/favicon.ico \ tool/net/redbean.png @$(COMPILE) -AOBJCOPY -T$@ $(OBJCOPY) -S -O binary $< $@ - @$(COMPILE) -AMKDIR -T$@ mkdir -p o/tinylinux/tool/net/.redbean-original - @$(COMPILE) -ADD -T$@ dd if=$@ of=o/tinylinux/tool/net/.redbean-original/.ape bs=64 count=11 conv=notrunc 2>/dev/null + @$(COMPILE) -AMKDIR -T$@ $(MKDIR) o/tinylinux/tool/net/.redbean-original @$(COMPILE) -AZIP -T$@ o/tinylinux/third_party/zip/zip.com -9qj $@ \ - o/tinylinux/tool/net/.redbean-original/.ape \ tool/net/tiny/help.txt \ tool/net/favicon.ico \ tool/net/redbean.png @@ -417,7 +398,7 @@ o/$(MODE)/tool/net/redbean-original.com.dbg: \ o/$(MODE)/tool/net/redbean-original.o \ o/$(MODE)/tool/net/net.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/tool/net/redbean-original.o: tool/net/redbean.c o/$(MODE)/tool/net/redbean.o @@ -426,35 +407,6 @@ o/$(MODE)/tool/net/redbean-original.o: tool/net/redbean.c o/$(MODE)/tool/net/red o/$(MODE)/tool/net/redbean-original.s: tool/net/redbean.c o/$(MODE)/tool/net/redbean.o @$(COMPILE) -AOBJECTIFY.c $(COMPILE.c) -DSTATIC -DUNSECURE -DREDBEAN=\"redbean-original\" $(OUTPUT_OPTION) $< -# REDBEAN-ASSIMILATE.COM -# -# Same as REDBEAN.COM except without no-modify-self behavior. - -o/$(MODE)/tool/net/redbean-assimilate.com.dbg: \ - o/$(MODE)/tool/net/redbean.com.dbg - @cp -f $< $@ - -o/$(MODE)/tool/net/redbean-assimilate.com: \ - o/$(MODE)/tool/net/redbean-assimilate.com.dbg \ - o/$(MODE)/third_party/zip/zip.com \ - o/$(MODE)/tool/build/symtab.com \ - tool/net/net.mk \ - tool/net/help.txt \ - tool/net/.init.lua \ - tool/net/favicon.ico \ - tool/net/redbean.png - @$(COMPILE) -AOBJCOPY -T$@ $(OBJCOPY) -S -O binary $< $@ - @$(COMPILE) -AMKDIR -T$@ mkdir -p o/$(MODE)/tool/net/.redbean-assimilate - @$(COMPILE) -ASYMTAB o/$(MODE)/tool/build/symtab.com -o o/$(MODE)/tool/net/.redbean-assimilate/.symtab $< - @$(COMPILE) -AZIP -T$@ o/$(MODE)/third_party/zip/zip.com -0qj $@ \ - o/$(MODE)/tool/net/.redbean-assimilate/.symtab - @$(COMPILE) -AZIP -T$@ o/$(MODE)/third_party/zip/zip.com -9qj $@ \ - o/$(MODE)/tool/net/.redbean-assimilate/.symtab \ - tool/net/help.txt \ - tool/net/.init.lua \ - tool/net/favicon.ico \ - tool/net/redbean.png - .PHONY: o/$(MODE)/tool/net o/$(MODE)/tool/net: \ $(TOOL_NET_BINS) \ diff --git a/tool/net/redbean.c b/tool/net/redbean.c index 03967ce58..105130002 100644 --- a/tool/net/redbean.c +++ b/tool/net/redbean.c @@ -6735,31 +6735,24 @@ static int HandleConnection(size_t i) { return rc; } -static void RestoreApe(void) { +static void MakeExecutableModifiable(void) { int ft; - char *p; size_t n; - struct Asset *a; extern char ape_rom_vaddr[] __attribute__((__weak__)); if (!(SUPPORT_VECTOR & (METAL | WINDOWS | XNU))) return; if (IsWindows()) return; // TODO if (IsOpenbsd()) return; // TODO if (IsNetbsd()) return; // TODO if (endswith(zpath, ".com.dbg")) return; - if ((a = GetAssetZip("/.ape", 5)) && (p = LoadAsset(a, &n))) { - close(zfd); - ft = __ftrace; - if ((zfd = OpenExecutable()) == -1 || WRITE(zfd, p, n) == -1) { - WARNF("(srvr) can't restore .ape"); - } - if (ft > 0) { - __ftrace = 0; - ftrace_install(); - __ftrace = ft; - } - free(p); - } else { - DEBUGF("(srvr) /.ape not found"); + close(zfd); + ft = __ftrace; + if ((zfd = OpenExecutable()) == -1) { + WARNF("(srvr) can't restore .ape"); + } + if (ft > 0) { + __ftrace = 0; + ftrace_install(); + __ftrace = ft; } } @@ -7209,7 +7202,7 @@ void RedBean(int argc, char *argv[]) { CHECK_NE(-1, (zfd = open(zpath, O_RDONLY))); CHECK_NE(-1, fstat(zfd, &zst)); OpenZip(true); - RestoreApe(); + MakeExecutableModifiable(); SetDefaults(); LuaStart(); GetOpts(argc, argv); diff --git a/tool/plinko/plinko.mk b/tool/plinko/plinko.mk index f841c1c40..21684cb10 100644 --- a/tool/plinko/plinko.mk +++ b/tool/plinko/plinko.mk @@ -43,7 +43,7 @@ o/$(MODE)/tool/plinko/%.com.dbg: \ o/$(MODE)/tool/plinko/plinko.pkg \ o/$(MODE)/tool/plinko/lib/library.lisp.zip.o \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) .PRECIOUS: o/$(MODE)/tool/plinko/plinko.com @@ -53,7 +53,7 @@ o/$(MODE)/tool/plinko/plinko.com: \ o/$(MODE)/tool/build/symtab.com \ tool/plinko/plinko.mk @$(COMPILE) -AOBJCOPY -T$@ $(OBJCOPY) -S -O binary $< $@ - @$(COMPILE) -AMKDIR -T$@ mkdir -p o/$(MODE)/tool/plinko/.redbean + @$(COMPILE) -AMKDIR -T$@ $(MKDIR) o/$(MODE)/tool/plinko/.redbean @$(COMPILE) -ASYMTAB o/$(MODE)/tool/build/symtab.com -o o/$(MODE)/tool/plinko/.plinko/.symtab $< @$(COMPILE) -AZIP -T$@ o/$(MODE)/third_party/zip/zip.com -0qj $@ \ o/$(MODE)/tool/plinko/.plinko/.symtab diff --git a/tool/viz/viz.mk b/tool/viz/viz.mk index 744f644f8..17861744c 100644 --- a/tool/viz/viz.mk +++ b/tool/viz/viz.mk @@ -69,7 +69,7 @@ o/$(MODE)/tool/viz/%.com.dbg: \ o/$(MODE)/tool/viz/%.o \ o/$(MODE)/tool/viz/viz.pkg \ $(CRT) \ - $(APE) + $(APE_NO_MODIFY_SELF) @$(APELINK) o/$(MODE)/tool/viz/printimage.com.dbg: \