From c9613297942738aeb3d6e0b5beb6c20e84560a5c Mon Sep 17 00:00:00 2001 From: GNUfault-is-on-repo-or-cz-cuz-dis-sux Date: Fri, 10 Jul 2026 22:22:04 +0000 Subject: [PATCH 1/3] Update Makefile --- source/src/Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/src/Makefile b/source/src/Makefile index bf061958e1..c86d3c3903 100644 --- a/source/src/Makefile +++ b/source/src/Makefile @@ -6,7 +6,7 @@ # found to have been caused by the g++ compiler in the past. This seems to have # been fixed now by relaxing the optimization that g++ does, so although we'll # continue using clang++ (just in case), you can use g++ if you prefer. -CXX=clang++ +CXX=g++ # call like 'DEBUGBUILD=1 make' to compile a debug version of AssaultCube. ifdef DEBUGBUILD @@ -39,6 +39,11 @@ ifneq (,$(findstring clang,$(CXX))) else CXXFLAGS= -O3 -fomit-frame-pointer override CXXFLAGS+= -Wall -fsigned-char -ffast-math -rdynamic -Wno-format-zero-length + + ifneq ($(wildcard /usr/include/execinfo.h),) + override CXXFLAGS+= -DHAS_EXECINFO + endif + ifeq "$(shell expr 'gcc -dumpversion' \>= 8)" "1" override CXXFLAGS+= -Wno-stringop-truncation endif From 0bf5a882251af698256651c634726bc1c405b6df Mon Sep 17 00:00:00 2001 From: GNUfault-is-on-repo-or-cz-cuz-dis-sux Date: Fri, 10 Jul 2026 22:22:23 +0000 Subject: [PATCH 2/3] Update tools.cpp --- source/src/tools.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/source/src/tools.cpp b/source/src/tools.cpp index 75a5128d01..004006d16e 100644 --- a/source/src/tools.cpp +++ b/source/src/tools.cpp @@ -381,7 +381,10 @@ void stackdumper(unsigned int type, EXCEPTION_POINTERS *ep) } #elif defined(linux) || defined(__linux) || defined(__linux__) +// Add support for musl systems (eg., alpine, void) +#if defined(HAS_EXECINFO) #include +#endif // stack dumping on linux, inspired by Sachin Agrawal's sample code @@ -389,6 +392,7 @@ struct signalbinder { static void stackdumper(int sig) { +#if defined(HAS_EXECINFO) printf("stacktrace:\n"); #if !defined(STANDALONE) if(clientlogfile) clientlogfile->printf("stacktrace\n"); @@ -397,6 +401,7 @@ struct signalbinder void *array[BTSIZE]; int n = backtrace(array, BTSIZE); char **symbols = backtrace_symbols(array, n); + for(int i = 0; i < n; i++) { printf("%s\n", symbols[i]); @@ -404,10 +409,12 @@ struct signalbinder if(clientlogfile) clientlogfile->printf("%s\n", symbols[i]); #endif } - free(symbols); + free(symbols); +#else + printf("Stacktrace not available!\n"); +#endif fatal("AssaultCube error (%d)", sig); - } signalbinder() From 0c552866ab60343180d9ec17fbf5beec6ad25340 Mon Sep 17 00:00:00 2001 From: GNUfault-is-on-repo-or-cz-cuz-dis-sux Date: Fri, 10 Jul 2026 22:24:51 +0000 Subject: [PATCH 3/3] Update Makefile --- source/src/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/src/Makefile b/source/src/Makefile index c86d3c3903..2c70786cec 100644 --- a/source/src/Makefile +++ b/source/src/Makefile @@ -6,7 +6,7 @@ # found to have been caused by the g++ compiler in the past. This seems to have # been fixed now by relaxing the optimization that g++ does, so although we'll # continue using clang++ (just in case), you can use g++ if you prefer. -CXX=g++ +CXX=clang++ # call like 'DEBUGBUILD=1 make' to compile a debug version of AssaultCube. ifdef DEBUGBUILD