Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp3797344pxb; Mon, 4 Oct 2021 09:48:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEdNY+GCeHzoXtTur+c9LqGgy3DmeTnDMKMu50p4/VT5T3as0nKBR7gvT8K4POoHHgNvaJ X-Received: by 2002:a17:90a:6283:: with SMTP id d3mr31652188pjj.73.1633366090539; Mon, 04 Oct 2021 09:48:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633366090; cv=none; d=google.com; s=arc-20160816; b=uqugGsKAH2a0mpRSUYjPPlIxQV49Cey+gtuxdHJPKYwToLJITsltysq/JvzLKEteVz 2Ylw24tF/UySIYMNZyDQYRq4aVntNx9rOyT+aSlmwjbUjKNU3w7ZIU07jczrruuH7rkG 623Dz+yzQ+cMYOPcEgt8uf5XKM9QVl5JLxUzn0AQ4jO5OxlN1J9S0tvQt/mWat24DrXM vAYfEh2tVu9Ov9qAoRwaBAjkvic002QofxHWlkjfF8cHRs2Si/GMmeT1uCIuzUpkoFw3 mnpm+W8Censddeo3rff0+Sc+NBU+sFs0sWc4KuHanXPEsurrNQ116CNNSo0Bzh7H76ZF XXzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=e/t8zt/ylCVrSfd+isXFTR1YSPHFGcAlI3UChpcrLpc=; b=fSU45J663ssFE2fmYgUPy2GbKAQ4BfQaNb8216FJDqcrA48U+k4KLVCchp+ha6cCKP SIs8lun2849QxQ1aVeTN21UYiL5vRAjjQeprq9mc3pKPwNrIlaS3wrTVeD1MwMBjHPFM xJggcYc1iiFLwbMez1hmd6nRDBmp3wetKpILUh5BYsCLU13Z0EV3I1c+exADrxWYtBEL Q0GOiXiGX52tB6FMtgjvwsdzjScxxXj/oOcDGHbVqmGMyb4y3JRpvJ8r4+WHJB0eVC/j r4Lr4H/aHRYUFpUzTnbqeGgyxVxBffFP9RX8zi7c7Aw3Ssifigd+Nr/tyOB6ya6NEX5l yWCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=upP7ctRV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w25si23423938pgl.448.2021.10.04.09.47.57; Mon, 04 Oct 2021 09:48:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=upP7ctRV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237746AbhJDNjG (ORCPT + 99 others); Mon, 4 Oct 2021 09:39:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:51976 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237396AbhJDNhI (ORCPT ); Mon, 4 Oct 2021 09:37:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B581961371; Mon, 4 Oct 2021 13:16:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633353408; bh=ICQ9giKx1yX1KNC8hrc8Dh7/P4Nbzd8yq/uN1thGmYI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=upP7ctRV2UgT/psxmJF3oS97ki7Z94sppTXoLvIePzIZjE0q+rE0ywsNov2R9cRgt XshK6O/vrc52n7/jRST3zF9kJ1s8TAWuaQovxm77H59olPnyH3Q1D8lBEXH70Rq2+X gxnghF8LDmB4zisA4sn983OZn0HTS9U9jZM4zKPA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiri Benc , Andrii Nakryiko , Daniel Borkmann , Sasha Levin Subject: [PATCH 5.14 116/172] selftests, bpf: Fix makefile dependencies on libbpf Date: Mon, 4 Oct 2021 14:52:46 +0200 Message-Id: <20211004125048.730812023@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211004125044.945314266@linuxfoundation.org> References: <20211004125044.945314266@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jiri Benc [ Upstream commit d888eaac4fb1df30320bb1305a8f78efe86524c6 ] When building bpf selftest with make -j, I'm randomly getting build failures such as this one: In file included from progs/bpf_flow.c:19: [...]/tools/testing/selftests/bpf/tools/include/bpf/bpf_helpers.h:11:10: fatal error: 'bpf_helper_defs.h' file not found #include "bpf_helper_defs.h" ^~~~~~~~~~~~~~~~~~~ The file that fails the build varies between runs but it's always in the progs/ subdir. The reason is a missing make dependency on libbpf for the .o files in progs/. There was a dependency before commit 3ac2e20fba07e but that commit removed it to prevent unneeded rebuilds. However, that only works if libbpf has been built already; the 'wildcard' prerequisite does not trigger when there's no bpf_helper_defs.h generated yet. Keep the libbpf as an order-only prerequisite to satisfy both goals. It is always built before the progs/ objects but it does not trigger unnecessary rebuilds by itself. Fixes: 3ac2e20fba07e ("selftests/bpf: BPF object files should depend only on libbpf headers") Signed-off-by: Jiri Benc Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/ee84ab66436fba05a197f952af23c98d90eb6243.1632758415.git.jbenc@redhat.com Signed-off-by: Sasha Levin --- 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 f405b20c1e6c..93f1f124ef89 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -374,7 +374,8 @@ $(TRUNNER_BPF_OBJS): $(TRUNNER_OUTPUT)/%.o: \ $(TRUNNER_BPF_PROGS_DIR)/%.c \ $(TRUNNER_BPF_PROGS_DIR)/*.h \ $$(INCLUDE_DIR)/vmlinux.h \ - $(wildcard $(BPFDIR)/bpf_*.h) | $(TRUNNER_OUTPUT) + $(wildcard $(BPFDIR)/bpf_*.h) \ + | $(TRUNNER_OUTPUT) $$(BPFOBJ) $$(call $(TRUNNER_BPF_BUILD_RULE),$$<,$$@, \ $(TRUNNER_BPF_CFLAGS)) -- 2.33.0