From patchwork Wed Jan 13 16:33:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Philippe Brucker X-Patchwork-Id: 12017349 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52213C4332B for ; Wed, 13 Jan 2021 16:35:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0CC53235FA for ; Wed, 13 Jan 2021 16:35:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727441AbhAMQfe (ORCPT ); Wed, 13 Jan 2021 11:35:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727370AbhAMQfe (ORCPT ); Wed, 13 Jan 2021 11:35:34 -0500 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCF70C061795 for ; Wed, 13 Jan 2021 08:34:53 -0800 (PST) Received: by mail-ej1-x62f.google.com with SMTP id e18so3917650ejt.12 for ; Wed, 13 Jan 2021 08:34:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WzeKjk6W2CxYi95uCJrjtjO+Mh+ZYv+OVOJ0F2MC/Ds=; b=V1PkJPpfoUhuI2v7Or3K6Aasit7NEsidV/b+AhjMSV6csJcSObKx1qxwjxyWbZhYTV U1rqPVsA1/Ztz6COPZYjx0gg+fU3+E/+w191oU3rAZTG9x8koHZwx5YGzByKWcYV5X6r UGo5q9tp5tLy2ABaanCMNzyb1q7O19ldm/03VB+tG/EHz3Q1D7ilBrW1VV/4CpLh+fYR HegIe7o2CsyJJMtLNU4p97ATsjL2uN/jronxkOIDh5X0rXbV8At4PwYsyN9bc8HGSm8z Pd4J4o2h1pbbD2TZRvUUbENpy+EQm+U78uOo/K3p2H8KGvn61dnXsyent9BlokqGp1H4 4+/A== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=WzeKjk6W2CxYi95uCJrjtjO+Mh+ZYv+OVOJ0F2MC/Ds=; b=IdLIPw6n+IVxJhD3hYOsX/0Dv1mTjXv90EaVKPAwadS7dueRmcImIa64S/6G3qldBJ pBc+/eho0A2EhWMx/IS+eX990iS05DWgX7lBNIrvyU4iR/xnqWpG+pocZNcN8yNIF4cV 145kaX01SObSgBF17g29bWGoShywUJUIa2IOCUsKH2agFlLv17kJDBntCQiqpzCOPcDS DGZFpU7FlbwaaBTrDYTA0/Qp15IGr+6Y1g8ri9a2Wl9rakw3jvIDWZLEERRpa86iEaqt r9RD2NMP8+iPeT276vmcDD/oLlCjn0WiKm5zQ1Y0kT4WVI7ZpAPDa3PYftbUQqLtTUP2 h5+Q== X-Gm-Message-State: AOAM5301xCRxzkz//Ui2dmSHR7mY3kCPIxpbIwp4793cK31YiPV3tnLE Evvl5mb3gi+/E0eZbVANfZiUFJ5uESSnfA== X-Google-Smtp-Source: ABdhPJzg8H3ADXCit0AoriOFHJL0dtctl3lFhEkY2tu1GfeckpfeF4w1Mina2VQpHVoKQUn5ylbVmw== X-Received: by 2002:a17:907:546:: with SMTP id wk6mr2117779ejb.238.1610555692085; Wed, 13 Jan 2021 08:34:52 -0800 (PST) Received: from localhost.localdomain ([2001:1715:4e26:a7e0:116c:c27a:3e7f:5eaf]) by smtp.gmail.com with ESMTPSA id g25sm923943ejf.15.2021.01.13.08.34.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Jan 2021 08:34:51 -0800 (PST) From: Jean-Philippe Brucker To: bpf@vger.kernel.org Cc: shuah@kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, linux-kselftest@vger.kernel.org, Jean-Philippe Brucker Subject: [PATCH bpf-next v2 1/5] selftests/bpf: Enable cross-building Date: Wed, 13 Jan 2021 17:33:16 +0100 Message-Id: <20210113163319.1516382-2-jean-philippe@linaro.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210113163319.1516382-1-jean-philippe@linaro.org> References: <20210113163319.1516382-1-jean-philippe@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net Build bpftool and resolve_btfids using the host toolchain when cross-compiling, since they are executed during build to generate the selftests. Add a host build directory in order to build both host and target version of libbpf. Build host tools using $(HOSTCC) defined in Makefile.include. Acked-by: Andrii Nakryiko Signed-off-by: Jean-Philippe Brucker --- tools/testing/selftests/bpf/Makefile | 46 +++++++++++++++++++++------- 1 file changed, 35 insertions(+), 11 deletions(-) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index c51df6b91bef..95ce81513648 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -1,6 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 include ../../../../scripts/Kbuild.include include ../../../scripts/Makefile.arch +include ../../../scripts/Makefile.include CXX ?= $(CROSS_COMPILE)g++ @@ -113,7 +114,15 @@ SCRATCH_DIR := $(OUTPUT)/tools BUILD_DIR := $(SCRATCH_DIR)/build INCLUDE_DIR := $(SCRATCH_DIR)/include BPFOBJ := $(BUILD_DIR)/libbpf/libbpf.a -RESOLVE_BTFIDS := $(BUILD_DIR)/resolve_btfids/resolve_btfids +ifneq ($(CROSS_COMPILE),) +HOST_BUILD_DIR := $(BUILD_DIR)/host +HOST_SCRATCH_DIR := $(OUTPUT)/host-tools +else +HOST_BUILD_DIR := $(BUILD_DIR) +HOST_SCRATCH_DIR := $(SCRATCH_DIR) +endif +HOST_BPFOBJ := $(HOST_BUILD_DIR)/libbpf/libbpf.a +RESOLVE_BTFIDS := $(HOST_BUILD_DIR)/resolve_btfids/resolve_btfids VMLINUX_BTF_PATHS ?= $(if $(O),$(O)/vmlinux) \ $(if $(KBUILD_OUTPUT),$(KBUILD_OUTPUT)/vmlinux) \ @@ -135,6 +144,14 @@ $(notdir $(TEST_GEN_PROGS) \ $(TEST_GEN_PROGS_EXTENDED) \ $(TEST_CUSTOM_PROGS)): %: $(OUTPUT)/% ; +# sort removes libbpf duplicates when not cross-building +MAKE_DIRS := $(sort $(BUILD_DIR)/libbpf $(HOST_BUILD_DIR)/libbpf \ + $(HOST_BUILD_DIR)/bpftool $(HOST_BUILD_DIR)/resolve_btfids \ + $(INCLUDE_DIR)) +$(MAKE_DIRS): + $(call msg,MKDIR,,$@) + $(Q)mkdir -p $@ + $(OUTPUT)/%.o: %.c $(call msg,CC,,$@) $(Q)$(CC) $(CFLAGS) -c $(filter %.c,$^) $(LDLIBS) -o $@ @@ -157,7 +174,7 @@ $(OUTPUT)/test_stub.o: test_stub.c $(BPFOBJ) $(call msg,CC,,$@) $(Q)$(CC) -c $(CFLAGS) -o $@ $< -DEFAULT_BPFTOOL := $(SCRATCH_DIR)/sbin/bpftool +DEFAULT_BPFTOOL := $(HOST_SCRATCH_DIR)/sbin/bpftool $(OUTPUT)/runqslower: $(BPFOBJ) | $(DEFAULT_BPFTOOL) $(Q)$(MAKE) $(submake_extras) -C $(TOOLSDIR)/bpf/runqslower \ @@ -182,10 +199,11 @@ $(OUTPUT)/test_sysctl: cgroup_helpers.c BPFTOOL ?= $(DEFAULT_BPFTOOL) $(DEFAULT_BPFTOOL): $(wildcard $(BPFTOOLDIR)/*.[ch] $(BPFTOOLDIR)/Makefile) \ - $(BPFOBJ) | $(BUILD_DIR)/bpftool + $(HOST_BPFOBJ) | $(HOST_BUILD_DIR)/bpftool $(Q)$(MAKE) $(submake_extras) -C $(BPFTOOLDIR) \ - OUTPUT=$(BUILD_DIR)/bpftool/ \ - prefix= DESTDIR=$(SCRATCH_DIR)/ install + CC=$(HOSTCC) LD=$(HOSTLD) \ + OUTPUT=$(HOST_BUILD_DIR)/bpftool/ \ + prefix= DESTDIR=$(HOST_SCRATCH_DIR)/ install $(Q)mkdir -p $(BUILD_DIR)/bpftool/Documentation $(Q)RST2MAN_OPTS="--exit-status=1" $(MAKE) $(submake_extras) \ -C $(BPFTOOLDIR)/Documentation \ @@ -198,9 +216,14 @@ $(BPFOBJ): $(wildcard $(BPFDIR)/*.[ch] $(BPFDIR)/Makefile) \ $(Q)$(MAKE) $(submake_extras) -C $(BPFDIR) OUTPUT=$(BUILD_DIR)/libbpf/ \ DESTDIR=$(SCRATCH_DIR) prefix= all install_headers -$(BUILD_DIR)/libbpf $(BUILD_DIR)/bpftool $(BUILD_DIR)/resolve_btfids $(INCLUDE_DIR): - $(call msg,MKDIR,,$@) - $(Q)mkdir -p $@ +ifneq ($(BPFOBJ),$(HOST_BPFOBJ)) +$(HOST_BPFOBJ): $(wildcard $(BPFDIR)/*.[ch] $(BPFDIR)/Makefile) \ + ../../../include/uapi/linux/bpf.h \ + | $(INCLUDE_DIR) $(HOST_BUILD_DIR)/libbpf + $(Q)$(MAKE) $(submake_extras) -C $(BPFDIR) \ + OUTPUT=$(HOST_BUILD_DIR)/libbpf/ CC=$(HOSTCC) LD=$(HOSTLD) \ + DESTDIR=$(HOST_SCRATCH_DIR)/ prefix= all install_headers +endif $(INCLUDE_DIR)/vmlinux.h: $(VMLINUX_BTF) | $(BPFTOOL) $(INCLUDE_DIR) ifeq ($(VMLINUX_H),) @@ -211,7 +234,7 @@ else $(Q)cp "$(VMLINUX_H)" $@ endif -$(RESOLVE_BTFIDS): $(BPFOBJ) | $(BUILD_DIR)/resolve_btfids \ +$(RESOLVE_BTFIDS): $(HOST_BPFOBJ) | $(HOST_BUILD_DIR)/resolve_btfids \ $(TOOLSDIR)/bpf/resolve_btfids/main.c \ $(TOOLSDIR)/lib/rbtree.c \ $(TOOLSDIR)/lib/zalloc.c \ @@ -219,7 +242,8 @@ $(RESOLVE_BTFIDS): $(BPFOBJ) | $(BUILD_DIR)/resolve_btfids \ $(TOOLSDIR)/lib/ctype.c \ $(TOOLSDIR)/lib/str_error_r.c $(Q)$(MAKE) $(submake_extras) -C $(TOOLSDIR)/bpf/resolve_btfids \ - OUTPUT=$(BUILD_DIR)/resolve_btfids/ BPFOBJ=$(BPFOBJ) + CC=$(HOSTCC) LD=$(HOSTLD) AR=$(HOSTAR) \ + OUTPUT=$(HOST_BUILD_DIR)/resolve_btfids/ BPFOBJ=$(HOST_BPFOBJ) # Get Clang's default includes on this system, as opposed to those seen by # '-target bpf'. This fixes "missing" files on some architectures/distros, @@ -450,7 +474,7 @@ $(OUTPUT)/bench: $(OUTPUT)/bench.o $(OUTPUT)/testing_helpers.o \ $(call msg,BINARY,,$@) $(Q)$(CC) $(LDFLAGS) -o $@ $(filter %.a %.o,$^) $(LDLIBS) -EXTRA_CLEAN := $(TEST_CUSTOM_PROGS) $(SCRATCH_DIR) \ +EXTRA_CLEAN := $(TEST_CUSTOM_PROGS) $(SCRATCH_DIR) $(HOST_SCRATCH_DIR) \ prog_tests/tests.h map_tests/tests.h verifier/tests.h \ feature \ $(addprefix $(OUTPUT)/,*.o *.skel.h no_alu32 bpf_gcc bpf_testmod.ko) From patchwork Wed Jan 13 16:33:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Philippe Brucker X-Patchwork-Id: 12017351 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9D71C433E0 for ; Wed, 13 Jan 2021 16:36:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A7E0823602 for ; Wed, 13 Jan 2021 16:36:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727708AbhAMQgN (ORCPT ); Wed, 13 Jan 2021 11:36:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727561AbhAMQgM (ORCPT ); Wed, 13 Jan 2021 11:36:12 -0500 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDD4AC0617A2 for ; Wed, 13 Jan 2021 08:34:54 -0800 (PST) Received: by mail-ej1-x62f.google.com with SMTP id jx16so3934493ejb.10 for ; Wed, 13 Jan 2021 08:34:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=imxNOIL2ER7DtcMLfQ/6C1z3KS46am+Q8zrFjZV4vkQ=; b=Kjwx42msNjsVsAuTlIgBlFA9ZiedF39fMDSTDx/uckfRWrku2SMld2JIZoV3curmq2 0PRYHBZXnn5PZqOlPGjGiu4nqP8KHft0NfPoRx4MlAJG/mocoNSqN91WySExPaUgDoya 4127NK+NdAeUYjwhLG7eroAVVu8XRMLzgidw5MGuxr2X+wzsvD/EnsqA0KPh99Az1iQQ 4cCM+W9j4z76qPSynvGJqstRDe1g9I99miFxjGiL6aqCmi/Wej2wXufK+BplN/oksnfT vQ5kNWocVePxAhnq3mkpfPE9QpaHQYeI2tu7WcZTTdSiWbhTMkqHt+eutDKft2jA0TGn eymQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=imxNOIL2ER7DtcMLfQ/6C1z3KS46am+Q8zrFjZV4vkQ=; b=Xv2TyCwA5C6JoKftYbN2HeIXpW6J5tZtPnWvoH4IKIy7XumzblspAFmWuOH3P0f9D8 oihq1LoB4O+5I5918tjaNYKXbTrC5esZCQqvSEhtEOP7L12mQtWdmqToBG3O7tiUMlSm xYiyYPBXj9cNMnxMk+48SPIxi64SZ7QCpKV8+p8SEq8klTeEY/jN2BUbRX35WLKgUDa8 CIMZXVwH27LfUDg3NYDXI1l6NYKqWCEtKSRj6gIXOux+MRRWosXGFxjwlw3b9U3N8wWJ LuphVwDXcyXbtCqeKDgKvJ05hJOv76I5qT7cO3FGCwP3BsLaAcETRf8Eneb61Q2RC4QF OcyA== X-Gm-Message-State: AOAM533rijvseiWsROirZeL0wyPS7ysGH/IZlCC/fw0uwS7qzW4Jzr+X ddIAyrZlVlA/V4uvK4KZFcROs15FIJRjJw== X-Google-Smtp-Source: ABdhPJx6qJYn1edg3QxhlZRLiV2O0QxKtUTdy7pYA9R7v5ycVclRMYKcx7LSsNtukhOD0qf+wEiBmg== X-Received: by 2002:a17:906:ece4:: with SMTP id qt4mr2038296ejb.311.1610555693177; Wed, 13 Jan 2021 08:34:53 -0800 (PST) Received: from localhost.localdomain ([2001:1715:4e26:a7e0:116c:c27a:3e7f:5eaf]) by smtp.gmail.com with ESMTPSA id g25sm923943ejf.15.2021.01.13.08.34.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Jan 2021 08:34:52 -0800 (PST) From: Jean-Philippe Brucker To: bpf@vger.kernel.org Cc: shuah@kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, linux-kselftest@vger.kernel.org, Jean-Philippe Brucker Subject: [PATCH bpf-next v2 2/5] selftests/bpf: Fix out-of-tree build Date: Wed, 13 Jan 2021 17:33:17 +0100 Message-Id: <20210113163319.1516382-3-jean-philippe@linaro.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210113163319.1516382-1-jean-philippe@linaro.org> References: <20210113163319.1516382-1-jean-philippe@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net When building out-of-tree, the .skel.h files are generated into the $(OUTPUT) directory, rather than $(CURDIR). Add $(OUTPUT) to the include paths. Acked-by: Andrii Nakryiko Signed-off-by: Jean-Philippe Brucker --- tools/testing/selftests/bpf/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index 95ce81513648..92888eed89f3 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -25,7 +25,7 @@ BPF_GCC ?= $(shell command -v bpf-gcc;) SAN_CFLAGS ?= CFLAGS += -g -rdynamic -Wall -O2 $(GENFLAGS) $(SAN_CFLAGS) \ -I$(CURDIR) -I$(INCLUDE_DIR) -I$(GENDIR) -I$(LIBDIR) \ - -I$(TOOLSINCDIR) -I$(APIDIR) \ + -I$(TOOLSINCDIR) -I$(APIDIR) -I$(OUTPUT) \ -Dbpf_prog_load=bpf_prog_test_load \ -Dbpf_load_program=bpf_test_load_program LDLIBS += -lcap -lelf -lz -lrt -lpthread From patchwork Wed Jan 13 16:33:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Philippe Brucker X-Patchwork-Id: 12017353 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F701C433E6 for ; Wed, 13 Jan 2021 16:36:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E906E23719 for ; Wed, 13 Jan 2021 16:36:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727630AbhAMQgN (ORCPT ); Wed, 13 Jan 2021 11:36:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727661AbhAMQgN (ORCPT ); Wed, 13 Jan 2021 11:36:13 -0500 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F45FC0617A4 for ; Wed, 13 Jan 2021 08:34:56 -0800 (PST) Received: by mail-ej1-x636.google.com with SMTP id g12so3950540ejf.8 for ; Wed, 13 Jan 2021 08:34:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ortZEFtRxUHru0nbidQWEmOXybckovOr5wRf4WEJjFM=; b=a8++npUHoFCwDIM5u6xxezEiajVUXj9kNbUL7gaHw8elD+3ybFg/9Fp2aDjy6UsXnu qo1mWCj7GY0ddbZyrWDHtUOpPrldMvEMxFGKIw55sZk93tnLSyCrwnTn+JJ8Bs8NilUc 9n7R5GK1UQCF2f+BlMJX4KnA8U9biEqOaTAoNjbOeWjQQDnjJRorUu3El+/PB/rLDYre V06JGLLOiym+BF4912W6EVw12y1LaEz2LcPZ04yGXUjfW9fxBhEv0lW8OBQHcjZ06aCn lgqSW1xrQsvR7VxUXQ/RgAgGfbaAE01ieNKdIzJDwgnq03JrYOYzey8S0ypxpUpRBRBL tYtA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=ortZEFtRxUHru0nbidQWEmOXybckovOr5wRf4WEJjFM=; b=cMr4NbJ2gyWy46p7UkA5GWGbFlYGs8ND9vPkvKskQsPWf2QqhGSx0bFDMd0nEjnSFt xnVKt7pDtixDFLfHzH77qv0X3ZSWWRy0xUptFLkNCWLLMHTfj/D3kQht0fdoC1nRp0zu uJz93w9CjJiF9g0OV+qXTejq/om5d3GzeNUlyHW7AkARpCtp92b+1En3Xvp1/3waExWm Z2X1UTk3nzTNObUMuf6AglvDSiN2rQA495pTuXJSSB6Y1568C/uvi7FM3v5FxzGn6o7z kP48j0XDlnRnYGFALVYzxyEbHS33cVtc5mv3OmM+ZZXEtLBE1lW18nQYlsXMevMYg0Ok vEyg== X-Gm-Message-State: AOAM530PnjYArU3gHZcdd/Ofa3eZzPvwrqD3KB7HXfo3vU9anw0UZHGL vjWPCifViXpwqp+DABeYG0gR+IEeN/US1w== X-Google-Smtp-Source: ABdhPJwbHL5+zAlZGGQxHuywH889qbeJnoolUcK2Rkj5UHFlOgiSCITdApr8ZZqV51Qn0RUa0v/3JA== X-Received: by 2002:a17:906:3553:: with SMTP id s19mr2112447eja.95.1610555694454; Wed, 13 Jan 2021 08:34:54 -0800 (PST) Received: from localhost.localdomain ([2001:1715:4e26:a7e0:116c:c27a:3e7f:5eaf]) by smtp.gmail.com with ESMTPSA id g25sm923943ejf.15.2021.01.13.08.34.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Jan 2021 08:34:53 -0800 (PST) From: Jean-Philippe Brucker To: bpf@vger.kernel.org Cc: shuah@kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, linux-kselftest@vger.kernel.org, Jean-Philippe Brucker Subject: [PATCH bpf-next v2 3/5] selftests/bpf: Move generated test files to $(TEST_GEN_FILES) Date: Wed, 13 Jan 2021 17:33:18 +0100 Message-Id: <20210113163319.1516382-4-jean-philippe@linaro.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210113163319.1516382-1-jean-philippe@linaro.org> References: <20210113163319.1516382-1-jean-philippe@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net During an out-of-tree build, attempting to install the $(TEST_FILES) into the $(OUTPUT) directory fails, because the objects were already generated into $(OUTPUT): rsync: [sender] link_stat "tools/testing/selftests/bpf/test_lwt_ip_encap.o" failed: No such file or directory (2) rsync: [sender] link_stat "tools/testing/selftests/bpf/test_tc_edt.o" failed: No such file or directory (2) Use $(TEST_GEN_FILES) instead. Signed-off-by: Jean-Philippe Brucker --- tools/testing/selftests/bpf/Makefile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index 92888eed89f3..67cdf858f01f 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -44,10 +44,9 @@ ifneq ($(BPF_GCC),) TEST_GEN_PROGS += test_progs-bpf_gcc endif -TEST_GEN_FILES = -TEST_FILES = test_lwt_ip_encap.o \ - test_tc_edt.o \ - xsk_prereqs.sh +TEST_GEN_FILES = test_lwt_ip_encap.o \ + test_tc_edt.o +TEST_FILES = xsk_prereqs.sh # Order correspond to 'make run_tests' order TEST_PROGS := test_kmod.sh \ From patchwork Wed Jan 13 16:33:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Philippe Brucker X-Patchwork-Id: 12017355 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 391D0C4332D for ; Wed, 13 Jan 2021 16:36:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E8E792360D for ; Wed, 13 Jan 2021 16:36:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727716AbhAMQgO (ORCPT ); Wed, 13 Jan 2021 11:36:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727678AbhAMQgO (ORCPT ); Wed, 13 Jan 2021 11:36:14 -0500 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48B40C0617A6 for ; Wed, 13 Jan 2021 08:34:57 -0800 (PST) Received: by mail-ej1-x633.google.com with SMTP id e18so3917921ejt.12 for ; Wed, 13 Jan 2021 08:34:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jXQ6vMa7f3RRXc70uOmWKXVZ59ITEzz6ydYPgh3UHMU=; b=Fs6aFm7FeMEyhEFtBLTnCCPm+UPC7JZRY20GjPnEBNQ0PXAkirddbeguIhxj3rgg1g dHfbOhgYsvDN2q4fdgmr4g46+DiDnR+8T2Ef9V4YtSOU9U1ondfDaTGpDxU/B07rdQ5/ DJtbGcPX304Nyq1IsxCg1YdYLChvlzmdo2zq0M8n5111u4cXTeG1Mxx0jY0yKVeIXzd6 r3QZMaVuFkZ8v0ChFHBf5CslxlZ2KhrbcP/an0PPA2BTFrba7l/tz22a40QgYfqbHw8d zIn8DhVGxXk00DZ5mNb24Y2MxlZukJ7YaMz2nrn6rRsN/Cvk+N2EIen7HctUv7R+hKrc HJOA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=jXQ6vMa7f3RRXc70uOmWKXVZ59ITEzz6ydYPgh3UHMU=; b=pQVigpJH4X8b38s5rRcsCDt6ttZQmFofhVo89D9Y8xZWFjUOn8vhNCGdqHinkqQL7G GT3MJOhOk9bizbIXXxtbWTnttM+EPAPcqM09sVjttpaVJRg/L7MyJfq6LqL+ZJ4uxB2n Q/ae7Fnq4eHlww8dWeOdG/IGGOgBEK4mqsg/2ehzK7U+NmgADRs3qyMNbpn/gPgggPZU /Bls4H9byMwkjya0FOS2FStfVEx4sl8oZezuJLTHRLW+ELcL761aahzsQ/mQlmkksZXA 6VCF2uj8j+M8kQo+C/3mR7W4LAkMhPz0o1LoxFM3b0AMSvpUgcst6kBVDJyEvnFlTuN3 2EXQ== X-Gm-Message-State: AOAM5319Wj5L7Cjta4Hu2j7dqkOt0eSt3ngrMvDDUw+8R1LScwOL2BDM WmFT/ozRzmrwgr9gUQhW10Eo0ptJupE5Kg== X-Google-Smtp-Source: ABdhPJzNuHI7XdRTYgxqmmWaFsNDoP1WAofc8B682yrTxmEVHj14bMrSFLKbrV7oq+fH4/GitlPR2A== X-Received: by 2002:a17:906:39d5:: with SMTP id i21mr2066874eje.339.1610555695624; Wed, 13 Jan 2021 08:34:55 -0800 (PST) Received: from localhost.localdomain ([2001:1715:4e26:a7e0:116c:c27a:3e7f:5eaf]) by smtp.gmail.com with ESMTPSA id g25sm923943ejf.15.2021.01.13.08.34.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Jan 2021 08:34:54 -0800 (PST) From: Jean-Philippe Brucker To: bpf@vger.kernel.org Cc: shuah@kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, linux-kselftest@vger.kernel.org, Jean-Philippe Brucker Subject: [PATCH bpf-next v2 4/5] selftests/bpf: Fix installation of urandom_read Date: Wed, 13 Jan 2021 17:33:19 +0100 Message-Id: <20210113163319.1516382-5-jean-philippe@linaro.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210113163319.1516382-1-jean-philippe@linaro.org> References: <20210113163319.1516382-1-jean-philippe@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net For out-of-tree builds, $(TEST_CUSTOM_PROGS) require the $(OUTPUT) prefix, otherwise the kselftest lib doesn't know how to install them: rsync: [sender] link_stat "tools/testing/selftests/bpf/urandom_read" failed: No such file or directory (2) Acked-by: Andrii Nakryiko Signed-off-by: Jean-Philippe Brucker --- tools/testing/selftests/bpf/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index 67cdf858f01f..0fafdc022ac3 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -82,7 +82,7 @@ TEST_GEN_PROGS_EXTENDED = test_sock_addr test_skb_cgroup_id_user \ test_lirc_mode2_user xdping test_cpp runqslower bench bpf_testmod.ko \ xdpxceiver -TEST_CUSTOM_PROGS = urandom_read +TEST_CUSTOM_PROGS = $(OUTPUT)/urandom_read # Emit succinct information message describing current building step # $1 - generic step name (e.g., CC, LINK, etc); From patchwork Wed Jan 13 16:33:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Philippe Brucker X-Patchwork-Id: 12017357 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A472C4332B for ; Wed, 13 Jan 2021 16:36:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 32330235F9 for ; Wed, 13 Jan 2021 16:36:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727678AbhAMQgO (ORCPT ); Wed, 13 Jan 2021 11:36:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727719AbhAMQgO (ORCPT ); Wed, 13 Jan 2021 11:36:14 -0500 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B00FC0617A9 for ; Wed, 13 Jan 2021 08:34:58 -0800 (PST) Received: by mail-ej1-x62f.google.com with SMTP id g12so3950729ejf.8 for ; Wed, 13 Jan 2021 08:34:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BdIvDbIaLfjihhRkhU5/HCzUvJ+o4x5+Y+DliwVMXI0=; b=hxRotWBElbEIKPd54uMcTCedGp59nZYVMAeKuPhfY7dKVGEI7lk+k5HRAf5JslUYyd vbFiqyIDHgKPfPUZde154fNm1GroSTz8+gqXxs5MAldGUsy0d8r25SRnnRBp51FUx4lS hjStaBFfh2SmbOxvuJRjGvgs1HRwxB6hsd1LMie5HvPVBJ8vI5LkFdC3avjtmtZtcccy RHWn8tbkEOMWD+W/7LHYCJ6fT0y6JvlSBsLY3cFI9YAakurrVZSPB3M9/o8u0PDNOKf5 S+fVjAY3aO2aqeSfdjuNPnwhhFsaOqqI2Z12SRuFv262uPbmwGRGZUbzQqE/5GbZmhpY QxyA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=BdIvDbIaLfjihhRkhU5/HCzUvJ+o4x5+Y+DliwVMXI0=; b=cFoMCV+DXm5/6JND9n1Eb0T0+GH3m6lAGJFBqiD1KiSNvfxuwvST9CC7eDabrEnIKl FOD08hRe+qV/97/t5mqKOJwZRGktwvZBZVh0fMD3Mm8vBXwYGL1S+VhqHkZLRV4VBPDf U7O6t40qKCEsOv6KU8sx/A4oMl0KMODnee7OR1Bi/4m8Q+qhrfsiXRisyxv/8V8JbWjG gik7LAImb1i3gEfoJbnMbz2SaL1Z9oFiVprCGRWaI98z6KjlkMSh/AUNcMEnprB+HbeK KIOrhuxMU3uZxOPQgOhO3P3jPrBASmIq4VAJ6NaIqAL/RoJumOUfZ671bjdZecOZ8Nvz JV6A== X-Gm-Message-State: AOAM5326xT84+VLFJ9EpSoooTwkpiRhSw+yGEmsC2IHAjop/ie5I8Yaw 4zZtcOCjLDqFKbGgcpv06REcKaMaLfufiA== X-Google-Smtp-Source: ABdhPJxIw5d98gY4xn2J6ZKW1T8RtHRaZ491RfwnxHENsukkA29IZJ+h0+kfMYsI2X45CmHKcS+J8Q== X-Received: by 2002:a17:906:bc9b:: with SMTP id lv27mr2079635ejb.505.1610555696700; Wed, 13 Jan 2021 08:34:56 -0800 (PST) Received: from localhost.localdomain ([2001:1715:4e26:a7e0:116c:c27a:3e7f:5eaf]) by smtp.gmail.com with ESMTPSA id g25sm923943ejf.15.2021.01.13.08.34.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Jan 2021 08:34:56 -0800 (PST) From: Jean-Philippe Brucker To: bpf@vger.kernel.org Cc: shuah@kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, linux-kselftest@vger.kernel.org, Jean-Philippe Brucker Subject: [PATCH bpf-next v2 5/5] selftests/bpf: Install btf_dump test cases Date: Wed, 13 Jan 2021 17:33:20 +0100 Message-Id: <20210113163319.1516382-6-jean-philippe@linaro.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210113163319.1516382-1-jean-philippe@linaro.org> References: <20210113163319.1516382-1-jean-philippe@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net The btf_dump test cannot access the original source files for comparison when running the selftests out of tree, causing several failures: awk: btf_dump_test_case_syntax.c: No such file or directory ... Add those files to $(TEST_FILES) to have "make install" pick them up. Signed-off-by: Jean-Philippe Brucker --- tools/testing/selftests/bpf/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index 0fafdc022ac3..7f8667ad113e 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -46,7 +46,8 @@ endif TEST_GEN_FILES = test_lwt_ip_encap.o \ test_tc_edt.o -TEST_FILES = xsk_prereqs.sh +TEST_FILES = xsk_prereqs.sh \ + $(wildcard progs/btf_dump_test_case_*.c) # Order correspond to 'make run_tests' order TEST_PROGS := test_kmod.sh \