[Home]

Summary:ASTERISK-25873: res_pjsip: Bundled pjproject: compile error, cannot find -lasteriskpj
Reporter:Hans van Eijsden (HansVanEijsden)Labels:asterisk
Date Opened:2016-03-29 19:00:11Date Closed:2016-03-31 11:14:32
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Resources/res_pjsip/Bundling
Versions:13.8.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Linux vps 4.4.0-0.bpo.1-amd64 #1 SMP Debian 4.4.6-1~bpo8+1 (2016-03-20) x86_64 GNU/Linux gcc version 4.9.2 (Debian 4.9.2-10) Attachments:
Description:While building Asterisk 13.8.0 with the new --pjproject-bundled option, Asterisk doesn't build.
While linking, it stops at this error:
/usr/bin/ld.bfd.real: cannot find -lasteriskpj
collect2: error: ld returned 1 exit status
The complete log is on Pastebin (http://pastebin.com/ikXAsjMF), attached to this report.

TL;DR:
$ contrib/scripts/get_mp3_source.sh
$ ./bootstrap.sh
$ ./configure CFLAGS="-DPJ_HAS_IPV6=1 -fPIC -O3 -march=native" CXXFLAGS="-fPIC -O3 -march=native" --with-pjproject-bundled --with-srtp --with-ssl --with-crypto
$ make menuselect
$ make
[...]
/usr/bin/ld.bfd.real: cannot find -lasteriskpj
collect2: error: ld returned 1 exit status
Makefile:334: recept voor doel 'asterisk' is mislukt
make[1]: *** [asterisk] Fout 1
Makefile:398: recept voor doel 'main' is mislukt
make: *** [main] Fout 2

Just let me know if you need more info. Thanks.
Comments:By: Asterisk Team (asteriskteam) 2016-03-29 19:00:11.797-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: abelbeck (abelbeck) 2016-03-30 16:46:38.044-0500

I am seeing a related regression cross-compiling 13.8.0 with "cannot find -lasteriskssl".  This patch fixes the problem...
{code}
--- asterisk-13.8.0/main/Makefile.orig 2016-03-30 12:32:58.000000000 -0500
+++ asterisk-13.8.0/main/Makefile 2016-03-30 12:33:23.000000000 -0500
@@ -226,9 +226,8 @@
$(ECHO_PREFIX) echo "   [LN] $< -> $@"
ifneq ($(LDCONFIG),)
$(CMD_PREFIX) $(LDCONFIG) $(LDCONFIG_FLAGS) . 2>/dev/null
-else
- $(CMD_PREFIX) $(LN) -sf $< $@
endif
+ $(CMD_PREFIX) $(LN) -sf $< $@

else # Darwin
ASTSSL_LIB:=libasteriskssl.dylib
{code}

Something similar could be done for -lasteriskpj in main/Makefile .

Note: my autoconf generates LDCONFIG=':'

By: George Joseph (gjoseph) 2016-03-30 17:24:27.461-0500

Ah good catch.  Maybe this'll save me from having to download 52gb worth of old Debian DVDs.  





By: George Joseph (gjoseph) 2016-03-30 17:25:11.634-0500

Hans,

Can you test abelbeck's suggestion and let me know if it works?



By: Hans van Eijsden (HansVanEijsden) 2016-03-30 17:40:58.712-0500

I can confirm the build is working now. Great!
I'm not that experienced with making a patch file (time to learn that I guess - although I'm just a simple end user), but I made the corrections by hand in the Makefile:
{noformat}
$(ASTPJ_LIB): $(ASTPJ_LIB).$(ASTPJ_SO_VERSION)
       $(ECHO_PREFIX) echo "   [LN] $< -> $@"
ifneq ($(LDCONFIG),)
       $(CMD_PREFIX) $(LDCONFIG) $(LDCONFIG_FLAGS) . 2>/dev/null
endif
       $(CMD_PREFIX) $(LN) -sf $< $@

else # Darwin
ASTPJ_LIB:=libasteriskpj.dylib
{noformat}
Thank you both very much for your time and efforts and greetings from a now happy user.

By: George Joseph (gjoseph) 2016-03-30 17:52:37.719-0500

Ok, now that I know it's LDCONFIG that's the issue, I'll fix it permanently.


By: abelbeck (abelbeck) 2016-03-30 18:10:24.386-0500

Why not just always create the symlink as before and as Asterisk 11 does ?

Your 'echo' comment says you do.

By: George Joseph (gjoseph) 2016-03-30 18:42:34.394-0500

I prefer ldconfig because it will create intermediate links if we start using multi-level version numbers for these libraries.


By: Hans van Eijsden (HansVanEijsden) 2016-03-30 19:10:00.159-0500

- Off the record - I went back to Asterisk 13.7.2; 13.8.0 gave me too many segfaults. It even crashes while loading codecs (and yes my module folder was perfectly empty before building). I will try to build it with debug and try to make a dump and open another issue report here.

By: abelbeck (abelbeck) 2016-03-31 12:53:08.628-0500

George, your upstream patch works for me.

Appreciate the prompt fix.

By: Rusty Newton (rnewton) 2016-04-25 14:53:36.472-0500

[~HansVanEijsden] I don't see any reports from you for the crashes that you mentioned. Be sure to file those so that we can look into them. Please open a new issue report for each crash or issue.  Remember to follow the guidelines for backtrace collection: https://wiki.asterisk.org/wiki/display/AST/Getting+a+Backtrace.  Thanks!