Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

symbol lookup fails on DPDK built with shared library mode #599

Closed
syuu1228 opened this issue Mar 21, 2015 · 3 comments
Closed

symbol lookup fails on DPDK built with shared library mode #599

syuu1228 opened this issue Mar 21, 2015 · 3 comments

Comments

@syuu1228
Copy link
Contributor

When CONFIG_RTE_BUILD_SHARED_LIB=y, DPDK app fails symbol lookup:

Failed looking up symbol rte_logs

It caused inside of for loop at object::load_needed(), just after _prog.load_object("librte_pmd_ring.so.1").
When load_object called, it calls program::lookup("rte_logs"), but librte_pmd_ring.so.1 doesn't linked to librte_eal.so.1, so symbol lookup will failed.

Probably it because DPDK app is linking to all DPDK shared libraries, but libraries itself doesn't linked with each other:

[syuu@devil osv.7]$ ldd ~/dpdk-osv/x86_64-native-osvapp-gcc/app/test
    linux-vdso.so.1 =>  (0x00007ffffc5fe000)
    librte_pmd_ring.so.1 => not found
    librte_distributor.so.1 => not found
    librte_reorder.so.1 => not found
    librte_pipeline.so.1 => not found
    librte_table.so.1 => not found
    librte_port.so.1 => not found
    librte_timer.so.1 => not found
    librte_hash.so.1 => not found
    librte_jobstats.so.1 => not found
    librte_lpm.so.1 => not found
    librte_power.so.1 => not found
    librte_acl.so.1 => not found
    librte_meter.so.1 => not found
    librte_sched.so.1 => not found
    libm.so.6 => /lib64/libm.so.6 (0x00007f886dcfe000)
    librt.so.1 => /lib64/librt.so.1 (0x00007f886daf6000)
    librte_kvargs.so.1 => not found
    librte_mbuf.so.1 => not found
    librte_ip_frag.so.1 => not found
    libethdev.so.1 => not found
    librte_malloc.so.1 => not found
    librte_mempool.so.1 => not found
    librte_ring.so.1 => not found
    librte_eal.so.1 => not found
    librte_cmdline.so.1 => not found
    librte_cfgfile.so.1 => not found
    librte_pmd_bond.so.1 => not found
    libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f886d8db000)
    libdl.so.2 => /lib64/libdl.so.2 (0x00007f886d6d6000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f886d4ba000)
    libc.so.6 => /lib64/libc.so.6 (0x00007f886d0fd000)
[syuu@devil osv.7]$ ldd ~/dpdk-osv/x86_64-native-osvapp-gcc/lib/librte_pmd_ring.so.1
    linux-vdso.so.1 =>  (0x00007fff32ca0000)
    libc.so.6 => /lib64/libc.so.6 (0x00007f7743dd2000)
    /lib64/ld-linux-x86-64.so.2 (0x00000032ed400000)
@nyh
Copy link
Contributor

nyh commented Mar 21, 2015

On Sat, Mar 21, 2015 at 4:43 AM, Takuya ASADA notifications@github.com
wrote:

When CONFIG_RTE_BUILD_SHARED_LIB=y, DPDK app fails symbol lookup:

Failed looking up symbol rte_logs

It caused inside of for loop at object::load_needed(), just after
_prog.load_object("librte_pmd_ring.so.1").
When load_object called, it calls program::lookup("rte_logs"), but
librte_pmd_ring.so.1 doesn't linked to librte_eal.so.1, so symbol lookup
will failed.

If this works on Linux despite the missing DT_NEEDED dependency, it is
possible that by "luck", the specific load order that Linux used happened
to load librte_pmd_ring.so.1 first, before librte_pmd_ring.so.1. If we make
sure our load order is identical to that of Linux, we won't have this
problem. Having exactly the same load order is the topic of issue 334.
We're almost there, but not quite: we use DFS order, Linux uses BFS.

In any case, would be nicer if the different DPDK libraries had correct
DT_NEEDED dependencies (i.e., what you said "linked with"), and we didn't
have to rely on the load order.

@syuu1228
Copy link
Contributor Author

Okay, so this is DPDK problem. I'll try to fix dependencies on DPDK then.

@syuu1228
Copy link
Contributor Author

syuu1228 commented Apr 6, 2015

I could load shared library version of DPDK using CONFIG_RTE_BUILD_COMBINE_LIBS = y.

@syuu1228 syuu1228 closed this as completed Apr 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants