opentracing-cpp
opentracing-cpp copied to clipboard
Fix FTBFS with glibc 2.34
Building with glibc 2.34 leads to a compilation error because SIGSTKSZ
is not a constant anymore. From glibc's NEWS file:
* Add _SC_MINSIGSTKSZ and _SC_SIGSTKSZ. When _SC_SIGSTKSZ_SOURCE or
_GNU_SOURCE are defined, MINSIGSTKSZ and SIGSTKSZ are no longer
constant on Linux. MINSIGSTKSZ is redefined to sysconf(_SC_MINSIGSTKSZ)
and SIGSTKSZ is redefined to sysconf (_SC_SIGSTKSZ).
Here's the error:
In file included from /usr/include/signal.h:328,
from /<<PKGBUILDDIR>>/3rd_party/include/opentracing/catch2/catch.hpp:6456,
from /<<PKGBUILDDIR>>/test/string_view_test.cpp:5:
/<<PKGBUILDDIR>>/3rd_party/include/opentracing/catch2/catch.hpp:6631:45: error: size of array ‘altStackMem’ is not an integral constant-expression
6631 | char FatalConditionHandler::altStackMem[SIGSTKSZ] = {};
| ^~~~~~~~
The fix here is to dinamically allocate altStackMem. Tested in Ubuntu Jammy (22.04).