>>>>> "DM" == Daniel-Constantin Mierla <notifications@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@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@jhcloos.com> OpenPGP: 0x997A9F17ED7DAEA6


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.