Merge Ubuntu DPDK packaging as of 15th June 2016
[deb_dpdk.git] / debian / patches / ubuntu-backport-40-linking-fixes-stage-1-4.patch
1 Description: backport of dpdk 16.07 fix for library underlinking - stage 1/4
2
3 This is a merge of related upstream fixes:
4 - c6417ce6: mk: add build-time library directory to linker path
5 - aace9d0b: mk: cleanup leftover references to malloc library
6 - bf5a46fa: mk: generate internal library dependencies
7
8 Forwarded: yes (in DPDK 16.07)
9 Author: Christian Ehrhardt <christian.ehrhardt@canonical.com>
10 Last-Update: 2016-06-14
11
12 Index: dpdk/drivers/net/cxgbe/Makefile
13 ===================================================================
14 --- dpdk.orig/drivers/net/cxgbe/Makefile
15 +++ dpdk/drivers/net/cxgbe/Makefile
16 @@ -82,6 +82,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += t
17  # this lib depends upon:
18  DEPDIRS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += lib/librte_eal lib/librte_ether
19  DEPDIRS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += lib/librte_mempool lib/librte_mbuf
20 -DEPDIRS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += lib/librte_net lib/librte_malloc
21 +DEPDIRS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += lib/librte_net
22  
23  include $(RTE_SDK)/mk/rte.lib.mk
24 Index: dpdk/drivers/net/ena/Makefile
25 ===================================================================
26 --- dpdk.orig/drivers/net/ena/Makefile
27 +++ dpdk/drivers/net/ena/Makefile
28 @@ -54,7 +54,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_ENA_PMD) += ena
29  # this lib depends upon:
30  DEPDIRS-$(CONFIG_RTE_LIBRTE_ENA_PMD) += lib/librte_eal lib/librte_ether
31  DEPDIRS-$(CONFIG_RTE_LIBRTE_ENA_PMD) += lib/librte_mempool lib/librte_mbuf
32 -DEPDIRS-$(CONFIG_RTE_LIBRTE_ENA_PMD) += lib/librte_net lib/librte_malloc
33 +DEPDIRS-$(CONFIG_RTE_LIBRTE_ENA_PMD) += lib/librte_net
34  
35  CFLAGS += $(INCLUDES)
36  
37 Index: dpdk/drivers/net/mpipe/Makefile
38 ===================================================================
39 --- dpdk.orig/drivers/net/mpipe/Makefile
40 +++ dpdk/drivers/net/mpipe/Makefile
41 @@ -42,6 +42,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_MPIPE_PMD) += m
42  
43  DEPDIRS-$(CONFIG_RTE_LIBRTE_MPIPE_PMD) += lib/librte_eal lib/librte_ether
44  DEPDIRS-$(CONFIG_RTE_LIBRTE_MPIPE_PMD) += lib/librte_mempool lib/librte_mbuf
45 -DEPDIRS-$(CONFIG_RTE_LIBRTE_MPIPE_PMD) += lib/librte_net lib/librte_malloc
46 +DEPDIRS-$(CONFIG_RTE_LIBRTE_MPIPE_PMD) += lib/librte_net
47  
48  include $(RTE_SDK)/mk/rte.lib.mk
49 Index: dpdk/drivers/net/nfp/Makefile
50 ===================================================================
51 --- dpdk.orig/drivers/net/nfp/Makefile
52 +++ dpdk/drivers/net/nfp/Makefile
53 @@ -53,6 +53,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_NFP_PMD) += nfp
54  # this lib depends upon:
55  DEPDIRS-$(CONFIG_RTE_LIBRTE_NFP_PMD) += lib/librte_eal lib/librte_ether
56  DEPDIRS-$(CONFIG_RTE_LIBRTE_NFP_PMD) += lib/librte_mempool lib/librte_mbuf
57 -DEPDIRS-$(CONFIG_RTE_LIBRTE_NFP_PMD) += lib/librte_net lib/librte_malloc
58 +DEPDIRS-$(CONFIG_RTE_LIBRTE_NFP_PMD) += lib/librte_net
59  
60  include $(RTE_SDK)/mk/rte.lib.mk
61 Index: dpdk/drivers/net/szedata2/Makefile
62 ===================================================================
63 --- dpdk.orig/drivers/net/szedata2/Makefile
64 +++ dpdk/drivers/net/szedata2/Makefile
65 @@ -57,7 +57,6 @@ SYMLINK-y-include +=
66  # this lib depends upon:
67  DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_SZEDATA2) += lib/librte_mbuf
68  DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_SZEDATA2) += lib/librte_ether
69 -DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_SZEDATA2) += lib/librte_malloc
70  DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_SZEDATA2) += lib/librte_kvargs
71  
72  include $(RTE_SDK)/mk/rte.lib.mk
73 Index: dpdk/mk/rte.lib.mk
74 ===================================================================
75 --- dpdk.orig/mk/rte.lib.mk
76 +++ dpdk/mk/rte.lib.mk
77 @@ -77,6 +77,13 @@ else
78  _CPU_LDFLAGS := $(CPU_LDFLAGS)
79  endif
80  
81 +# Translate DEPDIRS-y into LDLIBS
82 +# Ignore (sub)directory dependencies which do not provide an actual library
83 +_IGNORE_DIRS = lib/librte_eal/% lib/librte_net lib/librte_compat
84 +_DEPDIRS = $(filter-out $(_IGNORE_DIRS),$(DEPDIRS-y))
85 +_LDDIRS = $(subst librte_ether,libethdev,$(_DEPDIRS))
86 +LDLIBS += $(subst lib/lib,-l,$(_LDDIRS))
87 +
88  O_TO_A = $(AR) crDs $(LIB) $(OBJS-y)
89  O_TO_A_STR = $(subst ','\'',$(O_TO_A)) #'# fix syntax highlight
90  O_TO_A_DISP = $(if $(V),"$(O_TO_A_STR)","  AR $(@)")
91 @@ -86,8 +93,8 @@ O_TO_A_DO = @set -e; \
92         $(O_TO_A) && \
93         echo $(O_TO_A_CMD) > $(call exe2cmd,$(@))
94  
95 -O_TO_S = $(LD) $(_CPU_LDFLAGS) $(EXTRA_LDFLAGS) -shared $(OBJS-y) $(LDLIBS) \
96 -        -Wl,-soname,$(LIB) -o $(LIB)
97 +O_TO_S = $(LD) -L$(RTE_OUTPUT)/lib $(_CPU_LDFLAGS) $(EXTRA_LDFLAGS) \
98 +         -shared $(OBJS-y) $(LDLIBS) -Wl,-soname,$(LIB) -o $(LIB)
99  O_TO_S_STR = $(subst ','\'',$(O_TO_S)) #'# fix syntax highlight
100  O_TO_S_DISP = $(if $(V),"$(O_TO_S_STR)","  LD $(@)")
101  O_TO_S_DO = @set -e; \