From patchwork Thu Mar 7 14:34:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cyril Hrubis X-Patchwork-Id: 1052965 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.cz Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44FY893R9zz9sMx for ; Fri, 8 Mar 2019 01:35:34 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id CBC50294AC9 for ; Thu, 7 Mar 2019 15:35:30 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-3.smtp.seeweb.it (in-3.smtp.seeweb.it [IPv6:2001:4b78:1:20::3]) by picard.linux.it (Postfix) with ESMTP id 529E13EA16D for ; Thu, 7 Mar 2019 15:35:29 +0100 (CET) Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by in-3.smtp.seeweb.it (Postfix) with ESMTPS id 2CF391A008BF for ; Thu, 7 Mar 2019 15:35:27 +0100 (CET) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 69572AC69; Thu, 7 Mar 2019 14:35:27 +0000 (UTC) From: Cyril Hrubis To: ltp@lists.linux.it Date: Thu, 7 Mar 2019 15:34:53 +0100 Message-Id: <20190307143453.9808-1-chrubis@suse.cz> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.99.2 at in-3.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.0 required=7.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-3.smtp.seeweb.it Subject: [LTP] [PATCH] Fix build with libnuma-dev on some distributions X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" On some distributions when libnuma-dev is installed the tst_numa.o, which was added to libltp.a pulls in symbols from numa library to random unrealted tests which breaks the build. This commit hence moves the tst_numa to a separate libltpnuma.a library that is used for linking only for tests that actually use it and link with -lnuma. Signed-off-by: Cyril Hrubis CC: Jan Stancek --- This should fix the build failures, beware not build tested yet. Makefile | 6 +++--- libnuma/Makefile | 10 ++++++++++ {lib => libnuma}/tst_numa.c | 0 testcases/kernel/syscalls/set_mempolicy/Makefile | 3 ++- 4 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 libnuma/Makefile rename {lib => libnuma}/tst_numa.c (100%) diff --git a/Makefile b/Makefile index bcadd21b2..3d3c70339 100644 --- a/Makefile +++ b/Makefile @@ -77,7 +77,7 @@ INSTALL_TARGETS += runtest scenario_groups testscripts CLEAN_TARGETS += include runtest scenario_groups testscripts endif INSTALL_TARGETS += $(COMMON_TARGETS) -CLEAN_TARGETS += $(COMMON_TARGETS) lib +CLEAN_TARGETS += $(COMMON_TARGETS) lib libnuma BOOTSTRAP_TARGETS := $(sort $(COMMON_TARGETS) $(CLEAN_TARGETS) $(INSTALL_TARGETS)) CLEAN_TARGETS := $(addsuffix -clean,$(CLEAN_TARGETS)) @@ -89,7 +89,7 @@ MAKE_TARGETS := $(addsuffix -all,$(filter-out lib,$(COMMON_TARGETS))) # overtaxed one, or one where -j => 1 was specified. all: $(addsuffix -all,$(COMMON_TARGETS)) Version -$(MAKE_TARGETS): lib-all +$(MAKE_TARGETS): lib-all libnuma-all .PHONY: include-all include-install include-install: $(top_builddir)/include/config.h include/mk/config.mk include-all @@ -110,7 +110,7 @@ $(sort $(addprefix $(abs_top_builddir)/,$(BOOTSTRAP_TARGETS)) $(INSTALL_DIR) $(D ## Pattern based subtarget rules. lib-install: lib-all -$(MAKE_TARGETS) include-all lib-all: +$(MAKE_TARGETS) include-all lib-all libnuma-all: $(MAKE) -C "$(subst -all,,$@)" \ -f "$(abs_top_srcdir)/$(subst -all,,$@)/Makefile" all diff --git a/libnuma/Makefile b/libnuma/Makefile new file mode 100644 index 000000000..e41fc9c72 --- /dev/null +++ b/libnuma/Makefile @@ -0,0 +1,10 @@ +# + +top_srcdir ?= .. + +include $(top_srcdir)/include/mk/env_pre.mk + +LIB := libltpnuma.a + +include $(top_srcdir)/include/mk/lib.mk +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/lib/tst_numa.c b/libnuma/tst_numa.c similarity index 100% rename from lib/tst_numa.c rename to libnuma/tst_numa.c diff --git a/testcases/kernel/syscalls/set_mempolicy/Makefile b/testcases/kernel/syscalls/set_mempolicy/Makefile index d273b432b..b21fdd004 100644 --- a/testcases/kernel/syscalls/set_mempolicy/Makefile +++ b/testcases/kernel/syscalls/set_mempolicy/Makefile @@ -2,6 +2,7 @@ top_srcdir ?= ../../../.. include $(top_srcdir)/include/mk/testcases.mk -LDLIBS += $(NUMA_LIBS) +LDFLAGS += -L$(top_builddir)/libnuma +LDLIBS += $(NUMA_LIBS) -lltpnuma include $(top_srcdir)/include/mk/generic_leaf_target.mk