Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

Fix FTBFS with glibc 2.34 #142

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sergiodj
Copy link

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

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

Signed-off-by: Sergio Durigan Junior <sergiodj@sergiodj.net>
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant