diff mbox

[FFmpeg-devel] configure: check for dlsym as well

Message ID 20160901092333.19238-1-timo@rothenpieler.org
State Accepted
Commit 1c37be6e95ba2b6050502839eb73ca5b3809b71c
Headers show

Commit Message

Timo Rothenpieler Sept. 1, 2016, 9:23 a.m. UTC
For some reason, when compiling with gcc-asan and a recent enough gcc
version(seen on 5.3+ so far), linking dlopen works without -ldl, but
dlsym fails with:

undefined reference to symbol 'dlsym@@GLIBC_2.2.5'

So this patchs checks for both dlopen and dlsym to work for determining
if -ldl is needed.
---
 configure | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

James Almer Sept. 2, 2016, 9:11 p.m. UTC | #1
On 9/1/2016 6:23 AM, Timo Rothenpieler wrote:
> For some reason, when compiling with gcc-asan and a recent enough gcc
> version(seen on 5.3+ so far), linking dlopen works without -ldl, but
> dlsym fails with:
> 
> undefined reference to symbol 'dlsym@@GLIBC_2.2.5'
> 
> So this patchs checks for both dlopen and dlsym to work for determining
> if -ldl is needed.
> ---
>  configure | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/configure b/configure
> index 6741f83..a78edfa 100755
> --- a/configure
> +++ b/configure
> @@ -5378,9 +5378,9 @@ check_code cc arm_neon.h "int16x8_t test = vdupq_n_s16(0)" && enable intrinsics_
>  check_ldflags -Wl,--as-needed
>  check_ldflags -Wl,-z,noexecstack
>  
> -if check_func dlopen; then
> +if check_func dlopen && check_func dlsym; then
>      ldl=
> -elif check_func dlopen -ldl; then
> +elif check_func dlopen -ldl && check_func dlsym -ldl; then
>      ldl=-ldl
>  fi

LGTM
Timo Rothenpieler Sept. 2, 2016, 10:22 p.m. UTC | #2
> 
> LGTM

completely forgot about this

applied
diff mbox

Patch

diff --git a/configure b/configure
index 6741f83..a78edfa 100755
--- a/configure
+++ b/configure
@@ -5378,9 +5378,9 @@  check_code cc arm_neon.h "int16x8_t test = vdupq_n_s16(0)" && enable intrinsics_
 check_ldflags -Wl,--as-needed
 check_ldflags -Wl,-z,noexecstack
 
-if check_func dlopen; then
+if check_func dlopen && check_func dlsym; then
     ldl=
-elif check_func dlopen -ldl; then
+elif check_func dlopen -ldl && check_func dlsym -ldl; then
     ldl=-ldl
 fi