versatica / libmediasoupclient

mediasoup client side C++ library
https://mediasoup.org
ISC License
288 stars 178 forks source link

Cannot build on Linux with glibc 2.35 #145

Open h3poteto opened 2 years ago

h3poteto commented 2 years ago

I'm using Manjaro Linux, and when I build this client I got an error.

[ 84%] Building CXX object libsdptransform/test/CMakeFiles/test_sdptransform.dir/tests.cpp.o
In file included from /usr/include/signal.h:328,
                 from /home/h3poteto/src/github.com/versatica/libmediasoupclient/deps/libsdptransform/test/include/catch.hpp:7937,
                 from /home/h3poteto/src/github.com/versatica/libmediasoupclient/deps/libsdptransform/test/tests.cpp:4:
/home/h3poteto/src/github.com/versatica/libmediasoupclient/deps/libsdptransform/test/include/catch.hpp:10717:58: error: call to non-‘constexpr’ function ‘long int sysconf(int)’
10717 |     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;
      |                 ^~~~~~~
/home/h3poteto/src/github.com/versatica/libmediasoupclient/deps/libsdptransform/test/include/catch.hpp:10776:45: error: size of array ‘altStackMem’ is not an integral constant-expression
10776 |     char FatalConditionHandler::altStackMem[sigStackSize] = {};
      |                                             ^~~~~~~~~~~~
make[2]: *** [libsdptransform/test/CMakeFiles/test_sdptransform.dir/build.make:76: libsdptransform/test/CMakeFiles/test_sdptransform.dir/tests.cpp.o] Error 1
make[2]: Leaving directory '/home/h3poteto/src/github.com/versatica/libmediasoupclient/build'
make[1]: *** [CMakeFiles/Makefile2:187: libsdptransform/test/CMakeFiles/test_sdptransform.dir/all] Error 2
make[1]: Leaving directory '/home/h3poteto/src/github.com/versatica/libmediasoupclient/build'
make: *** [Makefile:136: all] Error 2
make: Leaving directory '/home/h3poteto/src/github.com/versatica/libmediasoupclient/build'

I guess this is due to glibc. According to this document: https://sourceware.org/git/?p=glibc.git;a=blob;f=NEWS;h=85e84fe53699fe9e392edffa993612ce08b2954a;hb=HEAD

  • Add _SC_MINSIGSTKSZ and _SC_SIGSTKSZ. When _SC_SIGSTKSZ_SOURCE or _GNU_SOURCE are defined, MINSIGSTKSZ and SIGSTKSZ are no longer constant on Linux. MINSIGSTKSZ is redefined to sysconf(_SC_MINSIGSTKSZ) and SIGSTKSZ is redefined to sysconf (_SC_SIGSTKSZ).

Since 2.34 MINSIGSTKSZ is no longer constant. I'm using glibc 2.35.

h3poteto commented 2 years ago

I'm waiting for the next release of https://github.com/ibc/libsdptransform/pull/22, after that I will update the library in this repository. Could you please release the next version of libsdptransform? @ibc

ibc commented 1 year ago

libsdptransform 1.2.10 released.

eliabruni commented 1 year ago

I am encountering the same problem when using refs/remotes/branch-heads/4606 as per official documentation. Is there a recommended way to address it?

rdu-weston commented 1 year ago

@eliabruni Updating libsdptransform to 1.2.10 should resolve the issue.

I was wondering why git submodule is not used to include the libsdptransform dependency. @ibc

eliabruni commented 1 year ago

thanks @rdu-weston , will check!