in reply to SAP::Rfc module with unicode

My guess would be that the wrong mix of libraries have been linked.

AFAICT, Rfc.xs itself does not directly reference memsetU16, it uses memsetU instead, which presumably is mapped to memsetU16 (the UTF-16 variant — also see an old proposal) somewhere in one of the SAP libs when compiled with Unicode support. The correct library which provides the implementation of the symbol, however, doesn't seem to have been specified to the linker... (which - with memsetU16 being an indirect dependency - wouldn't necessarily produce an error at build-time, but only at run-time...)

I can't be more specific (as I don't have the SAP libs), but the following tools might help to narrow down on where the problem lies:  ldd (list shared lib dependencies), and nm or objdump (list symbols a lib provides/references).  For example, try

$ ldd ./blib/arch/auto/SAP/Rfc/Rfc.so

to find out which (SAP-)libs the module's XS component has in fact been linked against (and what they map to at load time).  Then something like

$ objdump -tT /path/to/sap-libs/libsapu16.so | grep memsetU $ objdump -ftT /path/to/sap-libs/* | grep 'file format\|memsetU'

to hunt for which libs implement (type ".text") or reference (type "*UND*") the respective memsetU* function(s) ... — You get the idea.   (As I said, my guess would be that the lib which does provide memsetU16 will not show up in the ldd output.)

With that info you'll likely have a better chance of figuring out what went wrong with perl Makefile.PL, and how to fix it...  Good luck!

Replies are listed 'Best First'.
Re^2: SAP::Rfc module with unicode
by Anonymous Monk on Apr 28, 2014 at 10:03 UTC

    I've run into a similar problem now and here are the results from ldd and objdump as mentioned above:


    $ ldd ~/SAP_RFC/INSTALL/lib/perl/5.10.1//auto/SAP/Rfc/Rfc.so linux-vdso.so.1 => (0x00007fff643df000) libm.so.6 => /lib/libm.so.6 (0x00007f0882898000) libdl.so.2 => /lib/libdl.so.2 (0x00007f0882694000) libpthread.so.0 => /lib/libpthread.so.0 (0x00007f0882477000) libc.so.6 => /lib/libc.so.6 (0x00007f0882115000) libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f0881e01000) librfcum.so => ~/SAP_RFC/rfcsdk//lib/librfcum.so (0x00007f0881 +749000) /lib64/ld-linux-x86-64.so.2 (0x00007f0882d36000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f0881533000) librt.so.1 => /lib/librt.so.1 (0x00007f088132b000)

    $ objdump -tT ~/SAP_RFC/rfcsdk/lib/libsapu16.so | grep memsetU 0000000000008640 g F .text 00000000000001c6 memsetU1 +6 00000000000089fc g F .text 000000000000000a memsetU 0000000000008640 g DF .text 00000000000001c6 Base memsetU1 +6 00000000000089fc g DF .text 000000000000000a Base memsetU

    $ objdump -ftT ~/SAP_RFC/rfcsdk/lib/* | grep 'file format\|memsetU' ~/SAP_RFC/rfcsdk/lib/libicudata.so.34: file format elf64-x86-64 ~/SAP_RFC/rfcsdk/lib/libicui18n.so.34: file format elf64-x86-64 ~/SAP_RFC/rfcsdk/lib/libicuuc.so.34: file format elf64-x86-64 objdump: rfcilib.o: not a dynamic object rfcilib.o: file format elf64-x86-64 0000000000000000 *UND* 0000000000000000 memsetU16 objdump: cpictlib.o: not a dynamic object cpictlib.o: file format elf64-x86-64 00000000000057d0 g F .text.hot 00000000000001c6 memsetU16 000000000005445e g F .text.unlikely 000000000000000a memsetU objdump: rsec4lib.o: not a dynamic object objdump: rsec4lib.o: file format elf64-x86-64 rscpa0lib.o: not a dynamic object rscpa0lib.o: file format elf64-x86-64 0000000000000000 *UND* 0000000000000000 memsetU16 objdump: rscpuc2lib.o: not a dynamic object rscpuc2lib.o: file format elf64-x86-64 ~/SAP_RFC/rfcsdk/lib/librfcum.so: file format elf64-x86-64 00000000001fecf0 l F .text 00000000000001e3 memsetU1 +6 00000000001ec78e l F .text 000000000000000a memsetU ~/SAP_RFC/rfcsdk/lib/libsapu16_mt.so: file format elf64-x86-64 0000000000008ba0 g F .text 00000000000001e3 memsetU1 +6 0000000000008d97 g F .text 000000000000000a memsetU 0000000000008ba0 g DF .text 00000000000001e3 Base memsetU1 +6 0000000000008d97 g DF .text 000000000000000a Base memsetU ~/SAP_RFC/rfcsdk/lib/libsapu16.so: file format elf64-x86-64 0000000000008640 g F .text 00000000000001c6 memsetU1 +6 00000000000089fc g F .text 000000000000000a memsetU 0000000000008640 g DF .text 00000000000001c6 Base memsetU1 +6 00000000000089fc g DF .text 000000000000000a Base memsetU ~/SAP_RFC/rfcsdk/lib/libsapucum.so: file format elf64-x86-64 0000000000038d90 g F .text 00000000000001e3 memsetU1 +6 000000000002ce6e g F .text 000000000000000a memsetU 0000000000038d90 g DF .text 00000000000001e3 libsapucum.so memset +U16 000000000002ce6e g DF .text 000000000000000a libsapucum.so memset +U