App_swift 3 And Asterisk 1.8.13.0 Fails With Undefined Symbol: Swift_port_close

Home » Asterisk Users » App_swift 3 And Asterisk 1.8.13.0 Fails With Undefined Symbol: Swift_port_close
Asterisk Users 1 Comment

All,

I am experiencing this same issue. it seems that you were able to resolve it offline. Could you by any chance post the solution.

telephonics1*CLI> module load app_swift.so Unable to load module app_swift.so Command ‘module load app_swift.so’ failed.
[Aug 1 05:01:01] WARNING[28635]: loader.c:458 load_dynamic_module: Error loading module ‘app_swift.so’: /usr/lib/asterisk/modules/app_swift.so:
undefined symbol: swift_port_close
[Aug 1 05:01:01] WARNING[28635]: loader.c:848 load_resource: Module
‘app_swift.so’ could not be loaded. telephonics1*CLI>

I suspect an issue when linking app_swift.so. Here is how the module is linked:

gcc -shared -Xlinker -x -o app_swift.so -L/opt/swift/lib -L/usr/lib -lswift
-lceplang_en -lceplex_us app_swift.o

However, ldd shows the module doesn’t list libswift.so as a dependency:

# ldd app_swift.so linux-vdso.so.1 => (0x00007fff2bbff000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7cb005e000)
/lib64/ld-linux-x86-64.so.2 (0x00007f7cb0631000)

It appears the libswift.so is build correctly and does export the swift_port_close function:

# readelf -s libswift.so | grep port_close
619: 000000000006ac00 23 FUNC GLOBAL DEFAULT 10
swift_port_close_output
941: 000000000006aec0 224 FUNC GLOBAL DEFAULT 10 swift_port_close
1025: 000000000006aec0 224 FUNC GLOBAL DEFAULT 10 swift_port_close
2082: 000000000006ac00 23 FUNC GLOBAL DEFAULT 10
swift_port_close_output

Any help would be appreciated.

Thanks, Doug Seifert

One thought on - App_swift 3 And Asterisk 1.8.13.0 Fails With Undefined Symbol: Swift_port_close

  • Solving my own issue: The order of linking was incorrect.

    Change the Makefile as follows to solve this issue.

    diff –git a/Makefile b/Makefile index dec892d..90d79df 100644
    — a/Makefile
    +++ b/Makefile
    @@ -73,7 +73,7 @@ all: banner $(AST_INC_CHECK) $(AST_VER_CHECK)
    @echo “”

    $(NAME).so : $(NAME).o
    – $(CC) $(SOLINK) -o $@ $(LDFLAGS) $< + $(CC) $(SOLINK) -o $@ $< $(LDFLAGS) banner: @echo “”