From 1264144c999ae5cd1bda04376d6d59c25bff9dc1 Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Thu, 29 Sep 2016 09:57:13 +0200 Subject: utilize RTE_EAL_PMD_PATH This sets RTE_EAL_PMD_PATH to /usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/dpdk-pmds. On creating the pmd library packages those get a symlink from that dir. This allows DPDK applications to autoload pmd drivers and only rely on the EAL -d option for those provided in other places (e.g. custom drivers). By that one can use testpmd/l2fwd/openvswitch-dpdk and others without passing -d to EAL. Each lib gets an extra relative symlink from the RTE_EAL_PMD_PATH dir to the lib itself e.g. for librte_vhost: ./usr/lib/x86_64-linux-gnu/dpdk-pmds/ ./usr/lib/x86_64-linux-gnu/dpdk-pmds/librte_vhost.so.3 -> ../librte_vhost.so.3 Change-Id: Idf997e58cfa5060961239b3ee0c22de89e0ed1a3 Signed-off-by: Christian Ehrhardt --- debian/rules | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'debian/rules') diff --git a/debian/rules b/debian/rules index 064ffc3b..e4684928 100755 --- a/debian/rules +++ b/debian/rules @@ -129,6 +129,7 @@ ifeq (,$(filter dpdk_config=%,$(DEB_BUILD_OPTIONS))) -e 's,(CONFIG_RTE_KNI_KMOD=).*,\1$(DPDK_CONFIG_BUILD_KMOD),' \ -e 's,(LIBRTE_PMD_PCAP=).*,\1y,' \ -e 's,(LIBRTE_PMD_XENVIRT=).*,\1y,' \ + -e 's,(CONFIG_RTE_EAL_PMD_PATH=).*,\1"/usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/dpdk-pmds/",' \ $(DPDK_STATIC_DIR)/.config # xen not available on ppc64el ifneq (,$(filter $(DEB_HOST_ARCH), ppc64el)) @@ -206,9 +207,16 @@ override_dh_auto_install-arch: else \ PKG=$${LN}$${VER}; \ fi; \ + LIBF="$$(basename $${lib})"; \ + LIBD="debian/$${PKG}/$(LIBDIR)"; \ echo "moving $${lib} for library $${PKG}"; \ - mkdir -p debian/$${PKG}/$(LIBDIR); \ - mv $${lib} debian/$${PKG}/$(LIBDIR); \ + mkdir -p $${LIBD}; \ + mv $${lib} $${LIBD}; \ + if [ "$${LIBF#librte_pmd_}x" != "$${LIBF}x" ]; then \ + mkdir -p $${LIBD}/dpdk-pmds; \ + echo "PMD: linking $${LIBF} into RTE_EAL_PMD_PATH at $${LIBD}/dpdk-pmds/"; \ + ln -s --relative --target-directory=$${LIBD}/dpdk-pmds/ $${LIBD}/$${LIBF}; \ + fi; \ done # pkg-config mkdir -p debian/libdpdk-dev/$(LIBDIR)/pkgconfig -- cgit 1.2.3-korg From 341d9ed5cf2aa5da89397e62c900e2d325b8d634 Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Thu, 29 Sep 2016 16:40:50 +0200 Subject: add empty RTE_EAL_PMD_PATH dir to librte_eal If EAL is initialized and the path isn't existing at all (=no PMDs at all are installed) the initialization fails with: EAL: /usr/lib/x86_64-linux-gnu/dpdk-pmds/: cannot open shared object file: No such file or directory So since we support RTE_EAL_PMD_PATH now but can never guarantee that there always will be a PMD it becomes a requirement of librte_eal to have at least an empty path. An empty path is fine and will not load anything, but avoid the initializaiton error. Change-Id: I2725169c67c190f8ed8b608fc5ae508ae66eab1c Signed-off-by: Christian Ehrhardt --- debian/rules | 3 +++ 1 file changed, 3 insertions(+) (limited to 'debian/rules') diff --git a/debian/rules b/debian/rules index e4684928..ccd61406 100755 --- a/debian/rules +++ b/debian/rules @@ -217,6 +217,9 @@ override_dh_auto_install-arch: echo "PMD: linking $${LIBF} into RTE_EAL_PMD_PATH at $${LIBD}/dpdk-pmds/"; \ ln -s --relative --target-directory=$${LIBD}/dpdk-pmds/ $${LIBD}/$${LIBF}; \ fi; \ + if [ "$${LIBF#librte_eal}x" != "$${LIBF}x" ]; then \ + mkdir -p $${LIBD}/dpdk-pmds; \ + fi; \ done # pkg-config mkdir -p debian/libdpdk-dev/$(LIBDIR)/pkgconfig -- cgit 1.2.3-korg From e397010b88a4b8b2ef88e8cafb4d961df95e15fb Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Tue, 11 Oct 2016 10:55:32 +0200 Subject: d/rules support DEB_BUILD_OPTIONS parallel Build seems stable enough to support DEB_BUILD_OPTIONS parallel these days. Since we don't just dh we have to explicitly support that flag. Change-Id: Ia7fc590f81cdae5b4bd5abdfb36af7aaeddfa10c Signed-off-by: Christian Ehrhardt --- debian/rules | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'debian/rules') diff --git a/debian/rules b/debian/rules index ccd61406..f21cf767 100755 --- a/debian/rules +++ b/debian/rules @@ -62,6 +62,13 @@ endif DPDK_STATIC_DIR = "debian/build/static-root" DPDK_SHARED_DIR = "debian/build/shared-root" +# now stable with parallel comilation, so support -j +ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) + PAR := $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) +else + PAR := "1" +endif + # kernel_modules can be passed via DEB_BUILD_OPTIONS to enable building the # optional binary kernel modules package. By default it will be built against # the current kernel, or ksrc can be passed with a path to the target kernel @@ -139,7 +146,7 @@ endif dh_auto_configure override_dh_auto_build-indep: - $(MAKE) V=$(DH_VERBOSE) O=$(DPDK_STATIC_DIR) doc-api-html doc-guides-html \ + $(MAKE) -j $(PAR) V=$(DH_VERBOSE) O=$(DPDK_STATIC_DIR) doc-api-html doc-guides-html \ doc-guides-man override_dh_auto_install-indep: @@ -149,7 +156,7 @@ override_dh_auto_install-indep: DESTDIR=debian/dpdk-doc install-doc override_dh_auto_build-arch: - $(MAKE) V=$(DH_VERBOSE) O=$(DPDK_STATIC_DIR) RTE_KERNELDIR=$(KSRC) build + $(MAKE) -j $(PAR) V=$(DH_VERBOSE) O=$(DPDK_STATIC_DIR) RTE_KERNELDIR=$(KSRC) build # Unfortunately the decision about having static or shared libraries is # made for the whole build, which then produces only .a or .so files # (but not both). @@ -162,7 +169,7 @@ override_dh_auto_build-arch: cp -a $(DPDK_STATIC_DIR) $(DPDK_SHARED_DIR) sed -ri 's,(RTE_BUILD_SHARED_LIB=).*,\1y,' \ $(DPDK_SHARED_DIR)/.config - $(MAKE) V=$(DH_VERBOSE) O=$(DPDK_SHARED_DIR) RTE_KERNELDIR=$(KSRC) build + $(MAKE) -j $(PAR) V=$(DH_VERBOSE) O=$(DPDK_SHARED_DIR) RTE_KERNELDIR=$(KSRC) build override_dh_auto_install-arch: LIBDIR=usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH) override_dh_auto_install-arch: -- cgit 1.2.3-korg From c5fe7deabb5c25111ddb910def7c86ca857c4fa3 Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Wed, 12 Oct 2016 13:19:52 +0200 Subject: include the autotest suite in dpdk-dev The autotest suite is ready to use after build and built by default. It can be useful to developers and tools to have access to the test toolchains built together with the packaged content. Change-Id: I5d5fe58b4ccc6960edde92bbec2577526d0c9916 Signed-off-by: Christian Ehrhardt --- debian/rules | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'debian/rules') diff --git a/debian/rules b/debian/rules index f21cf767..b652adc2 100755 --- a/debian/rules +++ b/debian/rules @@ -190,6 +190,10 @@ override_dh_auto_install-arch: cp $(DPDK_SHARED_DIR)/.config debian/dpdk-dev/usr/share/dpdk/config sed -e 's/SDK_TARGET/$(RTE_TARGET)/' debian/dpdk-sdk-env.sh.in > \ debian/dpdk-dev/usr/share/dpdk/dpdk-sdk-env.sh + # include the bundled autotest suite to be usable from the dpdk-dev package + mkdir -p debian/dpdk-dev/usr/share/dpdk/test + cp -a app/test/autotest* debian/dpdk-dev/usr/share/dpdk/test + cp $(DPDK_SHARED_DIR)/app/test debian/dpdk-dev/usr/share/dpdk/test/ # Package: libdpdk-dev (bare headers, static devel libs and linker # script) mkdir -p debian/libdpdk-dev/$(LIBDIR) -- cgit 1.2.3-korg From 5577c7853ac4aed35ee28f17c56c3b0b8e2cd251 Mon Sep 17 00:00:00 2001 From: Santiago Date: Wed, 9 Nov 2016 15:57:31 +0100 Subject: debian/rules: Only export hardening related building HOST_/EXTRA flags when dpkg-dev < 1.18.11. On newer dpkg-dev versions, dpkg-buildflags handle them directly and are injected by gcc (6.x). Change-Id: I1fd99405d9b07e10c3bc41034256212ebeaf7549 Signed-off-by: Santiago --- debian/rules | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) (limited to 'debian/rules') diff --git a/debian/rules b/debian/rules index b652adc2..3ef1c669 100755 --- a/debian/rules +++ b/debian/rules @@ -15,20 +15,26 @@ DEB_HOST_GNU_CPU := $(shell dpkg-architecture -qDEB_HOST_GNU_CPU) export DEB_BUILD_MAINT_OPTIONS = hardening=+all,-pie # see ENVIRONMENT in dpkg-buildflags(1) -# package maintainers to append CFLAGS -export DEB_CFLAGS_MAINT_APPEND = -fPIC -# package maintainers to append LDFLAGS -#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed - +DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk -export EXTRA_CFLAGS=$(CFLAGS) -export EXTRA_CPPFLAGS=$(CPPFLAGS) -export HOST_EXTRA_CFLAGS=$(CFLAGS) -export HOST_EXTRA_CPPFLAGS=$(CPPFLAGS) -# need to be stripped as DPDK build system adds them and it would be -Wl,-Wl,opt -export EXTRA_LDFLAGS=$(shell echo $(LDFLAGS) | sed 's/-Wl,//g') -# HOST_CC build system does not add -Wl ... -export EXTRA_HOST_LDFLAGS=$(LDFLAGS) + +# Support backporting to jessie +dpkg_version_lt = $(shell dpkg --compare-versions $$(dpkg --status dpkg-dev | grep Version | cut -d' ' -f2) lt-nl "1.18.11" && echo yes) +ifeq (yes, $(dpkg_version_lt)) + # package maintainers to append CFLAGS + # For Debian, dpkg-dev >= 1.18.11 and gcc 6.x, dpkg-buildflags and gcc + # handle -fPIC and related flags relying on specs files + # (/usr/share/dpkg/*specs) + export DEB_CFLAGS_MAINT_APPEND = -fPIC + export EXTRA_CFLAGS=$(CFLAGS) + export EXTRA_CPPFLAGS=$(CPPFLAGS) + export HOST_EXTRA_CFLAGS=$(CFLAGS) + export HOST_EXTRA_CPPFLAGS=$(CPPFLAGS) + # need to be stripped as DPDK build system adds them and it would be -Wl,-Wl,opt + export EXTRA_LDFLAGS=$(shell echo $(LDFLAGS) | sed 's/-Wl,//g') + # HOST_CC build system does not add -Wl ... + export EXTRA_HOST_LDFLAGS=$(LDFLAGS) +endif export RTE_DEVEL_BUILD=n -- cgit 1.2.3-korg From 5f7e9d4586d361e9855e60b2dfdc31b8540e446d Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Thu, 10 Nov 2016 16:09:41 +0000 Subject: Use -fno-PIE when building kernel modules In Debian 9 -fPIE is now default, which causes build failures when building kernel modules. Pass -fno-PIE to fix it. Change-Id: Ib9187ef6ed72bd25b92fb9f449a9435fcc5cc6cf Signed-off-by: Luca Boccassi --- debian/dpdk-igb-uio-dkms.dkms | 2 +- debian/dpdk-rte-kni-dkms.dkms | 2 +- debian/rules | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'debian/rules') diff --git a/debian/dpdk-igb-uio-dkms.dkms b/debian/dpdk-igb-uio-dkms.dkms index 5c7d1925..5141ff61 100644 --- a/debian/dpdk-igb-uio-dkms.dkms +++ b/debian/dpdk-igb-uio-dkms.dkms @@ -1,7 +1,7 @@ PACKAGE_NAME="dpdk-igb-uio" PACKAGE_VERSION="#MODULE_VERSION#" BUILT_MODULE_NAME[0]="igb_uio" -MAKE="source /usr/share/dpdk/dpdk-sdk-env.sh; make MODULE_CFLAGS='-I/usr/include/dpdk -include /usr/include/dpdk/rte_config.h' RTE_KERNELDIR=/lib/modules/${kernelver}/build" +MAKE="source /usr/share/dpdk/dpdk-sdk-env.sh; make MODULE_CFLAGS='-I/usr/include/dpdk -include /usr/include/dpdk/rte_config.h -fno-PIE' RTE_KERNELDIR=/lib/modules/${kernelver}/build" CLEAN="source /usr/share/dpdk/dpdk-sdk-env.sh; make clean" DEST_MODULE_LOCATION[0]="/updates/dkms" AUTOINSTALL="YES" diff --git a/debian/dpdk-rte-kni-dkms.dkms b/debian/dpdk-rte-kni-dkms.dkms index 800e5805..26de0ee3 100644 --- a/debian/dpdk-rte-kni-dkms.dkms +++ b/debian/dpdk-rte-kni-dkms.dkms @@ -1,7 +1,7 @@ PACKAGE_NAME="dpdk-rte-kni" PACKAGE_VERSION="#MODULE_VERSION#" BUILT_MODULE_NAME[0]="rte_kni" -MAKE="source /usr/share/dpdk/dpdk-sdk-env.sh; make MODULE_CFLAGS='-I/usr/include/dpdk -include /usr/include/dpdk/rte_config.h -I$source_tree/dpdk-rte-kni-#MODULE_VERSION#/ethtool/ixgbe -I$source_tree/dpdk-rte-kni-#MODULE_VERSION#/ethtool/igb' RTE_KERNELDIR=/lib/modules/${kernelver}/build" +MAKE="source /usr/share/dpdk/dpdk-sdk-env.sh; make MODULE_CFLAGS='-I/usr/include/dpdk -include /usr/include/dpdk/rte_config.h -I$source_tree/dpdk-rte-kni-#MODULE_VERSION#/ethtool/ixgbe -I$source_tree/dpdk-rte-kni-#MODULE_VERSION#/ethtool/igb -fno-PIE' RTE_KERNELDIR=/lib/modules/${kernelver}/build" CLEAN="source /usr/share/dpdk/dpdk-sdk-env.sh; make clean" DEST_MODULE_LOCATION[0]="/updates/dkms" AUTOINSTALL="YES" diff --git a/debian/rules b/debian/rules index 3ef1c669..7a494468 100755 --- a/debian/rules +++ b/debian/rules @@ -91,6 +91,7 @@ endif KVERS := $(shell perl debian/kernel-version $(KSRC)) export KVERS +export MODULE_CFLAGS=-fno-PIE DPDK_CONFIG_BUILD_KMOD=y -- cgit 1.2.3-korg