kamailio-5.x: fix erlang build
authorSebastian Kemper <sebastian_ml@gmx.net>
Sat, 5 Dec 2020 11:37:01 +0000 (12:37 +0100)
committerSebastian Kemper <sebastian_ml@gmx.net>
Sat, 5 Dec 2020 11:37:04 +0000 (12:37 +0100)
commiteea98c65338d8ebe8c3f50556aa437c07134673b
tree84e7d1970e7fd554c3c3730c6a23a00144f871a5
parentde86a47df7a79b9aca438fcc66011b87fb319921
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 <sebastian_ml@gmx.net>
net/kamailio-5.x/patches/150-erlang-fix-flags.patch [new file with mode: 0644]