Fix the cosmocc ar commands

This commit is contained in:
Justine Tunney 2023-08-14 20:12:51 -07:00
parent f5b39e9f31
commit b494d56549
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
4 changed files with 19 additions and 64 deletions

View file

@ -1082,8 +1082,8 @@ ape_pe: .ascin "PE",4
.long 0 // Checksum
.short v_ntsubsystem // Subsystem: 0=Neutral,2=GUI,3=Console
.short v_ntdllchar // DllCharacteristics
.quad 8 * 1024 * 1024 // StackReserve
.quad 64 * 1024 // StackCommit
.quad 0x30000 // StackReserve
.quad 0x30000 // StackCommit
.quad 0 // HeapReserve
.quad 0 // HeapCommit
.long 0 // LoaderFlags

View file

@ -9,21 +9,8 @@ fatal_error() {
exit 1
}
if [ ! -x "$COSMO/o//tool/build/ar.com" ]; then
if [ ! -x "$COSMO/o/third_party/gcc/bin/aarch64-linux-musl-ar" ]; 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" "$@"
exec "$COSMO/o/third_party/gcc/bin/aarch64-linux-musl-ar" "$@"

View file

@ -9,47 +9,28 @@ fatal_error() {
exit 1
}
if [ ! -x "$COSMO/o//tool/build/ar.com" ]; then
if [ ! -x "$COSMO/o/third_party/gcc/bin/x86_64-linux-musl-ar" ]; then
fatal_error "you need to run: fatcosmocc --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
# binutils ar is accidentally quadratic
# cosmopolitan ar is significantly faster
# it'll also use tricks like copy_file_range
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"
fi
else
AR_X86_64="$COSMO/o/third_party/gcc/bin/x86_64-linux-musl-ar"
AR_AARCH64="$COSMO/o/third_party/gcc/bin/aarch64-linux-musl-ar"
if [ "$1" = "--version" ]; then
# note: only the underlying gnu compiler binaries are gpl
# our shell script is released with the isc license
cat <<EOF
AR_X86_64="$COSMO/o/third_party/gcc/bin/x86_64-linux-musl-ar"
AR_AARCH64="$COSMO/o/third_party/gcc/bin/aarch64-linux-musl-ar"
if [ "$1" = "--version" ]; then
# note: only the underlying gnu compiler binaries are gpl
# our shell script is released with the isc license
cat <<EOF
$PROG (GNU Binutils) 2.38
Copyright (C) 2022 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.
EOF
exit 0
elif [ "$1" = "--help" ]; then
"$AR_X86_64" --help |
sed "s!$AR_X86_64!$PROG!g" 2>/dev/null ||
"$AR_X86_64" --help
exit
fi
exit 0
elif [ "$1" = "--help" ]; then
"$AR_X86_64" --help |
sed "s!$AR_X86_64!$PROG!g" 2>/dev/null ||
"$AR_X86_64" --help
exit
fi
FIRST=1

View file

@ -9,21 +9,8 @@ fatal_error() {
exit 1
}
if [ ! -x "$COSMO/o/$MODE/tool/build/ar.com" ]; then
if [ ! -x "$COSMO/o/third_party/gcc/bin/x86_64-linux-musl-ar" ]; then
fatal_error "you need to run: x86_64-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/$MODE/tool/build/ar.com"
else
AR="$COSMO/o/third_party/gcc/bin/x86_64-linux-musl-ar"
fi
exec "$AR" "$@"
exec "$COSMO/o/third_party/gcc/bin/x86_64-linux-musl-ar" "$@"