From 8f01de6aa62da9961abf4ffa51a092802b0e6289 Mon Sep 17 00:00:00 2001 From: Aaron Conole Date: Thu, 22 Oct 2015 11:12:20 -0400 Subject: [PATCH] dpdk.spec: linkage and file overlap The dpdk-tools and dpdk packages copy the same files into %{_bindir}, which should be avoided. To fix this, setup an exclude. Additionally, there's an odd requirement imposed by using dpdk because of libraries not being linked in properly against the shared objects generated. To fix this, introduce the dt-needed patch. A version of this has been accepted upstream for some PMDs, but we will do this for all. Signed-off-by: Aaron Conole --- dpdk-2.1-dtneeded.patch | 24 ++++++++++++++++++++++++ dpdk-dtneeded-2.2-accepted.patch | 11 +++++++++++ dpdk.spec | 10 +++++++++- 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 dpdk-2.1-dtneeded.patch create mode 100644 dpdk-dtneeded-2.2-accepted.patch diff --git a/dpdk-2.1-dtneeded.patch b/dpdk-2.1-dtneeded.patch new file mode 100644 index 0000000..7cb220a --- /dev/null +++ b/dpdk-2.1-dtneeded.patch @@ -0,0 +1,24 @@ +diff -up dpdk-2.0.0/lib/librte_eal/linuxapp/eal/Makefile.dtneeded dpdk-2.0.0/lib/librte_eal/linuxapp/eal/Makefile +--- dpdk-2.0.0/lib/librte_eal/linuxapp/eal/Makefile.dtneeded 2015-04-03 17:13:45.000000000 +0300 ++++ dpdk-2.0.0/lib/librte_eal/linuxapp/eal/Makefile 2015-04-17 15:23:38.267984467 +0300 +@@ -53,6 +53,8 @@ CFLAGS += -I$(RTE_SDK)/drivers/net/af_packet + CFLAGS += -I$(RTE_SDK)/lib/librte_ivshmem + CFLAGS += $(WERROR_FLAGS) -O3 + ++LDLIBS += -ldl -lpthread ++ + # specific to linuxapp exec-env + SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) := eal.c + SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_hugepage_info.c +diff -up dpdk-2.1.0/drivers/net/pcap/Makefile.dtneeded dpdk-2.0.0/lib/librte_pmd_pcap/Makefile +--- dpdk-2.1.0/drivers/net/pcap/Makefile.dtneeded 2015-04-03 17:13:45.000000000 +0300 ++++ dpdk-2.1.0/drivers/net/pcap/Makefile 2015-04-17 15:23:38.267984467 +0300 +@@ -37,6 +37,8 @@ include $(RTE_SDK)/mk/rte.vars.mk + # + LIB = librte_pmd_pcap.a + ++LDLIBS += -lpcap ++ + CFLAGS += -O3 + CFLAGS += $(WERROR_FLAGS) + diff --git a/dpdk-dtneeded-2.2-accepted.patch b/dpdk-dtneeded-2.2-accepted.patch new file mode 100644 index 0000000..e437a58 --- /dev/null +++ b/dpdk-dtneeded-2.2-accepted.patch @@ -0,0 +1,11 @@ +diff -up dpdk-2.0.0/lib/librte_vhost/Makefile.dtneeded dpdk-2.0.0/lib/librte_vhost/Makefile +--- dpdk-2.0.0/lib/librte_vhost/Makefile.dtneeded 2015-04-03 17:13:45.000000000 +0300 ++++ dpdk-2.0.0/lib/librte_vhost/Makefile 2015-04-17 15:24:37.593834737 +0300 +@@ -44,6 +44,7 @@ CFLAGS += -I vhost_user + else + CFLAGS += -I vhost_cuse -lfuse + LDFLAGS += -lfuse ++LDLIBS += -lfuse + endif + + ifeq ($(CONFIG_RTE_LIBRTE_VHOST_NUMA),y) diff --git a/dpdk.spec b/dpdk.spec index cf7ad17..1def053 100644 --- a/dpdk.spec +++ b/dpdk.spec @@ -12,6 +12,8 @@ URL: http://dpdk.org Source: http://dpdk.org/browse/dpdk/snapshot/dpdk-%{version}.tar.gz Patch1: enic-pun-fix.patch +Patch2: dpdk-2.1-dtneeded.patch +Patch3: dpdk-dtneeded-2.2-accepted.patch Summary: Set of libraries and drivers for fast packet processing @@ -84,6 +86,8 @@ Requires: kmod pciutils findutils iproute %prep %setup -q %patch1 -p2 -z .enic +%patch2 -p1 -z .dtneeded +%patch3 -p1 -z .accepted %build # set up a method for modifying the resulting .config file @@ -209,7 +213,7 @@ echo "GROUP (" > ${comblib} find %{buildroot}/%{_libdir}/ -name "*.${libext}" |\ sed -e "s:^%{buildroot}/: :g" >> ${comblib} echo ")" >> ${comblib} -install -m 755 ${comblib} %{buildroot}/%{_libdir}/${comblib} +install -m 644 ${comblib} %{buildroot}/%{_libdir}/${comblib} %files # BSD @@ -217,6 +221,8 @@ install -m 755 ${comblib} %{buildroot}/%{_libdir}/${comblib} %exclude %{_bindir}/*.py %if %{with shared} %{_libdir}/*.so.* +%{_libdir}/*_pmd_*.so +%{_libdir}/*_pmd_*.so.* %endif %files doc @@ -232,6 +238,8 @@ install -m 755 ${comblib} %{buildroot}/%{_libdir}/${comblib} %{_libdir}/*.a %else %{_libdir}/*.so +%exclude %{_libdir}/*_pmd_*.so +%exclude %{_libdir}/*_pmd_*.so.* %endif %if %{with tools}