Add -flifetime-dse=1 flag to Linux Makefile to disable compiler optimization that removed entity memory zero-initialization

Resolves #187
This commit is contained in:
Sam V 2023-02-02 15:12:57 +01:00
parent 9c4af83c7d
commit ba8089e1f3
2 changed files with 4 additions and 1 deletions

View file

@ -39,7 +39,9 @@ else
ARCH_CFLAGS+=-gdwarf-2 -g2
endif
BASE_CFLAGS=-std=c++17 -fpermissive -fno-strict-aliasing -fno-exceptions -fexpensive-optimizations -Werror=return-type -w
# 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
BASE_CFLAGS=-std=c++17 -fpermissive -fno-strict-aliasing -fno-exceptions -fexpensive-optimizations -Werror=return-type -w -flifetime-dse=1
BASE_CFLAGS+=-DNDEBUG -DPOSIX -D_POSIX -DLINUX -D_LINUX -DGNUC -DNO_MALLOC_OVERRIDE -DCLIENT_WEAPONS
SHLIBEXT=so