Module: kamailio Branch: master Commit: 373e99fd593814b55b307d0dc4a29e0c53f34850 URL: https://github.com/kamailio/kamailio/commit/373e99fd593814b55b307d0dc4a29e0c...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2017-12-10T09:21:52+01:00
db_berkeley: removed inline declaration that break the linking
---
Modified: src/modules/db_berkeley/bdb_lib.c Modified: src/modules/db_berkeley/km_bdb_val.c
---
Diff: https://github.com/kamailio/kamailio/commit/373e99fd593814b55b307d0dc4a29e0c... Patch: https://github.com/kamailio/kamailio/commit/373e99fd593814b55b307d0dc4a29e0c...
---
diff --git a/src/modules/db_berkeley/bdb_lib.c b/src/modules/db_berkeley/bdb_lib.c index bded92e764..4b109dde3b 100644 --- a/src/modules/db_berkeley/bdb_lib.c +++ b/src/modules/db_berkeley/bdb_lib.c @@ -972,7 +972,7 @@ int load_metadata_defaults(bdb_table_p _tp) return 0; }
-inline int bdb_int2str(int _v, char* _s, int* _l) +int bdb_int2str(int _v, char* _s, int* _l) { int ret;
@@ -991,7 +991,7 @@ inline int bdb_int2str(int _v, char* _s, int* _l) return 0; }
-inline int bdb_double2str(double _v, char* _s, int* _l) +int bdb_double2str(double _v, char* _s, int* _l) { int ret;
@@ -1010,7 +1010,7 @@ inline int bdb_double2str(double _v, char* _s, int* _l) return 0; }
-inline int bdb_time2str(time_t _v, char* _s, int* _l) +int bdb_time2str(time_t _v, char* _s, int* _l) { struct tm* t; int l; diff --git a/src/modules/db_berkeley/km_bdb_val.c b/src/modules/db_berkeley/km_bdb_val.c index 6689be7cdb..c5bbfe8d9d 100644 --- a/src/modules/db_berkeley/km_bdb_val.c +++ b/src/modules/db_berkeley/km_bdb_val.c @@ -48,7 +48,7 @@ * should be done in the val2str function, as some databases * like db_berkeley don't need or like this at all. */ -inline int km_bdb_time2str(time_t _v, char* _s, int* _l) +int km_bdb_time2str(time_t _v, char* _s, int* _l) { struct tm* t; int l;
Am Sonntag, 10. Dezember 2017, 09:31:20 CET schrieb Daniel-Constantin Mierla:
[...] Commit: 373e99fd593814b55b307d0dc4a29e0c53f34850 URL: https://github.com/kamailio/kamailio/commit/373e99fd593814b55b307d0dc4a29e0 c53f34850
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2017-12-10T09:21:52+01:00
db_berkeley: removed inline declaration that break the linking
[..]
Good morning Daniel,
can you elaborate about this changes? This functions in the end were inline by a reason, they are small conversion functions and can (and maybe should) be inlined for performance reasons.
Is this something related to new linker or compiler warnings?
Thanks and regards,
Henning
Hello,
On 10.12.17 09:40, Henning Westerholt wrote:
Am Sonntag, 10. Dezember 2017, 09:31:20 CET schrieb Daniel-Constantin Mierla:
[...] Commit: 373e99fd593814b55b307d0dc4a29e0c53f34850 URL: https://github.com/kamailio/kamailio/commit/373e99fd593814b55b307d0dc4a29e0 c53f34850
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2017-12-10T09:21:52+01:00
db_berkeley: removed inline declaration that break the linking
[..]
Good morning Daniel,
can you elaborate about this changes? This functions in the end were inline by a reason, they are small conversion functions and can (and maybe should) be inlined for performance reasons.
Is this something related to new linker or compiler warnings?
the commits from this weekend that removed inline for several functions were done because loading the modules on debian stretch threw undefined symbol errors, like:
0(28818) ERROR: <core> [core/sr_module.c:582]: load_module(): could not open module <src/modules/ims_usrloc_scscf/ims_usrloc_scscf.so>: src/modules/ims_usrloc_scscf/ims_usrloc_scscf.so: undefined symbol: aor_to_contact 0(28818) CRITICAL: <core> [core/cfg.y:3446]: yyerror_at(): parse error in config file /home/porto/work/sip/esr/kamailio-dev/../etc/kamailio-allmods.cfg, line 93, column 12-32: failed to load module
These messages I saved, but for the rest of the modules were similar errors.
The gcc version was:
gcc --version gcc (Debian 6.3.0-18) 6.3.0 20170516
Probably I could have investigated more and see if doing static inline would be ok in these cases -- I did many conversions in the past few years of the inline functions, adding static didn't work always because the functions were used in other files and I tried to avoid playing with external inline declarations. Apart of the ims modules which I don't have a clear picture about the use of this functions, the rest were module used rarely these days (berkeley db and diameter) -- I tested in preparation of kamailio v5.1.0 to be sure there are no missing symbols and I took the fastest path for a fix, but if anyone wants to test with static inline or do external inline whenever is the case, I am fine with.
Cheers, Daniel