From eea98c65338d8ebe8c3f50556aa437c07134673b Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Sat, 5 Dec 2020 12:37:01 +0100 Subject: [PATCH] kamailio-5.x: fix erlang build The Erlang module build checks for libs and includes using the erl tool. This is a hostpkg tool providing paths into the staging/hostpkg. Of course this fails: arc-openwrt-linux-uclibc-gcc -shared -Wl,-O2 -Wl,-E -L/builder/shared-workdir/build/sdk/staging_dir/toolchain-arc_arc700_gcc-8.4.0_uClibc/usr/lib -L/builder/shared-workdir/build/sdk/staging_dir/toolchain-arc_arc700_gcc-8.4.0_uClibc/lib -L/builder/shared-workdir/build/sdk/staging_dir/target-arc_arc700_uClibc/usr/lib/libiconv-stub/lib -Wl,-rpath-link=/builder/shared-workdir/build/sdk/staging_dir/target-arc_arc700_uClibc/usr/lib/libiconv-stub/lib -L/builder/shared-workdir/build/sdk/staging_dir/target-arc_arc700_uClibc/usr/lib/libintl-stub/lib -Wl,-rpath-link=/builder/shared-workdir/build/sdk/staging_dir/target-arc_arc700_uClibc/usr/lib/libintl-stub/lib -znow -zrelro -pthread -rdynamic "-ldl" -Wl,-Bsymbolic-functions handle_emsg.o pv_xbuff.o cnode.o erl_api.o epmd.o erl_helpers.o pv_ref.o pv_pid.o pv_atom.o worker.o handle_rpc.o pv_list.o pv_tuple.o erlang_mod.o -L/builder/shared-workdir/build/sdk/staging_dir/hostpkg/lib/erlang/lib/erl_interface-4.0/lib -lei -lpthread -o erlang.so /builder/shared-workdir/build/sdk/staging_dir/toolchain-arc_arc700_gcc-8.4.0_uClibc/bin/../lib/gcc/arc-openwrt-linux-uclibc/8.4.0/../../../../arc-openwrt-linux-uclibc/bin/ld: /builder/shared-workdir/build/sdk/staging_dir/hostpkg/lib/erlang/lib/erl_interface-4.0/lib/libei.a: error adding symbols: file format not recognized collect2: error: ld returned 1 exit status ../../Makefile.rules:191: recipe for target 'erlang.so' failed make[6]: *** [erlang.so] Error 1 This patch prevents this by relying on the standard paths, where Erlang resides in OpenWrt. Signed-off-by: Sebastian Kemper --- .../patches/150-erlang-fix-flags.patch | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 net/kamailio-5.x/patches/150-erlang-fix-flags.patch diff --git a/net/kamailio-5.x/patches/150-erlang-fix-flags.patch b/net/kamailio-5.x/patches/150-erlang-fix-flags.patch new file mode 100644 index 0000000..60ab4f2 --- /dev/null +++ b/net/kamailio-5.x/patches/150-erlang-fix-flags.patch @@ -0,0 +1,30 @@ +--- a/src/modules/erlang/Makefile ++++ b/src/modules/erlang/Makefile +@@ -5,20 +5,21 @@ include ../../Makefile.defs + auto_gen= + NAME=erlang.so + +-ERLANG=$(shell which erl) ++# In OpenWrt Erlang resides in standard locations, no special flags required ++#ERLANG=$(shell which erl) + + ifneq ($(ERLANG),) + ERLANG_LIBDIR=$(shell $(ERLANG) -noshell -eval 'io:format("~n~s/lib~n", [[code:lib_dir("erl_interface")]]).' -s erlang halt | tail -n 1) + ERLANG_INCDIR=$(shell $(ERLANG) -noshell -eval 'io:format("~n~s/include~n", [[code:lib_dir("erl_interface")]]).' -s erlang halt | tail -n 1) + endif + +-ifeq ($(ERLANG_LIBDIR)$(ERLANG_INCDIR),) +-$(error Not found Erlang) +-endif ++#ifeq ($(ERLANG_LIBDIR)$(ERLANG_INCDIR),) ++#$(error Not found Erlang) ++#endif + +-LIBS=-L$(ERLANG_LIBDIR) -lei -lpthread ++LIBS=-lei -lpthread + +-DEFS+=-I$(ERLANG_INCDIR) ++#DEFS+=-I$(ERLANG_INCDIR) + DEFS+=-D_REENTRANT + + -- 2.30.2