Commit 14d586ac authored by Martin Storsjö's avatar Martin Storsjö

Don't assume dlsym exists on linux

After checking if -ldl exists, use it for checking for the dlsym

This fixes building in environments where the dlsym function is
unavailable. (My testcase is NDK builds with -static, where dlsym
isn't available for static linking, only if linking dynamically.)
parent 6b611d36
......@@ -136,6 +136,9 @@ endif
libdl_dependency = []
if host_machine.system() == 'linux'
libdl_dependency = cc.find_library('dl', required : false)
if cc.has_function('dlsym', prefix : '#include <dlfcn.h>', args : test_args, dependencies : libdl_dependency)
cdata.set('HAVE_DLSYM', 1)
......@@ -99,7 +99,7 @@ COLD int dav1d_open(Dav1dContext **const c_out, const Dav1dSettings *const s) {
pthread_attr_t thread_attr;
if (pthread_attr_init(&thread_attr)) return DAV1D_ERR(ENOMEM);
size_t stack_size = 1024 * 1024;
#ifdef __linux__
#if defined(__linux__) && defined(HAVE_DLSYM)
/* glibc has an issue where the size of the TLS is subtracted from the stack
* size instead of allocated separately. As a result the specified stack
* size may be insufficient when used in an application with large amounts
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment