[sr-dev] [kamailio/kamailio] app_perl.so: undefined symbol: sv2int_str (#1012)

James Cloos notifications at github.com
Mon Mar 6 17:06:18 CET 2017


>>>>> "DM" == Daniel-Constantin Mierla <notifications at github.com> writes:

DM> If the function is not used in the same object (source file) only,
DM> then inline should be removed,

It is only used in the .xs file where it is defined.

Without optimization gcc (at least gcc 5) leaves it in the .o file as an
undefined symbol.

I just duplicated what kamailio master does to make(1) kamailioxs.s, but
with -S instead of -c.  The four places where sv2int_str() is called
show up as:

        call    sv2int_str at PLT

With -O2 or -O1 it gets inlined.

So it seems that w/o optimization gcc5 fails to inline the function at
its call sites, but also leaves it out because it was defined as inline.

Gcc-4.8, OTOH, compiles it as a non-inlined function called run w/o
optimization.

So this is a gcc bug which kamailio can work around by optimizing.

I see in Makefile.defs that CC_OPT defaults to -O3 when using clang.
And before that it is ?='ed to -O9.  But that -O9 didn't make it into
the gcc calls when I tried compiling with Q=0.


To test, make kama however you normally do, then:

   cd src/modules/app_perl
   rm kamailioxs.o
   make kamailioxs.o Q=0

copy the resulting cc line, replacing -c with -S and kamailioxs.o with
kamailioxs.s and search for sv2int_str in that kamailioxs.s.

-JimC
-- 
James Cloos <cloos at jhcloos.com>         OpenPGP: 0x997A9F17ED7DAEA6


-- 
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1012#issuecomment-284442048
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20170306/48254eb8/attachment.html>


More information about the sr-dev mailing list