[dpdk-dev] [PATCH v2] mk: fix ABI versioning compile error for combined shared library

2015-11-03 Thread Panu Matilainen
On 11/03/2015 01:33 PM, Ferruh Yigit wrote:
> On Tue, Nov 03, 2015 at 12:41:10PM +0200, Panu Matilainen wrote:
>> On 11/03/2015 11:20 AM, Ferruh Yigit wrote:
>>> On Tue, Nov 03, 2015 at 09:06:05AM +0200, Panu Matilainen wrote:
 On 11/02/2015 05:23 PM, Ferruh Yigit wrote:
> Fixes following error:
>  LD libdpdk.so
>  /usr/bin/ld: /root/dpdk/build/lib/libdpdk.so: version node not found
>  for symbol @DPDK_x.y
>
> Defines version symbols in a fixed path libdpdk.map file and this
> value hardcoded into makefile

 Hold on. What problem is this supposed to be fixing?
>>> This patch is to fix combined library compilation error when ABI versining 
>>> used.
>>> Currently if ABI version macros used (VERSION_SYMBOL), we are not able to 
>>> compile combined shared library.
>>>
 If its for the bonding thing (as it'd appear from the threading), NAK.
>>> Nothing directly related to the bonding, just issue observed in this thread.
>>
>> Okay, understood, it was just not clear from the description. Since there
>> are no users of VERSION_SYMBOL etc macros this error has not come up until
>> now.
>>
>>>
 The symbol versioning in
 that patch is confused needs to be fixed there instead of inventing strange
 workarounds elsewhere.

>>> This is not intented to be a workaround but a fix, unless you have a better 
>>> idea.
>>
>> The problem is, it undoes the other benefit of symbol versioning: hiding the
>> internal symbols. So in my eyes its more of a hack or a workaround than a
>> fix.
>>
>> I'd much much rather see this as a solution:
>> http://dpdk.org/dev/patchwork/patch/4262/
>>
> What I observed from this, how/why combined library should be generated is 
> under question, from that perspective I agree this patch is a hack.
> If current method is used, this patch just fixes compile error, also patch is 
> not related to versioning in combined library, which is still broken.

The linker script eliminates the whole versioning problem because it 
just makes the actual individual libraries *appear* as a single entity 
during build-time, whereas the current approach physically lumps it all 
together.

- Panu -




[dpdk-dev] [PATCH v2] mk: fix ABI versioning compile error for combined shared library

2015-11-03 Thread Panu Matilainen
On 11/03/2015 11:20 AM, Ferruh Yigit wrote:
> On Tue, Nov 03, 2015 at 09:06:05AM +0200, Panu Matilainen wrote:
>> On 11/02/2015 05:23 PM, Ferruh Yigit wrote:
>>> Fixes following error:
>>> LD libdpdk.so
>>> /usr/bin/ld: /root/dpdk/build/lib/libdpdk.so: version node not found
>>> for symbol @DPDK_x.y
>>>
>>> Defines version symbols in a fixed path libdpdk.map file and this
>>> value hardcoded into makefile
>>
>> Hold on. What problem is this supposed to be fixing?
> This patch is to fix combined library compilation error when ABI versining 
> used.
> Currently if ABI version macros used (VERSION_SYMBOL), we are not able to 
> compile combined shared library.
>
>> If its for the bonding thing (as it'd appear from the threading), NAK.
> Nothing directly related to the bonding, just issue observed in this thread.

Okay, understood, it was just not clear from the description. Since 
there are no users of VERSION_SYMBOL etc macros this error has not come 
up until now.

>
>> The symbol versioning in
>> that patch is confused needs to be fixed there instead of inventing strange
>> workarounds elsewhere.
>>
> This is not intented to be a workaround but a fix, unless you have a better 
> idea.

The problem is, it undoes the other benefit of symbol versioning: hiding 
the internal symbols. So in my eyes its more of a hack or a workaround 
than a fix.

I'd much much rather see this as a solution:
http://dpdk.org/dev/patchwork/patch/4262/

- Panu -


>
>



[dpdk-dev] [PATCH v2] mk: fix ABI versioning compile error for combined shared library

2015-11-03 Thread Ferruh Yigit
On Tue, Nov 03, 2015 at 12:41:10PM +0200, Panu Matilainen wrote:
> On 11/03/2015 11:20 AM, Ferruh Yigit wrote:
>> On Tue, Nov 03, 2015 at 09:06:05AM +0200, Panu Matilainen wrote:
>>> On 11/02/2015 05:23 PM, Ferruh Yigit wrote:
 Fixes following error:
 LD libdpdk.so
 /usr/bin/ld: /root/dpdk/build/lib/libdpdk.so: version node not found
 for symbol @DPDK_x.y

 Defines version symbols in a fixed path libdpdk.map file and this
 value hardcoded into makefile
>>>
>>> Hold on. What problem is this supposed to be fixing?
>> This patch is to fix combined library compilation error when ABI versining 
>> used.
>> Currently if ABI version macros used (VERSION_SYMBOL), we are not able to 
>> compile combined shared library.
>>
>>> If its for the bonding thing (as it'd appear from the threading), NAK.
>> Nothing directly related to the bonding, just issue observed in this thread.
>
> Okay, understood, it was just not clear from the description. Since there 
> are no users of VERSION_SYMBOL etc macros this error has not come up until 
> now.
>
>>
>>> The symbol versioning in
>>> that patch is confused needs to be fixed there instead of inventing strange
>>> workarounds elsewhere.
>>>
>> This is not intented to be a workaround but a fix, unless you have a better 
>> idea.
>
> The problem is, it undoes the other benefit of symbol versioning: hiding the 
> internal symbols. So in my eyes its more of a hack or a workaround than a 
> fix.
>
> I'd much much rather see this as a solution:
> http://dpdk.org/dev/patchwork/patch/4262/
>
What I observed from this, how/why combined library should be generated is 
under question, from that perspective I agree this patch is a hack.
If current method is used, this patch just fixes compile error, also patch is 
not related to versioning in combined library, which is still broken.

Thanks,
ferruh

>   - Panu -


[dpdk-dev] [PATCH v2] mk: fix ABI versioning compile error for combined shared library

2015-11-03 Thread Ferruh Yigit
On Tue, Nov 03, 2015 at 09:06:05AM +0200, Panu Matilainen wrote:
> On 11/02/2015 05:23 PM, Ferruh Yigit wrote:
>> Fixes following error:
>>LD libdpdk.so
>>/usr/bin/ld: /root/dpdk/build/lib/libdpdk.so: version node not found
>>for symbol @DPDK_x.y
>>
>> Defines version symbols in a fixed path libdpdk.map file and this
>> value hardcoded into makefile
>
> Hold on. What problem is this supposed to be fixing?
This patch is to fix combined library compilation error when ABI versining used.
Currently if ABI version macros used (VERSION_SYMBOL), we are not able to 
compile combined shared library.

> If its for the bonding thing (as it'd appear from the threading), NAK. 
Nothing directly related to the bonding, just issue observed in this thread.

> The symbol versioning in 
> that patch is confused needs to be fixed there instead of inventing strange 
> workarounds elsewhere.
>
This is not intented to be a workaround but a fix, unless you have a better 
idea.

ferruh




[dpdk-dev] [PATCH v2] mk: fix ABI versioning compile error for combined shared library

2015-11-03 Thread Panu Matilainen
On 11/02/2015 05:23 PM, Ferruh Yigit wrote:
> Fixes following error:
>LD libdpdk.so
>/usr/bin/ld: /root/dpdk/build/lib/libdpdk.so: version node not found
>for symbol @DPDK_x.y
>
> Defines version symbols in a fixed path libdpdk.map file and this
> value hardcoded into makefile

Hold on. What problem is this supposed to be fixing? If its for the 
bonding thing (as it'd appear from the threading), NAK. The symbol 
versioning in that patch is confused needs to be fixed there instead of 
inventing strange workarounds elsewhere.

- Panu -


[dpdk-dev] [PATCH v2] mk: fix ABI versioning compile error for combined shared library

2015-11-02 Thread Ferruh Yigit
On Mon, Nov 02, 2015 at 05:26:21PM +0100, Thomas Monjalon wrote:
> 2015-11-02 15:23, Ferruh Yigit:
> > +ifeq ($(COMBINED_BUILD),1)
> >  include $(RTE_SDK)/mk/rte.sharelib.mk
> > +endif
> 
> Why this ifeq?
> rte.sharelib.mk is always used for combined lib.
> 

When combine lib config selected, other libraries still build
And all libraris include sharelib.mk
This cause CPU_LDFLAGS conflict, the CPU_LDFLAGS set specially for combined lib 
used by all libraries.

When not linking combined library, there is no need/benefit of including 
sharelib.mk
COMBINED_BUILD only set when linking combined library and that is when 
sharelib.mk included

I can try to prevent linking other libraries when combined library enabled, 
then sharelib.mk included only for combined lib, and we can remove that check.
But I am not sure how hard it is, and does it worth spending extra effort to it?

Thanks,
ferruh


[dpdk-dev] [PATCH v2] mk: fix ABI versioning compile error for combined shared library

2015-11-02 Thread Thomas Monjalon
2015-11-02 15:23, Ferruh Yigit:
> +ifeq ($(COMBINED_BUILD),1)
>  include $(RTE_SDK)/mk/rte.sharelib.mk
> +endif

Why this ifeq?
rte.sharelib.mk is always used for combined lib.



[dpdk-dev] [PATCH v2] mk: fix ABI versioning compile error for combined shared library

2015-11-02 Thread Ferruh Yigit
Fixes following error:
  LD libdpdk.so
  /usr/bin/ld: /root/dpdk/build/lib/libdpdk.so: version node not found
  for symbol @DPDK_x.y

Defines version symbols in a fixed path libdpdk.map file and this
value hardcoded into makefile

Signed-off-by: Ferruh Yigit 
---
 drivers/net/Makefile |  3 +++
 lib/Makefile |  3 +++
 lib/libdpdk.map  | 12 
 mk/rte.sdkbuild.mk   |  2 +-
 mk/rte.sharelib.mk   |  1 +
 5 files changed, 20 insertions(+), 1 deletion(-)
 create mode 100644 lib/libdpdk.map

diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index 6da1ce2..d30018c 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -50,5 +50,8 @@ DIRS-$(CONFIG_RTE_LIBRTE_VIRTIO_PMD) += virtio
 DIRS-$(CONFIG_RTE_LIBRTE_VMXNET3_PMD) += vmxnet3
 DIRS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += xenvirt

+ifeq ($(COMBINED_BUILD),1)
 include $(RTE_SDK)/mk/rte.sharelib.mk
+endif
+
 include $(RTE_SDK)/mk/rte.subdir.mk
diff --git a/lib/Makefile b/lib/Makefile
index 9727b83..33d76a6 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -62,5 +62,8 @@ DIRS-$(CONFIG_RTE_LIBRTE_KNI) += librte_kni
 DIRS-$(CONFIG_RTE_LIBRTE_IVSHMEM) += librte_ivshmem
 endif

+ifeq ($(COMBINED_BUILD),1)
 include $(RTE_SDK)/mk/rte.sharelib.mk
+endif
+
 include $(RTE_SDK)/mk/rte.subdir.mk
diff --git a/lib/libdpdk.map b/lib/libdpdk.map
new file mode 100644
index 000..3988a3f
--- /dev/null
+++ b/lib/libdpdk.map
@@ -0,0 +1,12 @@
+DPDK_2.0 {
+
+};
+
+DPDK_2.1 {
+
+} DPDK_2.0;
+
+DPDK_2.2 {
+
+} DPDK_2.1;
+
diff --git a/mk/rte.sdkbuild.mk b/mk/rte.sdkbuild.mk
index 38ec7bd..d4e3abf 100644
--- a/mk/rte.sdkbuild.mk
+++ b/mk/rte.sdkbuild.mk
@@ -94,7 +94,7 @@ $(ROOTDIRS-y):
@echo "== Build $@"
$(Q)$(MAKE) S=$@ -f $(RTE_SRCDIR)/$@/Makefile -C $(BUILDDIR)/$@ all
@if [ $@ = drivers -a $(CONFIG_RTE_BUILD_COMBINE_LIBS) = y ]; then \
-   $(MAKE) -f $(RTE_SDK)/lib/Makefile sharelib; \
+   COMBINED_BUILD=1 $(MAKE) -f $(RTE_SDK)/lib/Makefile sharelib; \
fi

 %_clean:
diff --git a/mk/rte.sharelib.mk b/mk/rte.sharelib.mk
index 7bb7219..1f71fcb 100644
--- a/mk/rte.sharelib.mk
+++ b/mk/rte.sharelib.mk
@@ -40,6 +40,7 @@ LIB_ONE := lib$(RTE_LIBNAME).so
 else
 LIB_ONE := lib$(RTE_LIBNAME).a
 endif
+CPU_LDFLAGS += --version-script=$(SRCDIR)/lib/libdpdk.map
 endif

 .PHONY:sharelib
-- 
1.9.3