Make cosmocc capable of cross compilation

This commit is contained in:
Justine Tunney 2023-08-13 14:38:33 -07:00
parent 504a4bbf84
commit d1b937bf1d
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
21 changed files with 439 additions and 132 deletions

29
bin/aarch64-unknown-cosmo-ar Executable file
View file

@ -0,0 +1,29 @@
#!/bin/sh
PROG=${0##*/}
MODE=${MODE:-${m:-aarch64}}
COSMO=${COSMO:-/opt/cosmo}
fatal_error() {
echo "$PROG: $1" >&2
exit 1
}
if [ ! -x "$COSMO/o//tool/build/ar.com" ]; then
fatal_error "you need to run: aarch64-unknown-cosmo-cc --update"
fi
if [ x"$1" = x"rc" ] ||
[ x"$1" = x"rcD" ] ||
[ x"$1" = x"rcu" ] |
[ x"$1" = x"rcuD" ] ||
[ x"$1" = x"rcs" ] ||
[ x"$1" = x"rcsD" ] ||
[ x"$1" = x"--help" ] ||
[ x"$1" = x"--version" ]; then
AR="$COSMO/o//tool/build/ar.com"
else
AR="$COSMO/o/third_party/gcc/bin/aarch64-linux-musl-ar"
fi
exec "$AR" "$@"