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)
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]

index f4c288e7f206b8e3c4ee974db485de468ecf6a74..e93df726bd0a6632b1ff588941111fcc4877b631 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=asterisk
 PKG_VERSION:=18.1.1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=asterisk-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://downloads.asterisk.org/pub/telephony/asterisk/releases
diff --git a/net/asterisk/patches/150-lua-ldl.patch b/net/asterisk/patches/150-lua-ldl.patch
new file mode 100644 (file)
index 0000000..a1b470b
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -2581,7 +2581,7 @@ for ver in ; do
+ done
+ # Some distributions (like openSUSE and NetBSD) remove the 5.x suffix.
+-AST_EXT_LIB_CHECK([LUA], [lua], [luaL_newstate], [lua.h], [-lm])
++AST_EXT_LIB_CHECK([LUA], [lua], [luaL_newstate], [lua.h], [-lm -ldl])
+ # Accept either RADIUS client library, their APIs are fully compatible,
+ # just different header filenames and different SONAMEs