Skip to content

Cannot build on Linux with glibc 2.35 #145

Open
@h3poteto

Description

@h3poteto

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions