diff --git a/Makefile b/Makefile index b6d080060..b70197109 100644 --- a/Makefile +++ b/Makefile @@ -101,19 +101,20 @@ XARGS ?= xargs -P4 -rs8000 DOT ?= dot CLANG = clang TMPDIR = o/tmp -AR = build/bootstrap/ar -CP = build/bootstrap/cp -RM = build/bootstrap/rm -f -GZIP = build/bootstrap/gzip -ECHO = build/bootstrap/echo -CHMOD = build/bootstrap/chmod -TOUCH = build/bootstrap/touch -PKG = build/bootstrap/package -MKDEPS = build/bootstrap/mkdeps -ZIPOBJ = build/bootstrap/zipobj -ZIPCOPY = build/bootstrap/zipcopy -PECHECK = build/bootstrap/pecheck -FIXUPOBJ = build/bootstrap/fixupobj +AR = $(BOOTSTRAP)/ar.ape +CP = $(BOOTSTRAP)/cp.ape +RM = $(BOOTSTRAP)/rm.ape -f +GZIP = $(BOOTSTRAP)/gzip.ape +ECHO = $(BOOTSTRAP)/echo.ape +CHMOD = $(BOOTSTRAP)/chmod.ape +TOUCH = $(BOOTSTRAP)/touch.ape +PKG = $(BOOTSTRAP)/package.ape +MKDEPS = $(BOOTSTRAP)/mkdeps +ZIPOBJ = $(BOOTSTRAP)/zipobj +ZIPCOPY = $(BOOTSTRAP)/zipcopy +PECHECK = $(BOOTSTRAP)/pecheck +FIXUPOBJ = $(BOOTSTRAP)/fixupobj +OBJBINCOPY = $(BOOTSTRAP)/objbincopy MKDIR = build/bootstrap/mkdir -p COMPILE = build/bootstrap/compile -V9 -M2048m -P8192 $(QUOTA) @@ -149,9 +150,10 @@ export MODE export SOURCE_DATE_EPOCH export TMPDIR -COSMOCC = .cosmocc/3.3.5 +COSMOCC = .cosmocc/3.5.7 +BOOTSTRAP = $(COSMOCC)/bin TOOLCHAIN = $(COSMOCC)/bin/$(ARCH)-linux-cosmo- -DOWNLOAD := $(shell build/download-cosmocc.sh $(COSMOCC) 3.3.5 db78fd8d3f8706e9dff4be72bf71d37a3f12062f212f407e1c33bc4af3780dd0) +DOWNLOAD := $(shell build/download-cosmocc.sh $(COSMOCC) 3.5.7 596876951b62ad2530c63afc40edd805d751fcb2416e544d249af04ad00bb4ed) AS = $(TOOLCHAIN)as CC = $(TOOLCHAIN)gcc diff --git a/ape/BUILD.mk b/ape/BUILD.mk index 3bbf00e60..25542e0d5 100644 --- a/ape/BUILD.mk +++ b/ape/BUILD.mk @@ -218,10 +218,10 @@ o/$(MODE)/ape/loader-xnu-clang.asm: ape/loader.c @$(COMPILE) -AOBJECTIFY.c $(CLANG) -DSUPPORT_VECTOR=8 -S -g0 $(APE_LOADER_FLAGS) o/$(MODE)/ape/ape.elf: o/$(MODE)/ape/ape.elf.dbg - @$(COMPILE) -AOBJBINCOPY -w build/bootstrap/objbincopy -f -o $@ $< + @$(COMPILE) -AOBJBINCOPY -w $(OBJBINCOPY) -f -o $@ $< o/$(MODE)/ape/ape.macho: o/$(MODE)/ape/ape.elf.dbg - @$(COMPILE) -AOBJBINCOPY -w build/bootstrap/objbincopy -fm -o $@ $< + @$(COMPILE) -AOBJBINCOPY -w $(OBJBINCOPY) -fm -o $@ $< APE_LOADER_LDFLAGS = \ -static \ diff --git a/build/bootstrap/ar b/build/bootstrap/ar deleted file mode 100755 index 0a671a3b1..000000000 Binary files a/build/bootstrap/ar and /dev/null differ diff --git a/build/bootstrap/chmod b/build/bootstrap/chmod deleted file mode 100755 index e42818495..000000000 Binary files a/build/bootstrap/chmod and /dev/null differ diff --git a/build/bootstrap/cp b/build/bootstrap/cp deleted file mode 100755 index de2d52a67..000000000 Binary files a/build/bootstrap/cp and /dev/null differ diff --git a/build/bootstrap/echo b/build/bootstrap/echo deleted file mode 100755 index 6ce62f8bd..000000000 Binary files a/build/bootstrap/echo and /dev/null differ diff --git a/build/bootstrap/fixupobj b/build/bootstrap/fixupobj deleted file mode 100755 index b59b55a5b..000000000 Binary files a/build/bootstrap/fixupobj and /dev/null differ diff --git a/build/bootstrap/gzip b/build/bootstrap/gzip deleted file mode 100755 index 09bd2306b..000000000 Binary files a/build/bootstrap/gzip and /dev/null differ diff --git a/build/bootstrap/mkdeps b/build/bootstrap/mkdeps deleted file mode 100755 index 30b5e5f06..000000000 Binary files a/build/bootstrap/mkdeps and /dev/null differ diff --git a/build/bootstrap/objbincopy b/build/bootstrap/objbincopy deleted file mode 100755 index 8cce21b7c..000000000 Binary files a/build/bootstrap/objbincopy and /dev/null differ diff --git a/build/bootstrap/package b/build/bootstrap/package deleted file mode 100755 index 1c7db4131..000000000 Binary files a/build/bootstrap/package and /dev/null differ diff --git a/build/bootstrap/pecheck b/build/bootstrap/pecheck deleted file mode 100755 index 6536a79bf..000000000 Binary files a/build/bootstrap/pecheck and /dev/null differ diff --git a/build/bootstrap/rm b/build/bootstrap/rm deleted file mode 100755 index 85f08d8b8..000000000 Binary files a/build/bootstrap/rm and /dev/null differ diff --git a/build/bootstrap/touch b/build/bootstrap/touch deleted file mode 100755 index 7b6bc4943..000000000 Binary files a/build/bootstrap/touch and /dev/null differ diff --git a/build/bootstrap/zipcopy b/build/bootstrap/zipcopy deleted file mode 100755 index 8023194c7..000000000 Binary files a/build/bootstrap/zipcopy and /dev/null differ diff --git a/build/bootstrap/zipobj b/build/bootstrap/zipobj deleted file mode 100755 index 019751ea1..000000000 Binary files a/build/bootstrap/zipobj and /dev/null differ diff --git a/build/sanitycheck b/build/sanitycheck index 7808571f4..2ed283ee5 100755 --- a/build/sanitycheck +++ b/build/sanitycheck @@ -31,7 +31,7 @@ if [ ! -f /proc/sys/fs/binfmt_misc/status ]; then exit 0 fi -if ! build/bootstrap/echo.com -n; then +if ! build/bootstrap/echo -n; then cat <<'EOF' >&2 ERROR diff --git a/test/libc/mem/BUILD.mk b/test/libc/mem/BUILD.mk index 44385da00..ec48d8263 100644 --- a/test/libc/mem/BUILD.mk +++ b/test/libc/mem/BUILD.mk @@ -85,7 +85,7 @@ o/$(MODE)/test/libc/mem/prog/life.elf: \ o/$(MODE)/tool/build/assimilate \ o/$(MODE)/test/libc/mem/prog/life @$(COMPILE) -wACP -T$@ \ - build/bootstrap/cp \ + $(CP) \ o/$(MODE)/test/libc/mem/prog/life \ o/$(MODE)/test/libc/mem/prog/life.elf @$(COMPILE) -wAASSIMILATE -T$@ \ @@ -116,7 +116,7 @@ o/$(MODE)/test/libc/mem/prog/sock.elf: \ o/$(MODE)/tool/build/assimilate \ o/$(MODE)/test/libc/mem/prog/sock @$(COMPILE) -wACP -T$@ \ - build/bootstrap/cp \ + $(CP) \ o/$(MODE)/test/libc/mem/prog/sock \ o/$(MODE)/test/libc/mem/prog/sock.elf @$(COMPILE) -wAASSIMILATE -T$@ \ diff --git a/tool/cosmocc/package.sh b/tool/cosmocc/package.sh index 0ad1fc091..2b97b477c 100755 --- a/tool/cosmocc/package.sh +++ b/tool/cosmocc/package.sh @@ -88,6 +88,7 @@ make -j64 m=$ARM64 \ o/$ARM64/tool/build/package.dbg \ o/$ARM64/tool/build/rm.dbg \ o/$ARM64/tool/build/touch.dbg \ + o/$ARM64/tool/build/mkdir.dbg \ o/$ARM64/tool/build/sha256sum.dbg \ o/$ARM64/tool/build/resymbol.dbg \ o/$ARM64/third_party/make/make.dbg \ @@ -174,7 +175,8 @@ cp -f o/$AMD64/ape/ape.macho "$OUTDIR/bin/ape-x86_64.macho" cp -f o/$ARM64/ape/ape.elf "$OUTDIR/bin/ape-aarch64.elf" for x in assimilate march-native mktemper fixupobj zipcopy apelink pecheck mkdeps zipobj \ - ar chmod cocmd cp echo gzip objbincopy package rm touch sha256sum resymbol; do + ar chmod cocmd cp echo gzip objbincopy package rm touch mkdir compile sha256sum \ + resymbol; do ape $APELINK \ -l o/$AMD64/ape/ape.elf \ -l o/$ARM64/ape/ape.elf \ @@ -184,7 +186,7 @@ for x in assimilate march-native mktemper fixupobj zipcopy apelink pecheck mkdep o/$ARM64/tool/build/$x.dbg done -for x in ar chmod cp echo gzip package rm touch sha256sum; do +for x in ar chmod cp echo gzip package rm touch mkdir compile sha256sum; do mv "$OUTDIR/bin/$x" "$OUTDIR/bin/$x.ape" done