opensim-core icon indicating copy to clipboard operation
opensim-core copied to clipboard

MINSIGSTKSZ has been removed from glibc >= 2.34

Open AlbertoCasasOrtiz opened this issue 2 years ago • 0 comments

Error message:

~/opensim-core-source/OpenSim/Auxiliary/catch.hpp:10798:58: error: call no non-'constexpr' funcion 'long int sysconf(int)' 10798 | static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;

~/opensim-core-source/Vendors/tropter/external/catch/catch.hpp:8726:58: error: call no non-'constexpr' funcion 'long int sysconf(int)' 8726 | static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;

Problem:

MINSIGSTKSZ is redefined to sysconf(_SC_MINSIGSTKSZ) and SIGSTKSZ is redefined to sysconf (_SC_SIGSTKSZ) in GNU C Library (glibc) version 2.34. https://sourceware.org/pipermail/libc-alpha/2021-August/129718.html

Workaround:

substitute static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ; with static constexpr std::size_t sigStackSize = 32768;

Further information:

Many applications, including catch2, have been affected by this. In the following issue of catch2 different solutions and workarounds are proposed (including the workaround above): https://github.com/catchorg/Catch2/issues/2178

The case of catch2 is interesting because they were using exactly the same code, so the solutions applied may be useful here.

AlbertoCasasOrtiz avatar Jun 11 '22 18:06 AlbertoCasasOrtiz