Make execinfo.h optional (fixes musl libc build)
finally got the chance to build on Alpine Linux, which uses musl libc instead of glibc. while it was building fine for the most part, there was one place where we used execinfo.h
, a non-standard header that most UNIX-systems (but not all, as demonstrated here!) support. fortunately, the header is not necessary to allow SRB2 to run, and can be safely made optional using preprocessor directives.
so, to build using musl libc, the environment variable NOEXECINFO=1
must be set using this patch. this was the easiest way to solve this and it does the job, but we're going to have to document this later on the wiki.
Merge request reports
Activity
308 314 CRASHLOG_WRITE(strsignal(signal)); 309 315 CRASHLOG_WRITE("\n"); // Newline for the signal name 310 316 317 #ifndef NOEXECINFO 311 318 CRASHLOG_STDERR_WRITE("\nBacktrace:\n"); 312 319 313 320 // Flood the output and log with the backtrace 314 321 size = backtrace(array, BT_SIZE); 315 322 backtrace_symbols_fd(array, size, fd); 316 323 backtrace_symbols_fd(array, size, STDERR_FILENO); 324 #endif 317 325 318 326 CRASHLOG_WRITE("\n"); // Write another newline to the log so it looks nice :) With
NOEXECINFO
, we get two\n
writes in a row at the end. Is that intentional?
(I.e. doesbacktrace_symbols_fd(array, size, STDERR_FILENO);
end with\n
? If not, then the last\n
write should be in the#ifndef
too.)Also, you may want to add
NOEXECINFO
information to CMakeLists.txt, src/CMakeLists.txt, and src/Makefile too, similar toMOBJCONSISTANCY
andPACKETDROP
.(Lastly, I think that this kind of merge request is [supposed to target the "master" branch] - SRB2 having two separate "target branches" is a bit confusing. :dramahog:)
OK, I had merged your changes into
master
branch, created a build job for Alpine. Then merged that intonext
branch.master
: https://git.do.srb2.org/STJr/SRB2/-/jobs/8361next
: https://git.do.srb2.org/STJr/SRB2/-/jobs/8372Did I missed anything from cherry picking your changes?
mentioned in commit 97a98d30
added Ecosystem label