From e6f16fbda5ef1d7e6561aded1da43050ac54344a Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 4 Aug 2025 19:23:38 +0200 Subject: [PATCH] pass our main CFLAGS to bluajit otherwise it would compile with O2 and stuff becoming super slow lol --- libs/bluajit/src/Makefile | 5 +++-- src/Makefile | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/libs/bluajit/src/Makefile b/libs/bluajit/src/Makefile index 405c23760..51a449fc6 100644 --- a/libs/bluajit/src/Makefile +++ b/libs/bluajit/src/Makefile @@ -35,7 +35,7 @@ CC= $(DEFAULT_CC) # to slow down the C part by not omitting it. Debugging, tracebacks and # unwinding are not affected -- the assembler part has frame unwind # information and GCC emits it where needed (x64) or with -g (see CCDEBUG). -CCOPT= -O2 -fomit-frame-pointer +#CCOPT= -O2 -fomit-frame-pointer # Use this if you want to generate a smaller binary (but it's slower): #CCOPT= -Os -fomit-frame-pointer # Note: it's no longer recommended to use -O3 with GCC 4.x. @@ -46,7 +46,7 @@ CCOPT= -O2 -fomit-frame-pointer # x86/x64 only: For GCC 4.2 or higher and if you don't intend to distribute # the binaries to a different machine you could also use: -march=native # -CCOPT_x86= -march=i686 -msse -msse2 -mfpmath=sse +#CCOPT_x86= -march=i686 -msse -msse2 -mfpmath=sse CCOPT_x64= CCOPT_arm= CCOPT_arm64= @@ -111,6 +111,7 @@ XCFLAGS+= -DLUAJIT_NUMMODE=2 # # Change number type to int32_t. Requires dual-number mode. XCFLAGS+= -DLUAJIT_INTONLY +OPTS+=-DLUAJIT_INTONLY # # Disable LJ_GC64 mode for x64. #XCFLAGS+= -DLUAJIT_DISABLE_GC64 diff --git a/src/Makefile b/src/Makefile index e8b5e90fd..44059e602 100644 --- a/src/Makefile +++ b/src/Makefile @@ -282,6 +282,9 @@ opts+=$(foreach v,$(passthru_opts),$(if $($(v)),-D$(v))) CXXFLAGS+=-std=c++17 # force c17 for c++ since most vpss run older ubuntu versions with old compilers +ifndef NOBLUAJIT +jitopts+=$(CFLAGS) # dont pass any of our WFLAGS to jit unless you want to have a fun time (: +endif opts+=$(WFLAGS) $(CFLAGS) cxxopts:=$(opts) $(CXXFLAGS) opts+=$(CWFLAGS) # warning flags that shouldnt be passed to c++ compiler @@ -369,7 +372,7 @@ $(dbg) : $(objects) $(lualib) | $$(@D)/ ifndef NOBLUAJIT $(lualib): - @$(MAKE) -C ../libs/bluajit $(MAKECMDGOALS) + @$(MAKE) -C ../libs/bluajit $(MAKECMDGOALS) CCOPT="$(jitopts)" endif # disassembly of executable