box2d: 2.4.1: build fails with BOX2D_BUILD_UNIT_TESTS=ON

[ 33%] Building CXX object unit-test/CMakeFiles/unit_test.dir/hello_world.cpp.o
cd /home/tkloczko/rpmbuild/BUILD/box2d-2.4.1/x86_64-redhat-linux-gnu/unit-test && /usr/bin/g++ -DB2_SHARED -I/home/tkloczko/rpmbuild/BUILD/box2d-2.4.1/src/../include -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -O2 -g -DNDEBUG -fvisibility=hidden -fvisibility-inlines-hidden -std=c++11 -o CMakeFiles/unit_test.dir/hello_world.cpp.o -c /home/tkloczko/rpmbuild/BUILD/box2d-2.4.1/unit-test/hello_world.cpp
In file included from /home/tkloczko/rpmbuild/BUILD/box2d-2.4.1/unit-test/hello_world.cpp:25:
/home/tkloczko/rpmbuild/BUILD/box2d-2.4.1/unit-test/doctest.h:4021:47: error: size of array ‘altStackMem’ is not an integral constant-expression
 4021 |         static char             altStackMem[4 * SIGSTKSZ];
      |                                               ^
  • Ask for help on discord and/or reddit
  • Consider providing a dump file using b2World::Dump

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 20 (5 by maintainers)

Commits related to this issue

Most upvoted comments

Sorry, I’ve been working exclusively on version 3. Maybe I can do something to quickly fix this.

Note the following issue happens with glibc 2.34 where it changed to:

* Add _SC_MINSIGSTKSZ and _SC_SIGSTKSZ.  When _DYNAMIC_STACK_SIZE_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).  This supports
  dynamic sized register sets for modern architectural features like
  Arm SVE.