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

@ -36,6 +36,7 @@
#include "libc/sysv/consts/o.h"
#include "libc/sysv/consts/prot.h"
#include "third_party/getopt/getopt.internal.h"
#include "libc/errno.h"
#include "third_party/regex/regex.h"
#define VERSION \

View file

@ -24,6 +24,7 @@
#include "libc/str/str.h"
#include "libc/sysv/consts/ex.h"
#include "libc/sysv/consts/exit.h"
#include "libc/errno.h"
#include "third_party/getopt/getopt.internal.h"
#define USAGE \

View file

@ -22,6 +22,7 @@
#include "libc/stdio/rand.h"
#include "libc/stdio/stdio.h"
#include "libc/str/str.h"
#include "libc/errno.h"
#include "libc/sysv/consts/o.h"
/**

View file

@ -40,6 +40,7 @@
#include "libc/zip.internal.h"
#include "third_party/getopt/getopt.internal.h"
#include "tool/build/lib/elfwriter.h"
#include "libc/errno.h"
#include "tool/build/lib/stripcomponents.h"
char *name_;

View file

@ -17,6 +17,7 @@
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/calls/calls.h"
#include "libc/errno.h"
#include "libc/fmt/conv.h"
#include "libc/intrin/safemacros.internal.h"
#include "libc/log/check.h"

View file

@ -16,6 +16,7 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/errno.h"
#include "libc/fmt/fmt.h"
#include "libc/intrin/safemacros.internal.h"
#include "libc/log/check.h"

View file

@ -16,6 +16,7 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/errno.h"
#include "libc/intrin/bits.h"
#include "libc/macros.internal.h"
#include "libc/runtime/runtime.h"

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 \

View file

@ -17,6 +17,7 @@
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/calls/calls.h"
#include "libc/errno.h"
#include "libc/log/log.h"
#include "libc/runtime/runtime.h"
#include "libc/stdio/stdio.h"

View file

@ -16,6 +16,7 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/errno.h"
#include "libc/fmt/fmt.h"
#include "libc/log/check.h"
#include "libc/mem/mem.h"

View file

@ -335,4 +335,9 @@ int main(int argc, char *argv[]) {
return 0;
}
#else
int main(int argc, char *argv[]) {
}
#endif /* __x86_64__ */

View file

@ -616,4 +616,9 @@ int main(int argc, char *argv[]) {
return 0;
}
#else
int main(int argc, char *argv[]) {
}
#endif /* __x86_64__ */

View file

@ -16,6 +16,7 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/errno.h"
#include "libc/fmt/conv.h"
#include "libc/fmt/fmt.h"
#include "libc/log/check.h"

View file

@ -27,6 +27,7 @@
#include "libc/calls/struct/winsize.h"
#include "libc/calls/termios.h"
#include "libc/dce.h"
#include "libc/errno.h"
#include "libc/fmt/conv.h"
#include "libc/intrin/bits.h"
#include "libc/intrin/safemacros.internal.h"

View file

@ -26,6 +26,7 @@
#include "libc/calls/struct/winsize.h"
#include "libc/calls/termios.h"
#include "libc/dce.h"
#include "libc/errno.h"
#include "libc/fmt/conv.h"
#include "libc/log/check.h"
#include "libc/log/log.h"

View file

@ -17,6 +17,7 @@
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/dce.h"
#include "libc/errno.h"
#include "libc/fmt/conv.h"
#include "libc/intrin/describeflags.internal.h"
#include "libc/macros.internal.h"