mariusbancila / stduuid

A C++17 cross-platform implementation for UUIDs
MIT License
758 stars 112 forks source link

Does not compile with glibc 2.34 #47

Closed chubin closed 2 years ago

chubin commented 2 years ago

I am trying to compile stduuid with Glibc 2.34 but it does not seem to work:

In file included from /opt/runtime-8.0-dev0/include/signal.h:328,
                 from /home/ubuntu/runtime-8e5e829d-64r/.build/ports/_build/stduuid-5890c94bfac2f00f22a1c1481e5839c51d6a6f3f/catch/catch.hpp:8034,
                 from /home/ubuntu/runtime-8e5e829d-64r/.build/ports/_build/stduuid-5890c94bfac2f00f22a1c1481e5839c51d6a6f3f/test/main.cpp:2:
/home/ubuntu/runtime-8e5e829d-64r/.build/ports/_build/stduuid-5890c94bfac2f00f22a1c1481e5839c51d6a6f3f/catch/catch.hpp:10822:58: error: call to non-'constexpr' function 'long int sysconf(int)'
10822 |     static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
      |                                                          ^~~~~~~~~~~
In file included from /opt/runtime-8.0-dev0/include/c++/11.2.0/bits/atomic_wait.h:44,
                 from /opt/runtime-8.0-dev0/include/c++/11.2.0/bits/atomic_base.h:41,
                 from /opt/runtime-8.0-dev0/include/c++/11.2.0/bits/shared_ptr_atomic.h:33,
                 from /opt/runtime-8.0-dev0/include/c++/11.2.0/memory:78,
                 from /home/ubuntu/runtime-8e5e829d-64r/.build/ports/_build/stduuid-5890c94bfac2f00f22a1c1481e5839c51d6a6f3f/catch/catch.hpp:2943,
                 from /home/ubuntu/runtime-8e5e829d-64r/.build/ports/_build/stduuid-5890c94bfac2f00f22a1c1481e5839c51d6a6f3f/test/main.cpp:2:
/opt/exasol/runtime-8.0-dev0/include/unistd.h:641:17: note: 'long int sysconf(int)' declared here
  641 | extern long int sysconf (int __name) __THROW;
      |                 ^~~~~~~
In file included from /home/ubuntu/runtime-8e5e829d-64r/.build/ports/_build/stduuid-5890c94bfac2f00f22a1c1481e5839c51d6a6f3f/test/main.cpp:2:
/home/ubuntu/runtime-8e5e829d-64r/.build/ports/_build/stduuid-5890c94bfac2f00f22a1c1481e5839c51d6a6f3f/catch/catch.hpp:10881:45: error: size of array 'altStackMem' is not an integral constant-expression
10881 |     char FatalConditionHandler::altStackMem[sigStackSize] = {};
      |                                             ^~~~~~~~~~~~

The problem is that in glibc 2.34, MINSIGSTKSZ is no longer a constant

mariusbancila commented 2 years ago

This was a problem due to Catch2 using MINSIGSTKSZ. See: https://github.com/catchorg/Catch2/issues/2178.

I have updated the Catch2 version. The problem should be fixed now.