From patchwork Mon Mar 20 06:03:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zi Shen Lim X-Patchwork-Id: 95468 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp796992qgd; Sun, 19 Mar 2017 23:11:48 -0700 (PDT) X-Received: by 10.98.9.156 with SMTP id 28mr31244425pfj.199.1489990308824; Sun, 19 Mar 2017 23:11:48 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m37si16362484pla.232.2017.03.19.23.11.48; Sun, 19 Mar 2017 23:11:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752960AbdCTGLr (ORCPT + 6 others); Mon, 20 Mar 2017 02:11:47 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:36056 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752945AbdCTGLp (ORCPT ); Mon, 20 Mar 2017 02:11:45 -0400 Received: by mail-pg0-f67.google.com with SMTP id 81so10025073pgh.3 for ; Sun, 19 Mar 2017 23:11:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=GzJVNmk3/oKaNCDR2Hzsd8IogynfhWQ4siOqJdqER7Y=; b=oV/TAWpTU+1CbhzYeQHdltd8HckMGcwQ0JBEKm3NADiYu/sRHQlQxTmNr5eHdpObC/ La4VSuG54s1j3+t6MR2FO4kDBS4dhsFFruP28HZmBzwJyWtffZFpA1hXxmcZ94/BA2DC WbIuL5AdH79ZDcdcDfijd6R9VGv2qiOvAm70peu0hBZnyeDZ96/cVakSgBzAdeNqqxPN rySiWHT4F0DISQwz74upTr9rQPSilo1U4+aZRr2M9gFuG3W68SU5uQv7ZrURZ8JQC5ut jOdHOK+lPK2F9odITDtMGSVkDRYStyHVimsj2peT3hEJ+GhOropPCJHMIhhOYJAVHs5n of1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=GzJVNmk3/oKaNCDR2Hzsd8IogynfhWQ4siOqJdqER7Y=; b=H2RcSzHYjLRe4kRXJ68iq3DATvL2l+zonMdOjzbewPuCZLqUusxiC6CKi1xq8jPl4e 1TtYh4CjJyD2GDPoytq2Rz/eBz0AFkMZ/0vNGmU9V9cFb8Ucvs13ErtyGvyy8LyBY9gt Vok8QWkToXQdzlqfaR1MMCOQqAH5+CaZDl8YUkp7MN/hoDa7KtB/LYYhipskvwRN9twh 53uMGQf/pVOXGItN59FGK+1KjMnCXqIhb4b4cv3LwIUQR7w84rVOUeK7EEd5HgA5ylav pMdDY5U7dFkLrHx3QeRsZnXeA2cV4iyvmoDboqhYB4tAE8uJnTjwBx2/TtMk4FdKpmo1 64Sw== X-Gm-Message-State: AFeK/H0zQofpxPwrKe1Qki7PV7JugFyUHHEfITJD7b1qgYSwZQhbT0ggvr9dQA1t67IFBw== X-Received: by 10.98.58.7 with SMTP id h7mr31419993pfa.234.1489989807755; Sun, 19 Mar 2017 23:03:27 -0700 (PDT) Received: from localhost.localdomain (c-73-223-118-172.hsd1.ca.comcast.net. [73.223.118.172]) by smtp.gmail.com with ESMTPSA id u192sm3174268pgb.45.2017.03.19.23.03.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 19 Mar 2017 23:03:27 -0700 (PDT) From: Zi Shen Lim To: "David S . Miller" Cc: Zi Shen Lim , Alexei Starovoitov , Daniel Borkmann , Shuah Khan , netdev@vger.kernel.org Subject: [PATCH v2 net] selftests/bpf: fix broken build, take 2 Date: Sun, 19 Mar 2017 23:03:14 -0700 Message-Id: <1489989794-6859-1-git-send-email-zlim.lnx@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Merge of 'linux-kselftest-4.11-rc1': 1. Partially removed use of 'test_objs' target, breaking force rebuild of BPFOBJ, introduced in commit d498f8719a09 ("bpf: Rebuild bpf.o for any dependency update"). Update target so dependency on BPFOBJ is restored. 2. Introduced commit 2047f1d8ba28 ("selftests: Fix the .c linking rule") which fixes order of LDLIBS. Commit d02d8986a768 ("bpf: Always test unprivileged programs") added libcap dependency into CFLAGS. Use LDLIBS instead to fix linking of test_verifier. 3. Introduced commit d83c3ba0b926 ("selftests: Fix selftests build to just build, not run tests"). Reordering the Makefile allows us to remove the 'all' target. Tested both: selftests/bpf$ make and selftests$ make TARGETS=bpf on Ubuntu 16.04.2. Signed-off-by: Zi Shen Lim --- v1: - Fixed build from selftests/bpf/. v2: - Fixed build from selftests/ also. tools/testing/selftests/bpf/Makefile | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) -- 2.7.4 Acked-by: Daniel Borkmann Tested-by: Daniel Borkmann Acked-by: Alexei Starovoitov Tested-by: Alexei Starovoitov Acked-by: Shuah Khan diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index 67531f4..6a1ad58 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -1,22 +1,23 @@ LIBDIR := ../../../lib -BPFOBJ := $(LIBDIR)/bpf/bpf.o +BPFDIR := $(LIBDIR)/bpf -CFLAGS += -Wall -O2 -lcap -I../../../include/uapi -I$(LIBDIR) $(BPFOBJ) +CFLAGS += -Wall -O2 -I../../../include/uapi -I$(LIBDIR) +LDLIBS += -lcap TEST_GEN_PROGS = test_verifier test_tag test_maps test_lru_map test_lpm_map TEST_PROGS := test_kmod.sh -all: $(TEST_GEN_PROGS) +include ../lib.mk + +BPFOBJ := $(OUTPUT)/bpf.o + +$(TEST_GEN_PROGS): $(BPFOBJ) -.PHONY: all clean force +.PHONY: force # force a rebuild of BPFOBJ when its dependencies are updated force: $(BPFOBJ): force - $(MAKE) -C $(dir $(BPFOBJ)) - -$(test_objs): $(BPFOBJ) - -include ../lib.mk + $(MAKE) -C $(BPFDIR) OUTPUT=$(OUTPUT)/