From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CD75437648D for ; Wed, 29 Apr 2026 14:34:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777473264; cv=none; b=dhfRpgsqgPDoG2vvxC++bkEixAEUwISdFSe05icjWzaivN4hMnJQ4YA9ysDOoMFqrXc6p9ysJB13bB3lziI5B5vhK3zNTzRmbTDLHx7n+BSn3qp/WmU0CFX8RRWPtqwiNfsFbBMTJMg/DTNf5qcktdmh8bgiYz/wnyHH6jNngUI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777473264; c=relaxed/simple; bh=aqXG984YlUxMtsZ+i7vquyVJaGX8IceA6DEnTDh+TX4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZilPFhaGyvWd26zfjdMRm07odU/HTuPEC9LoCvNF4tzlmMd3fGj9z9w9xQNZ+XGTGdnji1Jo6sXTmPyWg3TsJT3mMUGyVNwfEmzgK2nK6XEgwuhJyWPVasq/EG6lfvCoqTN2ghVF27rEezflGC1m0yFq0I3OiZb4MQSwoozhPW8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=Q2T3FS+p; arc=none smtp.client-ip=209.85.208.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="Q2T3FS+p" Received: by mail-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-6746d0b2b4aso16674704a12.3 for ; Wed, 29 Apr 2026 07:34:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1777473261; x=1778078061; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ysP9AGtPxCAbfR+Tj7mfuITrZ+N0ZILV2wyZ0Jzr9sk=; b=Q2T3FS+pNznYI2mAKhOMxhCmLzbjwKMg1tjPVGpb3tsUzCYxvefV9zEcqk48e8CLDr 56PbeUTFb8lpvHfSgWQOvrssDg0HJM9ogT3QS11oxs/CR29HpPltth6GVZmvbi6TSMM4 p4SbiHLiir/FdvwJgfwu6OBa2oGbzvV3YPhpo9NC6gXUUrIyCBZ566WWpLRo+E1tqiCY 9yXsZT9zDqeUq6QWRhu+hMP7GJ+/wvSemDNnQrAcUXHiO4lMTmkh0Z/BYqy49KUJIPw+ 6URLKbBPdtM7gvy5WWHFdWoDjVIxNMOQoDrDkCt11LXw9Ppu0loT859c3e/gsZ/lcSKm X+CA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777473261; x=1778078061; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=ysP9AGtPxCAbfR+Tj7mfuITrZ+N0ZILV2wyZ0Jzr9sk=; b=llSw6Us9CjElJ3d7G5/zvXjgUMfFd2FJYN/u3JAtQs1tG+HJ47NZuJQ3QFDmS8S/jc dNsnF9jm3jO2Dito68uu7Pb6yyEBczmemGyLe0RzR/UvHmEzFZfg9mOsdY0i6d9vZSG2 QRCRhMmObEzINCGeXXor0Thdc+05p/s0EP/eZEnYs2FosvgUwpBM48bppZvpFdBRJZwE mxz9LsWHwMy7GgwQ3k/PHqwmHPDFbP6VoEyoksXGwvADNRzYQOAey2xzj0X0Vlp9kYST +jrK26pPLKOlgbUtYMQFOzNILr4CZX0ndfGC5/5Fq4FCTJVKzjSEcbG0IzdKVHImDyNu qM/Q== X-Forwarded-Encrypted: i=1; AFNElJ86NFptQ19vpk3qFhfns+Is/NQkZsb9HaLakwPEQopS40DMcoEHXeT5/4xWq2hSFmAg/fYqPQQG94f6Nvo=@vger.kernel.org X-Gm-Message-State: AOJu0YyhPBpeIjmpNmxJ/rVDB7ZLik2e6xIRmPYO1UB+sA6N8I8i7/hF ANZ+5+2X97MTaxsSaC4dLV5rcuBq7rNbRPPOnwkZjJtKF8dInFg5l1inYS4GVrBCWf8uiCVthjn 93yoY+x4= X-Gm-Gg: AeBDiesvz15fWBDu+txe5Oe2klfWPG/S8ZuHlpTVCsaoZJ8eDZf+6zAZOLZX2bVALrJ yp1Ybw/UKyrWuGACqskCgPyBM7TgGr54dJnuMwcyCVEo8+XWn6Bgg5NgjNARPDaUft84JFVTAPD 0ju/FR0qLFvtdAHaGUHprb3vx8w5PAFGFGmlwUNBGG+XvIIDTLprVDMcVv/88OBvzFLQuFr/TwP mEBWseTx6xHha8BtlMhIiZ8hwLsA7uh6tcTxE3qRdd+e3DjgNSlUXsJjmT8Rehqrvl21Mhkt8lp Y/FZ4T4kousrSoz7If7PKZDYRyMneC/kFbjC0XNl8cHb+vnSo5VAIEPRAen3Cdh2CqSgDYYkLi0 I6bzbcYkbdpE7poTVL/sjOm107FYfDfX40mZghtHijWed3ZYB+QZF0ErKU/KedP70uSwzzsq+Wv RN+7gW1i2+UMm2ruiFFA3+iOKl X-Received: by 2002:a17:907:c50e:b0:b97:c719:14d4 with SMTP id a640c23a62f3a-bb93e64c44dmr268755366b.29.1777473260782; Wed, 29 Apr 2026 07:34:20 -0700 (PDT) Received: from localhost ([2804:7f0:b765:105d:ce28:aaff:fe86:149c]) by smtp.gmail.com with ESMTPSA id 71dfb90a1353d-573b6d87e40sm1209035e0c.12.2026.04.29.07.34.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Apr 2026 07:34:19 -0700 (PDT) From: =?utf-8?q?Ricardo_B=2E_Marli=C3=A8re?= Date: Wed, 29 Apr 2026 11:33:47 -0300 Subject: [PATCH bpf-next v9 05/11] selftests/bpf: Make skeleton headers order-only prerequisites of .test.d Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20260429-selftests-bpf_misconfig-v9-5-c311f06b4791@suse.com> References: <20260429-selftests-bpf_misconfig-v9-0-c311f06b4791@suse.com> In-Reply-To: <20260429-selftests-bpf_misconfig-v9-0-c311f06b4791@suse.com> To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Kumar Kartikeya Dwivedi , Song Liu , Yonghong Song , Jiri Olsa , Shuah Khan , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt Cc: bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Alan Maguire , "Ricardo B. Marliere" X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openssh-sha256; t=1777473237; l=2402; i=rbm@suse.com; h=from:subject:message-id; bh=aqXG984YlUxMtsZ+i7vquyVJaGX8IceA6DEnTDh+TX4=; b=U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgguRCc5X8/UX9M40lkMnr//aFGOhce x5ezt8MFNUFlqYAAAAGcGF0YXR0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5AAAA QFgbYQ184IounnbSc2yS5rRTZVxJcGqh/hXS3g0Je6tNmN/jnaYCgSWS4Hbx4AaGX+s1ErFeyEs tZWsUuJcpdAo= X-Developer-Key: i=rbm@suse.com; a=openssh; fpr=SHA256:pzhe0fJpYLz+3cZ33FFPhIfaUElk9CXPFFXmalIH+1g The .test.d dependency files are generated by the C preprocessor and list the headers each test file actually #includes. Skeleton headers appear in those generated lists, so the .test.o -> .skel.h dependency is already tracked by the .d file content. Making skeletons order-only prerequisites of .test.d means that a missing or skipped skeleton does not prevent .test.d generation, and regenerating a skeleton does not force .test.d to be recreated. This avoids unnecessary recompilation and, more importantly, avoids build errors when a skeleton was intentionally skipped due to a BPF compilation failure. $$(BPFOBJ) is intentionally kept as a normal prerequisite: a libbpf rebuild legitimately invalidates .test.d, since libbpf header changes can affect the headers .test.o sees. Only the skeleton headers are moved to order-only. Note that adding a new BPF skeleton via a modified existing local header still works correctly: GNU make builds order-only prerequisites that do not exist (the order-only qualifier only suppresses timestamp-driven rebuilds, not existence-driven builds), so a brand-new .skel.h listed in TRUNNER_BPF_SKELS is generated even when .test.d is otherwise up to date. The modified local header invalidates .test.o through the previously included .d content, forcing a recompile that regenerates .test.d with the new .skel.h dependency captured by gcc -MMD. Signed-off-by: Ricardo B. Marlière --- tools/testing/selftests/bpf/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index 9a4d8bea0c18..608e6dff0392 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -726,11 +726,11 @@ $(TRUNNER_TEST_OBJS): $(TRUNNER_OUTPUT)/%.test.o: \ $(TRUNNER_TEST_OBJS:.o=.d): $(TRUNNER_OUTPUT)/%.test.d: \ $(TRUNNER_TESTS_DIR)/%.c \ $(TRUNNER_EXTRA_HDRS) \ + $$(BPFOBJ) | $(TRUNNER_OUTPUT) \ $(TRUNNER_BPF_SKELS) \ $(TRUNNER_BPF_LSKELS) \ $(TRUNNER_BPF_LSKELS_SIGNED) \ - $(TRUNNER_BPF_SKELS_LINKED) \ - $$(BPFOBJ) | $(TRUNNER_OUTPUT) + $(TRUNNER_BPF_SKELS_LINKED) ifeq ($(filter clean docs-clean emit_tests,$(MAKECMDGOALS)),) include $(wildcard $(TRUNNER_TEST_OBJS:.o=.d)) -- 2.54.0