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,28 +9,10 @@ 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
@ -50,7 +32,6 @@ EOF
"$AR_X86_64" --help
exit
fi
fi
FIRST=1
STATE=0

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" "$@"