mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-01-31 03:27:39 +00:00
Update cosmocc to use superconfigure z0.0.23
This commit is contained in:
parent
43de12db55
commit
03de761890
4 changed files with 71 additions and 5 deletions
6
Makefile
6
Makefile
|
@ -93,7 +93,7 @@ endif
|
|||
ifeq ($(TOOLCHAIN),) # if TOOLCHAIN isn't defined
|
||||
ifeq ("$(wildcard o/third_party/gcc/bin/x86_64-linux-cosmo-*)","") # if our gcc isn't unbundled
|
||||
ifneq ($(UNAME_M)-$(UNAME_S), x86_64-Linux) # if this is not amd64 linux
|
||||
$(error you need to download https://cosmo.zip/pub/cosmocc/cosmocc-0.0.18.zip and unzip it inside the cosmo directory)
|
||||
$(error please run tool/cosmocc/fetch.sh)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
@ -123,7 +123,9 @@ o/$(MODE): \
|
|||
o/$(MODE)/examples \
|
||||
o/$(MODE)/third_party
|
||||
|
||||
.PHONY: o/$(MODE)/.
|
||||
# TODO(jart): Make Emacs `C-c C-c` shortcut not need this.
|
||||
.PHONY: o/$(MODE)/ o/$(MODE)/.
|
||||
o/$(MODE)/: o/$(MODE)
|
||||
o/$(MODE)/.: o/$(MODE)
|
||||
|
||||
# check if we're using o//third_party/make/make.com
|
||||
|
|
|
@ -273,7 +273,7 @@ statements instead, so that Cosmopolitan Libc's system constants will
|
|||
work as expected. Our modifications to GNU GCC are published under the
|
||||
ISC license at <https://github.com/ahgamut/gcc/tree/portcosmo-11.2>. The
|
||||
binaries you see here were first published at
|
||||
<https://github.com/ahgamut/superconfigure/releases/tag/z0.0.18> which
|
||||
<https://github.com/ahgamut/superconfigure/releases/tag/z0.0.23> which
|
||||
is regularly updated.
|
||||
|
||||
## Legal
|
||||
|
|
64
tool/cosmocc/fetch.sh
Executable file
64
tool/cosmocc/fetch.sh
Executable file
|
@ -0,0 +1,64 @@
|
|||
#!/bin/sh
|
||||
# tool/cosmocc/fetch.sh
|
||||
# sets up mono repo to use latest cosmocc toolchain
|
||||
|
||||
URL=https://cosmo.zip/pub/cosmocc/cosmocc.zip
|
||||
|
||||
echo creating o/third_party/gcc... >&2
|
||||
rm -rf o/third_party/gcc || exit
|
||||
mkdir -p o/third_party/gcc || exit
|
||||
cd o/third_party/gcc
|
||||
|
||||
echo downloading $URL... >&2
|
||||
if command -v wget >/dev/null; then
|
||||
wget $URL || exit
|
||||
else
|
||||
curl -Lo cosmocc.zip $URL || exit
|
||||
fi
|
||||
|
||||
echo extracting cosmocc.zip... >&2
|
||||
unzip cosmocc.zip || exit
|
||||
rm -f cosmocc.zip
|
||||
|
||||
# report success and give tips
|
||||
cat <<'EOF' >&2
|
||||
|
||||
SUCCESS
|
||||
|
||||
the cosmo mono repo will now build using cosmocc
|
||||
|
||||
WARNING
|
||||
|
||||
if you run `make clean` then you'll have to download it again
|
||||
|
||||
CONSIDER
|
||||
|
||||
you can install the cosmocc toolchain you just downloaded as follows
|
||||
|
||||
sudo chmod 01777 /opt
|
||||
rm -rf /opt/cosmocc
|
||||
mv o/third_party/gcc /opt/cosmocc
|
||||
ln -sf /opt/cosmocc o/third_party/gcc
|
||||
echo 'export PATH="/opt/cosmocc/bin:$PATH"' >>~/.profile
|
||||
|
||||
then just recreate the symlink after cleaning. please note that you
|
||||
should NEVER need to use make clean with the cosmo mono repo, since
|
||||
our Makefile is flawless. if make clean actually helps, file a bug.
|
||||
|
||||
EOF
|
||||
|
||||
# give tip to linux users
|
||||
if [ x"$(uname -s)" = x"Linux" ]; then
|
||||
cat <<'EOF' >&2
|
||||
PROTIP
|
||||
|
||||
running these commands
|
||||
|
||||
rm -rf o
|
||||
sudo mount -t tmpfs -o size=10G,noatime,nodiratime /dev/shm o
|
||||
ln -sf /opt/cosmocc o/third_party/gcc
|
||||
|
||||
makes the mono repo build faster
|
||||
|
||||
EOF
|
||||
fi
|
|
@ -71,10 +71,10 @@ done
|
|||
OLD=$PWD
|
||||
cd "$OUTDIR/"
|
||||
if [ ! -x bin/x86_64-linux-cosmo-gcc ]; then
|
||||
wget https://github.com/ahgamut/superconfigure/releases/download/z0.0.19/aarch64-gcc.zip
|
||||
wget https://github.com/ahgamut/superconfigure/releases/download/z0.0.23/aarch64-gcc.zip
|
||||
unzip aarch64-gcc.zip
|
||||
rm -f aarch64-gcc.zip
|
||||
wget https://github.com/ahgamut/superconfigure/releases/download/z0.0.19/x86_64-gcc.zip
|
||||
wget https://github.com/ahgamut/superconfigure/releases/download/z0.0.23/x86_64-gcc.zip
|
||||
unzip x86_64-gcc.zip
|
||||
rm -f x86_64-gcc.zip
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue