diff --git a/linux/Makefile b/linux/Makefile index a566758..47aa76e 100644 --- a/linux/Makefile +++ b/linux/Makefile @@ -43,9 +43,12 @@ BASE_CFLAGS=-std=c++17 -fpermissive -fno-strict-aliasing -fno-exceptions -fexpen BASE_CFLAGS+=-DNDEBUG -DPOSIX -D_POSIX -DLINUX -D_LINUX -DGNUC -DNO_MALLOC_OVERRIDE -DCLIENT_WEAPONS # flifetime-dse=1 is needed to disable a compiler optimization that optimizes out std::memset calls in CBaseEntity::operator new -# See https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-flifetime-dse for more information about the flifetime-dse flag +# See https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-flifetime-dse for more information about this flag +# fno-gnu-unique is needed to disable a compiler optimization that prevents dlclose from unloading mod dlls, +# causing them to retain state and crash when the engine tries to access memory in an invalid way +# See https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#index-fno-gnu-unique for more informatio about this flag ifeq "$(COMPILER)" "g++" - BASE_CFLAGS+=-flifetime-dse=1 + BASE_CFLAGS+=-flifetime-dse=1 -fno-gnu-unique endif SHLIBEXT=so