Failure to compile on glibc 2.34 and later
GabrielRavier opened this issue · 4 comments
This project fails to compile on my machine, with this error:
$ cmake -B build && cmake --build build --parallel 18
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/tmp.Qwf5IxQGCK/expected/build
Consolidate compiler generated dependencies of target tl-expected-tests
[ 7%] Building CXX object CMakeFiles/tl-expected-tests.dir/tests/main.cpp.o
In file included from /usr/include/signal.h:328,
from /tmp/tmp.Qwf5IxQGCK/expected/build/_deps/catch2-src/single_include/catch2/catch.hpp:7712,
from /tmp/tmp.Qwf5IxQGCK/expected/tests/main.cpp:2:
/tmp/tmp.Qwf5IxQGCK/expected/build/_deps/catch2-src/single_include/catch2/catch.hpp:10453:58: error: call to non-‘constexpr’ function ‘long int sysconf(int)’
10453 | static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
| ^~~~~~~~~~~
In file included from /usr/include/bits/sigstksz.h:24:
/usr/include/unistd.h:640:17: note: ‘long int sysconf(int)’ declared here
640 | extern long int sysconf (int __name) __THROW;
| ^~~~~~~
/tmp/tmp.Qwf5IxQGCK/expected/build/_deps/catch2-src/single_include/catch2/catch.hpp:10512:45: error: size of array ‘altStackMem’ is not an integral constant-expression
10512 | char FatalConditionHandler::altStackMem[sigStackSize] = {};
| ^~~~~~~~~~~~
gmake[2]: *** [CMakeFiles/tl-expected-tests.dir/build.make:174: CMakeFiles/tl-expected-tests.dir/tests/main.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:856: CMakeFiles/tl-expected-tests.dir/all] Error 2
gmake: *** [Makefile:166: all] Error 2
This appears to be caused by the fact that the version of Catch2 used in this repo, 2.9.2, expects to be able to use MINSIGSTKSZ
as a constant expression, which breaks starting with glibc 2.34. According to Catch2's release notes, this is fixed in Catch2 2.13.5, so it would be nice if the dependency on Catch2 was updated to at least that version.
@GabrielRavier You probably already did something similar, but I have a fork and PR with the updated Catch2 version for later glibc version.
Hi
I encountered the same error while compiling. I do not posses much expertise, but what should I do in order to fix it
@jhcuarta you need to edit the CMakeLists.txt file to change the version of the Catch2 URL. You must use a version of Catch2 >= 2.13.5
replace the URL with something like https://github.com/catchorg/Catch2/archive/v2.13.10.zip
See the following issue thread for more details
catchorg/Catch2#2178
Fixed in b74fecd