Skip to content
Snippets Groups Projects
Commit 14d586ac authored by Martin Storsjö's avatar Martin Storsjö
Browse files

Don't assume dlsym exists on linux

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

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
No related branches found
No related tags found
1 merge request!865Don't assume dlsym exists on linux
Pipeline #11910 passed with stages
in 6 minutes and 21 seconds
......@@ -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)
endif
endif
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment