Further improve fatcosmocc

This commit is contained in:
Justine Tunney 2023-08-13 01:44:39 -07:00
parent 3f2f0e3a74
commit ab9a284640
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
39 changed files with 96 additions and 28 deletions

View file

@ -42,7 +42,8 @@ for x; do
set -- "$@" "$x"
done
if [ x"$OPT" != x"-Os" ] && [ x"${MODE#aarch64-tiny}" != x"${MODE}" ]; then
if [ x"$OPT" != x"-Os" ] && # $OPT != -Os
[ x"${MODE%tiny}" = x"${MODE}" ]; then # $MODE not in (tiny, aarch64-tiny)
# support --ftrace unless optimizing for size
CCFLAGS="$CCFLAGS -fpatchable-function-entry=7,6"
fi

View file

@ -4,7 +4,7 @@
CC="$COSMO/o/third_party/gcc/bin/x86_64-linux-musl-gcc"
CFLAGS="-mno-tls-direct-seg-refs -mno-red-zone"
LDFLAGS="-static -nostdlib -no-pie -Wl,-melf_x86_64 -Wl,-z,common-page-size=4096 -Wl,-z,max-page-size=4096 -fuse-ld=bfd"
APEFLAGS="-L$COSMOS/lib -Wl,--gc-sections -Wl,-T,$COSMO/o/$MODE/ape/public/ape.lds $COSMO/o/$MODE/ape/ape.o"
APEFLAGS="-L$COSMOS/lib -Wl,--gc-sections -Wl,-T,$COSMO/o/$MODE/ape/public/ape.lds"
LDLIBS="$COSMO/o/$MODE/cosmopolitan.a"
if [ x"$PROG" != x"${PROG%++}" ]; then
@ -44,7 +44,8 @@ if [ x"$MODE" = x"nox87" ]; then
CFLAGS="$CFLAGS -mlong-double-64"
fi
if [ x"$OPT" != x"-Os" ] && [ x"${MODE#tiny}" != x"${MODE}" ]; then
if [ x"$OPT" != x"-Os" ] && # $OPT != -Os
[ x"${MODE%tiny}" = x"${MODE}" ]; then # $MODE not in (tiny, aarch64-tiny)
# support --ftrace unless optimizing for size
CFLAGS="$CFLAGS -fpatchable-function-entry=18,16"
fi
@ -57,6 +58,7 @@ if [ $INTENT = cc ]; then
else
set -- \
"$CC" \
"$COSMO/o/$MODE/ape/ape.o" \
"$COSMO/o/$MODE/libc/crt/crt.o" \
"$@" \
$LDFLAGS \