DNS-OARC / flamethrower

a DNS performance and functional testing utility supporting UDP, TCP, DoT and DoH
Apache License 2.0
318 stars 37 forks source link

Build fail on arch linux (gcc 11.2.0) #89

Closed simonvik closed 2 years ago

simonvik commented 2 years ago

Host: Arch linux with gcc 11.2.0 trying to compile commit 5056602eb10316f4f1791ec5a7918e1ff40fe7fe

MINSIGSTKSZ doesnt seem to be defined and the build fails with:

In file included from /usr/include/signal.h:328,
                 from /tmp/flamethrower/3rd/catch/catch2/catch.hpp:4913,
                 from /tmp/flamethrower/tests/main.cpp:2:
/tmp/flamethrower/3rd/catch/catch2/catch.hpp:7491:58: error: call to non-‘constexpr’ function ‘long int sysconf(int)’
 7491 |     constexpr static std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
      |                                                          ^~~~~~~~~~~
In file included from /usr/include/bits/sigstksz.h:24,
                 from /usr/include/signal.h:328,
                 from /tmp/flamethrower/3rd/catch/catch2/catch.hpp:4913,
                 from /tmp/flamethrower/tests/main.cpp:2:
/usr/include/unistd.h:640:17: note: ‘long int sysconf(int)’ declared here
  640 | extern long int sysconf (int __name) __THROW;
      |                 ^~~~~~~
In file included from /tmp/flamethrower/tests/main.cpp:2:
/tmp/flamethrower/3rd/catch/catch2/catch.hpp:7550:45: error: size of array ‘altStackMem’ is not an integral constant-expression
 7550 |     char FatalConditionHandler::altStackMem[sigStackSize] = {};
      |                                             ^~~~~~~~~~~~
make[2]: *** [CMakeFiles/tests.dir/build.make:76: CMakeFiles/tests.dir/tests/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:197: CMakeFiles/tests.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

Just defining MINSIGSTKSZ makes the build succeed.

(Missing include somewhere?)

simonvik commented 2 years ago

This might be due to glibc, possible broken from 2.34?

Seems to be fixed in newer catch : https://github.com/catchorg/Catch2/blob/7cf2f88e50f0d1de324489c31db0314188423b6d/docs/release-notes.md#improvements-1

weyrick commented 2 years ago

Thanks for the report. I believe we are not actually using catch anyway, we should probably just remove for now.

TerryOtt commented 2 years ago

As I just got burned by this as well (though on Ubuntu 22.04 LTS), here's the link to Catch2 issue where it was reported:

https://github.com/catchorg/Catch2/issues/2178