Linking error with DPDK 17.11.4 during compilation

Bug #1878390 reported by Jean Prince MELLO NGUIE
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dpdk (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Hello everybody,

Just in case where you are still facing to below issue and you are still wondering how to solve that ?

I had faced to below linking error but only when I had tried to compile my application with DPDK 17.11.4
Below the Virtual Machine configuration I had used :
Platform : VM
Architecture : x86_64 bits
Distrib : Ubuntu 18.04
GCC : 7.5.0
GLIBC : 2.27
Linux kernel version : 4.18.0-25-generic

/usr/lib/x86_64-linux-gnu/libmvec_nonshared.a(svml_finite_alias.oS): In function `_ZGVbN2v___log_finite':
(.text+0x0): multiple definition of `_ZGVbN2v___log_finite'
/usr/lib/x86_64-linux-gnu/libmvec_nonshared.a(svml_finite_alias.oS):(.text+0x0): first defined here
/usr/lib/x86_64-linux-gnu/libmvec_nonshared.a(svml_finite_alias.oS): In function `_ZGVcN4v___log_finite':
/usr/lib/x86_64-linux-gnu/libmvec_nonshared.a(svml_finite_alias.oS):(.text+0x20): first defined here
/usr/lib/x86_64-linux-gnu/libmvec_nonshared.a(svml_finite_alias.oS): In function `_ZGVeN8v___log_finite':
(.text+0x30): multiple definition of `_ZGVeN8v___log_finite'
/usr/lib/x86_64-linux-gnu/libmvec_nonshared.a(svml_finite_alias.oS):(.text+0x30): first defined here
/usr/lib/x86_64-linux-gnu/libmvec_nonshared.a(svml_finite_alias.oS): In function `_ZGVbN4v___logf_finite':
(.text+0x40): multiple definition of `_ZGVbN4v___logf_finite'
...
...
/usr/lib/x86_64-linux-gnu/libmvec_nonshared.a(svml_finite_alias.oS):(.text+0x170): first defined here
collect2: error: ld returned 1 exit status
GNUmakefile:84: recipe for target 'my_app' failed
make: *** [my_app] Error 1

To solve that, I had proceeded as below :
***********************************************************************************************
cd dpdk-stable-17.11.4
rm -rf build/.config*
echo "CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD=n" >> config/defconfig_x86_64-native-linuxapp-gcc
make config T=x86_64-native-linuxapp-gcc
make
***********************************************************************************************

And when I had recompiled my app, it was working well.

Hoping it will be helpful.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Thanks, you might have otherwise needed to link against the THUNDERX_NICVF_PMD.

I'll be setting this to invalid as there is nothing we can do on Ubuntu packaging to resolve this, but it is good info for anyone else affected.

If more are hitting this please leave a not that I can revisit it if it is a real underlying issue.

Note: in later releases dpdk provides a pkg-config file (the way this is done right) which will give you the right includes to build against DPDK (better than the old linker script).
See: https://salsa.debian.org/debian/dpdk/-/blob/unstable/debian/dpdk-doc.README.Debian#L33

Changed in dpdk (Ubuntu):
status: New → Invalid
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Also
 /usr/lib/x86_64-linux-gnu/libmvec_nonshared.a
isn't part of any package
these would be
$ dpkg -L libc6 libc6-dev | grep ibmvec
/lib/x86_64-linux-gnu/libmvec-2.31.so
/lib/x86_64-linux-gnu/libmvec.so.1
/usr/lib/x86_64-linux-gnu/libmvec.a
/usr/lib/x86_64-linux-gnu/libmvec.so

Is that a build artifact of yours?

Revision history for this message
Jean Prince MELLO NGUIE (melloprince) wrote :

Hello Christian,

Thanks for your response.

In fact the libmvec_nonshared.a library seems to be a part of libm.so.6 library with GLIBC 2.27
It is not my build artifact, I never install it. I'm getting below results on my system :

$ dpkg -L libc6 libc6-dev | grep ibmvec
/lib/x86_64-linux-gnu/libmvec-2.27.so
/lib/x86_64-linux-gnu/libmvec.so.1
/usr/lib/x86_64-linux-gnu/libmvec.a
/usr/lib/x86_64-linux-gnu/libmvec_nonshared.a
/usr/lib/x86_64-linux-gnu/libmvec.so

$ strings /usr/lib/x86_64-linux-gnu/libm.a
/* GNU ld script
OUTPUT_FORMAT(elf64-x86-64)
GROUP ( /usr/lib/x86_64-linux-gnu/libm-2.27.a /usr/lib/x86_64-linux-gnu/libmvec.a )

$ strings /usr/lib/x86_64-linux-gnu/libm.so
/* GNU ld script
OUTPUT_FORMAT(elf64-x86-64)
GROUP ( /lib/x86_64-linux-gnu/libm.so.6 AS_NEEDED ( /usr/lib/x86_64-linux-gnu/libmvec_nonshared.a /lib/x86_64-linux-gnu/libmvec.so.1 ) )

As you can see libmvec_nonshared.a is required by libm.so.6
So, may be it is only specific to GLIBC 2.27 and since has been fixed in GLIBC 2.31

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Ah yeah, thanks for your repliy.
I rechecked and found that it is version dependent.
You are on 18.04 and there libmvec_nonshared.a is a thing, while in later releases it is gone.

TBH I have no context info on what this _nonshared variant is about without checking it in detail. But it is very odd that an ARM related PMD (thunderx) is related to it in your build.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.