sony / nmos-cpp

An NMOS (Networked Media Open Specifications) Registry and Node in C++ (IS-04, IS-05)
Apache License 2.0
143 stars 80 forks source link

Compilation under Ubuntu 22.04 (Jammy) and gcc 11.2.0 fails with error during linking #259

Closed rhastie closed 2 years ago

rhastie commented 2 years ago

Just testing moving the container to the new Ubuntu 22.04 (Jammy) LTS release. This means moving to gcc 11.2.0 which currently isn't tested in the CI/CD pipeline...

I get a compile error during linking...

[ 92%] Building CXX object CMakeFiles/nmos-cpp.dir/sdp/sdp_grammar.cpp.o
[ 92%] Linking CXX static library libnmos-cpp.a
[ 92%] Built target nmos-cpp
[ 92%] Building CXX object CMakeFiles/nmos-cpp-registry.dir/nmos-cpp-registry/main.cpp.o
[ 93%] Building CXX object CMakeFiles/nmos-cpp-node.dir/nmos-cpp-node/node_implementation.cpp.o
[ 93%] Building CXX object CMakeFiles/nmos-cpp-node.dir/nmos-cpp-node/main.cpp.o
[ 93%] Building CXX object CMakeFiles/nmos-cpp-test.dir/nmos-cpp-test/main.cpp.o
In file included from /usr/include/signal.h:328,
                 from /home/nmos-cpp/Development/third_party/catch/catch.hpp:6448,
                 from /home/nmos-cpp/Development/bst/test/detail/catch-1.10.0.h:18,
                 from /home/nmos-cpp/Development/bst/test/test.h:48,
                 from /home/nmos-cpp/Development/nmos-cpp-test/main.cpp:2:
/home/nmos-cpp/Development/third_party/catch/catch.hpp:6471:33: error: size of array 'altStackMem' is not an integral constant-expression
 6471 |         static char altStackMem[SIGSTKSZ];
      |                                 ^~~~~~~~
/home/nmos-cpp/Development/third_party/catch/catch.hpp:6522:45: error: size of array 'altStackMem' is not an integral constant-expression
 6522 |     char FatalConditionHandler::altStackMem[SIGSTKSZ] = {};
      |                                             ^~~~~~~~
make[2]: *** [CMakeFiles/nmos-cpp-test.dir/build.make:76: CMakeFiles/nmos-cpp-test.dir/nmos-cpp-test/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:326: CMakeFiles/nmos-cpp-test.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 93%] Building CXX object CMakeFiles/nmos-cpp-registry.dir/nmos-cpp-registry/registry_implementation.cpp.o
[ 94%] Linking CXX executable nmos-cpp-registry
[ 94%] Built target nmos-cpp-registry
[ 94%] Linking CXX executable nmos-cpp-node
[ 94%] Built target nmos-cpp-node
make: *** [Makefile:146: all] Error 2
The command '/bin/sh -c mkdir /home/nmos-cpp/Development/build &&     cd /home/nmos-cpp/Development/build &&     cmake     -G "Unix Makefiles"     -DCMAKE_BUILD_TYPE:STRING="MinSizeRel"     -DCMAKE_CONFIGURATION_TYPES:STRING="MinSizeRel"     -DNMOS_CPP_USE_AVAHI:BOOL="0"     /home/nmos-cpp/Development/build .. &&     if [ -n "$makemt" ]; then echo "Making multi-threaded with $makemt jobs"; make -j$makemt; else echo "Making single-threaded"; make; fi' returned a non-zero code: 2
make: *** [Makefile:15: build] Error 2

No rush as we don't need to advance the container to 22.04 for sometime but I thought I'd give the heads up on the error when you advance the compiler. I know you are waiting on a Ubuntu 22.04 runner before you can test this in CI/CD etc.

garethsb commented 2 years ago

It's a known issue, so there may already be a patch, or could think about upgrading from venerable Catch 1.x to latest Catch 2.

See https://github.com/catchorg/Catch2/issues/2178#issuecomment-781984218

N-Nagorny commented 2 years ago

Looks like there is a patch. https://src.fedoraproject.org/rpms/catch1/blob/rawhide/f/catch1-sigstksz.patch