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

View file

@ -9,7 +9,7 @@ fatal_error() {
exit 1
}
if [ ! -x "$COSMO/o/$MODE/tool/build/ar.com" ]; then
if [ ! -x "$COSMO/o//tool/build/ar.com" ]; then
fatal_error "you need to run: fatcosmocc --update"
fi
@ -24,8 +24,8 @@ if [ x"$1" = x"rc" ] ||
# binutils ar is accidentally quadratic
# cosmopolitan ar is significantly faster
# it'll also use tricks like copy_file_range
AR_X86_64="$COSMO/o/$MODE/tool/build/ar.com"
AR_AARCH64="$COSMO/o/$MODE/tool/build/ar.com"
AR_X86_64="$COSMO/o//tool/build/ar.com"
AR_AARCH64="$COSMO/o//tool/build/ar.com"
if [ "$1" = "--help" ] ||
[ "$1" = "--version" ]; then
exec "$AR_X86_64" "$1"