From fc82f77a4629bbb77e59a6a0cb3c351ba18059d2 Mon Sep 17 00:00:00 2001 From: Justine Tunney Date: Mon, 1 May 2023 13:46:15 -0700 Subject: [PATCH] Fix bug in cosmocc / cosmoc++ scripts The necessary flags weren't being passed when compiling programs as a single step (i.e. not using `-c` to make intermediate objects). --- tool/scripts/cosmoc++ | 2 +- tool/scripts/cosmocc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tool/scripts/cosmoc++ b/tool/scripts/cosmoc++ index 84d75910e..095155d1f 100755 --- a/tool/scripts/cosmoc++ +++ b/tool/scripts/cosmoc++ @@ -90,7 +90,7 @@ if [ "$HAS_E" = "1" ]; then elif [ "$HAS_C" = "1" ]; then set -- $CCFLAGS $CXXFLAGS $CPPFLAGS "$@" -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer else - set -- $LDFLAGS $CPPFLAGS "$@" $LDLIBS -Wl,-z,common-page-size=4096 -Wl,-z,max-page-size=4096 + set -- $LDFLAGS $CXXFLAGS $CPPFLAGS "$@" $LDLIBS -Wl,-z,common-page-size=4096 -Wl,-z,max-page-size=4096 fi set -- "$CXX" "$@" diff --git a/tool/scripts/cosmocc b/tool/scripts/cosmocc index 501576452..42a7d3f21 100755 --- a/tool/scripts/cosmocc +++ b/tool/scripts/cosmocc @@ -92,7 +92,7 @@ if [ "$HAS_E" = "1" ]; then elif [ "$HAS_C" = "1" ]; then set -- $CFLAGS $CPPFLAGS "$@" -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer else - set -- $LDFLAGS $CPPFLAGS "$@" $LDLIBS -Wl,-z,common-page-size=4096 -Wl,-z,max-page-size=4096 + set -- $LDFLAGS $CFLAGS $CPPFLAGS "$@" $LDLIBS -Wl,-z,common-page-size=4096 -Wl,-z,max-page-size=4096 fi set -- "$CC" "$@"