From d0b8347d9e8fa7519c91196383a18fb3ecf5cf67 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Tue, 29 Sep 2020 14:36:20 +0000 Subject: [PATCH] dpdkbuild: don't re-install unchanged shared libs When configuring with --with-shared, you would see all applications getting relinked, even if nothing has changed. This was root caused to DPDK re-installing shared libraries that hadn't been rebuilt. Switching from 'ninja install' to 'meson install --only-changed' fixes this behavior. Note that meson install doesn't support -j, but at this point we are only installing files, not building them - and now we won't even be installing the files again if they haven't changed. Signed-off-by: Jim Harris Change-Id: If0491b2ad6e8564ad0fd8dee39a2e357e1329ea9 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4465 Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Shuhei Matsumoto --- dpdkbuild/Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dpdkbuild/Makefile b/dpdkbuild/Makefile index 9568f263c..78a52bf1e 100644 --- a/dpdkbuild/Makefile +++ b/dpdkbuild/Makefile @@ -141,12 +141,16 @@ all: $(SPDK_ROOT_DIR)/dpdk/build-tmp # /usr/local) instead of replacing it. --prefix needs to be an absolute path, so we set \ # it to / and then set DESTDIR directly, so libs and headers are copied to "DESTDIR//". \ # DPDK kernel modules are set to install in $DESTDIR/boot/modules, but we move them \ - # to DESTDIR/kmod to be consistent with the makefile build. + # to DESTDIR/kmod to be consistent with the makefile build. \ + # \ + # Also use meson install --only-changed instead of ninja install so that the shared \ + # libraries don't get reinstalled when they haven't been rebuilt - this avoids all of \ + # our applications getting relinked even when nothing has changed. $(Q)if [ "$(OS)" = "FreeBSD" ]; then \ env -u MAKEFLAGS DESTDIR=$(SPDK_ROOT_DIR)/dpdk/build ninja -C $(SPDK_ROOT_DIR)/dpdk/build-tmp $(MAKE_NUMJOBS) install > /dev/null && \ mv $(SPDK_ROOT_DIR)/dpdk/build/boot/modules $(SPDK_ROOT_DIR)/dpdk/build/kmod; \ else \ - env -u MAKEFLAGS ninja -C $(SPDK_ROOT_DIR)/dpdk/build-tmp $(MAKE_NUMJOBS) install > /dev/null; \ + env -u MAKEFLAGS meson install -C $(SPDK_ROOT_DIR)/dpdk/build-tmp --only-changed > /dev/null; \ fi $(SPDK_ROOT_DIR)/dpdk/build-tmp: $(SPDK_ROOT_DIR)/mk/cc.mk $(SPDK_ROOT_DIR)/include/spdk/config.h