diff --git a/build/definitions.mk b/build/definitions.mk index b7c825184..9bc6d8c15 100644 --- a/build/definitions.mk +++ b/build/definitions.mk @@ -127,6 +127,7 @@ ifeq ($(ARCH), aarch64) DEFAULT_COPTS += \ -ffixed-x18 \ -ffixed-x28 \ + -fsigned-char \ -mno-outline-atomics endif diff --git a/tool/cosmocc/bin/cosmocc b/tool/cosmocc/bin/cosmocc index ae71ffeba..4951546df 100755 --- a/tool/cosmocc/bin/cosmocc +++ b/tool/cosmocc/bin/cosmocc @@ -265,7 +265,7 @@ LDFLAGS_X86_64="$LDFLAGS -L$BIN/../x86_64-linux-cosmo/lib -Wl,-T,$BIN/../x86_64- LDLIBS_X86_64="-lcosmo" CRT_AARCH64="$BIN/../aarch64-linux-cosmo/lib/crt.o" -CPPFLAGS_AARCH64="$CPPFLAGS" +CPPFLAGS_AARCH64="$CPPFLAGS -fsigned-char" CFLAGS_AARCH64="$CFLAGS -ffixed-x18 -ffixed-x28 -mno-outline-atomics" LDFLAGS_AARCH64="$LDFLAGS -L$BIN/../aarch64-linux-cosmo/lib -Wl,-T,$BIN/../aarch64-linux-cosmo/lib/aarch64.lds -Wl,-z,common-page-size=16384 -Wl,-z,max-page-size=16384" LDLIBS_AARCH64="-lcosmo" diff --git a/tool/cosmocc/bin/cosmocross b/tool/cosmocc/bin/cosmocross index d89d75971..78304cda8 100755 --- a/tool/cosmocc/bin/cosmocross +++ b/tool/cosmocc/bin/cosmocross @@ -84,6 +84,7 @@ if [ x"$ARCH" = x"x86_64" ]; then elif [ x"$ARCH" = x"aarch64" ]; then OBJCOPYFLAGS="-S" PAGESZ=16384 + CPPFLAGS="$CPPFLAGS -fsigned-char" CFLAGS="$CFLAGS -ffixed-x18 -ffixed-x28 -mno-outline-atomics" LDFLAGS="$LDFLAGS -Wl,-T,$BIN/../$ARCH-linux-cosmo/lib/aarch64.lds" else