opentracing-cpp icon indicating copy to clipboard operation
opentracing-cpp copied to clipboard

Fix FTBFS with glibc 2.34

Open sergiodj opened this issue 2 years ago • 0 comments

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).

sergiodj avatar Nov 20 '21 02:11 sergiodj