asterisk: link in libdl when linking to liblua 604/head
authorSebastian Kemper <sebastian_ml@gmx.net>
Sun, 3 Jan 2021 17:20:02 +0000 (18:20 +0100)
committerSebastian Kemper <sebastian_ml@gmx.net>
Sun, 3 Jan 2021 17:39:07 +0000 (18:39 +0100)
commit150b85ab350844f1481b9a9d49984b3e16cddd40
treee650e820692c2bc9cfa118590a9031292e01093e
parent9994df7ffd90d05eee00effedff7fc65ce6cb74d
asterisk: link in libdl when linking to liblua

Currently building for archs target against glibc fails:

checking for mandatory modules:  CAP GSM ILBC LIBEDIT LIBXML2 LUA PJPROJECT SQLITE3 SRTP ZLIB... fail

configure: ***
configure: *** The LUA installation appears to be missing or broken.

Checking config.log reveals:

/home/sk/tmp/sdk/openwrt-sdk-archs38-generic_gcc-8.4.0_glibc.Linux-x86_64/staging_dir/toolchain-arc_archs_gcc-8.4.0_glibc/bin/../lib/gcc/arc-openwrt-linux-gnu/8.4.0/../../../../arc-openwrt-linux-gnu/bin/ld: /home/sk/tmp/sdk/openwrt-sdk-archs38-generic_gcc-8.4.0_glibc.Linux-x86_64/staging_dir/target-arc_archs_glibc/usr/lib/liblua.so: undefined reference to `dlopen'
/home/sk/tmp/sdk/openwrt-sdk-archs38-generic_gcc-8.4.0_glibc.Linux-x86_64/staging_dir/toolchain-arc_archs_gcc-8.4.0_glibc/bin/../lib/gcc/arc-openwrt-linux-gnu/8.4.0/../../../../arc-openwrt-linux-gnu/bin/ld: /home/sk/tmp/sdk/openwrt-sdk-archs38-generic_gcc-8.4.0_glibc.Linux-x86_64/staging_dir/target-arc_archs_glibc/usr/lib/liblua.so: undefined reference to `dlclose'
/home/sk/tmp/sdk/openwrt-sdk-archs38-generic_gcc-8.4.0_glibc.Linux-x86_64/staging_dir/toolchain-arc_archs_gcc-8.4.0_glibc/bin/../lib/gcc/arc-openwrt-linux-gnu/8.4.0/../../../../arc-openwrt-linux-gnu/bin/ld: /home/sk/tmp/sdk/openwrt-sdk-archs38-generic_gcc-8.4.0_glibc.Linux-x86_64/staging_dir/target-arc_archs_glibc/usr/lib/liblua.so: undefined reference to `dlerror'
/home/sk/tmp/sdk/openwrt-sdk-archs38-generic_gcc-8.4.0_glibc.Linux-x86_64/staging_dir/toolchain-arc_archs_gcc-8.4.0_glibc/bin/../lib/gcc/arc-openwrt-linux-gnu/8.4.0/../../../../arc-openwrt-linux-gnu/bin/ld: /home/sk/tmp/sdk/openwrt-sdk-archs38-generic_gcc-8.4.0_glibc.Linux-x86_64/staging_dir/target-arc_archs_glibc/usr/lib/liblua.so: undefined reference to `dlsym'

This commit adds "-ldl" to lua linker flags so compilation against glibc
works. This has no ill effect on musl where libdl is just an empty
library archive.

This is not something that should be sent upstream, as they maybe
support non-Linux platforms as well.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
net/asterisk/Makefile
net/asterisk/patches/150-lua-ldl.patch [new file with mode: 0644]