On Thursday 07 May 2015 01:55:24 Schulhof, Gabriel wrote:
> Hi!
> 
> nm -a out/linux/x86_64/release/liboctbstack.so | grep ' U ' | grep -v
> 'GLIBC' 
> U coap_delete_list
> U coap_insert
> U coap_new_listnode

Hint: you can use ldd to ask for undefined symbols.

$ ldd -d -r out/linux/x86_64/release/liboctbstack.so
        linux-vdso.so.1 (0x00007fffb011c000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f0823785000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f0823568000)
        librt.so.1 => /lib64/librt.so.1 (0x00007f082335f000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f082305e000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f0822cb7000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f0823be5000)
undefined symbol: coap_insert   (out/linux/x86_64/release/liboctbstack.so)
undefined symbol: coap_delete_list      
(out/linux/x86_64/release/liboctbstack.so)
undefined symbol: coap_new_listnode     
(out/linux/x86_64/release/liboctbstack.so)

Also read: I can reproduce the problem.

> It's very strange that these symbols are missing since they seem to be
> provided by libcoap.a, and libcoap.a is being included in
> liboctbstack.so ...

That's caused by the fact that we're using static libraries and that the order 
of static libraries matters. The link command-line is:

gcc -o out/linux/x86_64/release/resource/csdk/liboctbstack.so 
[other options] -lrt -lcoap -lm -lpthread -lconnectivity_abstraction

But libconnectivity_abstraction.a requires libcoap.a. The order of the 
declarations needs to be the opposite. But I won't make that change because it 
appears that libconnectivity_abstraction.a is used in a lot of places.

So instead, let me ask: why do we need libconnectivity_abstraction.a? My 
suggestion is to nuke it and move everything into the stack library.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

Reply via email to