Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to compile on glibc 2.34 and later #114

Closed
GabrielRavier opened this issue Jul 7, 2022 · 4 comments
Closed

Failure to compile on glibc 2.34 and later #114

GabrielRavier opened this issue Jul 7, 2022 · 4 comments

Comments

@GabrielRavier
Copy link

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.

@SeedyROM
Copy link

SeedyROM commented Sep 4, 2022

@GabrielRavier You probably already did something similar, but I have a fork and PR with the updated Catch2 version for later glibc version.

#116

@jhcuarta
Copy link

jhcuarta commented Nov 5, 2022

Hi
I encountered the same error while compiling. I do not posses much expertise, but what should I do in order to fix it

@gotnone
Copy link

gotnone commented Nov 7, 2022

@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

@TartanLlama
Copy link
Owner

Fixed in b74fecd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants