From nobody Tue Apr 7 13:50:15 2026 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (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 B2365390CB0 for ; Mon, 6 Apr 2026 18:22:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775499762; cv=none; b=Din9cQTFpc6Kg0r2MZ9a/4bgkmpJDoacWo/piDnvyKWmfU/UeWGFsiTkXzboF4tPsdsBDGLiRRaTiOIlYmiFZaYyq1GtSDItVuQizsBFGapubnqokkJFtG8L0r0nuo48jjQjwscvhkSmR34vp2F9obzrQD+jVopjmyzhJQBBEMU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775499762; c=relaxed/simple; bh=3TV46EUd5SknZIe1cqE/s5d8RQ9ID+g5k7uHbLKYsxk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pcj+CT+WxuYZrg5PPwg5QWtHBbD7rfhmLt4bo/LrPL38iWaShPVaimMx2NTqC1em7EptRn4R/rdz6IRUMf62KyWUxqTSbY24SXGCqmLn3KN2VNEYscnek1xvr7yCYqk0wRsAOR90gL27oH2Qs89fH8VEiwun6Hw0/exEblbyXzA= 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=OOfHRBg4; arc=none smtp.client-ip=209.85.128.54 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="OOfHRBg4" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-488a14c31eeso17409075e9.0 for ; Mon, 06 Apr 2026 11:22:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1775499759; x=1776104559; 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=ozbTMFxdM1cFM2UvPkE2WgfaDTmm+Y//gdi2ZxNHkqg=; b=OOfHRBg4YXgfTCAbat7s73V14BtxVWe6P5z1top6Se/gwp8kuuX1Xt2Z7v35vkQ3sX x0hx8oKqVthmYoaiRg8Cr/OkkojkZU9YaOGLa9u6PTWgqAliCXBZhn1/OzovTDaIpB+0 OZtGuL/RvlhJUikdW6Z9RW7t7Z+NexYGa6tbO2n8T3Ez5JFWqInB0cy4hgivjsfIcclb WwgqbK6acae9z7McykWBUaJkg7PJN9NnlLDwo/40rOQ7JdSi3liMVuHSLC5McxbS/UaJ S5+uqSn5BjSYyIiGB7BOQ5y8WemV0RJFLyrjxiBVVEbse7Au6a5+HikzHmtGWu2s5TNY JwKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775499759; x=1776104559; 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=ozbTMFxdM1cFM2UvPkE2WgfaDTmm+Y//gdi2ZxNHkqg=; b=T7aQ/bYNDvo9q99VwuqBbYXe91nibsBObSZ6/3Pt9exJUbr2zv7Zafl2wiqx+X6Hk4 qw3jJCF+b/ickgL9RQqhxrgvM7GwlF3A+TvLR6PvxhC6tLren1O0ThyFvtWn979/pFdc vgiMklVT5xpcW3/OxtBLLugWQJLE2LAocLoESKzRC4Z+GlvnTP+Rc7sLolN9lNqPUQBd +5MEz8Y1exgfIJJcaeNkvYypVLLAnaMZLgJvNU5PUO9BZN1THZIYlPM8JNrBlFldOy2v bFP0Im269doxgSe84p/g0e+w/ueAz5MYMzF+eSMeFNkMIVdvrX+BYJoHmzyc2pGNPIfD 8baA== X-Forwarded-Encrypted: i=1; AJvYcCU8Pc9PTsvELNq1UPVcgjXHhTV6xKRLeqLgJxoliqzbLukL3bRwO0NlUAWfGBVbKyt1WMxfeZ3puvswg1s=@vger.kernel.org X-Gm-Message-State: AOJu0Yw6oBpd336SrpU6zduVhWt93EuOoNJtQk+PM9OkyZqi8+3PEQcF 64j2c3ZIq6KAZNREy72GyziBprVuLsDLGf18Mi/JzKmUCJut/F0eYzJO+EyQGUA14XU= X-Gm-Gg: AeBDietffO6a2vppnks4poMlCPU0gjgqcQitTS7BsIMdYZLZE9Dc0sDLINqm7tOq6cN POTWcnSTpFNeOscZ78q3QcwiUKJ/eUUbPJEdP44t529+9ZlNIhawjGxCkiKxIJPPuSND+7ZwxRZ ofFHwNW/3crJI9oI5wRRlECEagR5qjah9aUaTzLIjQCtUcZveZ2kZbL4/EHOLXStCCrtlo0Fv3S wiU8d8rOQT6WiINl7SDNrGyBm3MNi1vOupAojqtRaPp3pOxceUVAGu42sSf3Znc8cYPRx8KYF6U eTk6/mQE+wGkZ3iklgictKAun7YT2HyG37N7iLvOGGPPkqXNoHPxlQGjYAM6WX3V6YSUGoK8yQ5 RdFGgsYs8cTANmui12iprzNJJhstcLjh9qYNUJb9X+e0j33hNvJYeTG60jxSzSaFLvhxRBxlpLd 0woBw3VMbnZzbHz5GKU9vGE5w= X-Received: by 2002:a05:600c:630a:b0:485:2fe9:336f with SMTP id 5b1f17b1804b1-488998e3cbemr200669865e9.30.1775499759198; Mon, 06 Apr 2026 11:22:39 -0700 (PDT) Received: from localhost ([2804:7f0:b767:120d:a4df:3777:2c55:2b95]) by smtp.gmail.com with ESMTPSA id 71dfb90a1353d-56d9bd03371sm16894540e0c.16.2026.04.06.11.22.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Apr 2026 11:22:38 -0700 (PDT) From: =?utf-8?q?Ricardo_B=2E_Marli=C3=A8re?= Date: Mon, 06 Apr 2026 15:22:18 -0300 Subject: [PATCH v4 06/10] selftests/bpf: Allow test_progs to link with a partial object set 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: quoted-printable Message-Id: <20260406-selftests-bpf_misconfig-v4-6-9914f50efdf7@suse.com> References: <20260406-selftests-bpf_misconfig-v4-0-9914f50efdf7@suse.com> In-Reply-To: <20260406-selftests-bpf_misconfig-v4-0-9914f50efdf7@suse.com> To: Andrii Nakryiko , Eduard Zingerman , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , 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, =?utf-8?q?Ricardo_B=2E_Marli=C3=A8re?= X-Mailer: b4 0.15.1 X-Developer-Signature: v=1; a=openssh-sha256; t=1775499736; l=2109; i=rbm@suse.com; h=from:subject:message-id; bh=3TV46EUd5SknZIe1cqE/s5d8RQ9ID+g5k7uHbLKYsxk=; b=U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgguRCc5X8/UX9M40lkMnr//aFGOhce x5ezt8MFNUFlqYAAAAGcGF0YXR0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5AAAA QHgzmbHrz/FK9Sgm4TZs2qx29QrT5ezLiJaVCMLqS1IqbrpyBg6QBBaO/9Yl2NcpcP/Xuqqj1Sm 8Cy/tiBeFjAc= X-Developer-Key: i=rbm@suse.com; a=openssh; fpr=SHA256:pzhe0fJpYLz+3cZ33FFPhIfaUElk9CXPFFXmalIH+1g When individual test files are skipped due to compilation failures, their .test.o files are absent. The linker step currently lists all expected .test.o files as explicit prerequisites, so make considers any missing one an error. Move TRUNNER_TEST_OBJS to the order-only prerequisite list so that their absence does not prevent linking. Use $(wildcard ...) in the filter expression passed to the linker so that only the objects that were actually built are linked in. Place the wildcard expansion before $^ in the filter to preserve the original link order: test objects must precede libbpf.a so that GNU ld, which scans static archives left-to-right, pulls in archive members that are referenced exclusively by test objects (e.g. ring_buffer__new from ringbuf.c). Signed-off-by: Ricardo B. Marli=C3=A8re --- tools/testing/selftests/bpf/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests= /bpf/Makefile index e67f9c4cb5d7..a12bc9d76f8e 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -738,14 +738,14 @@ endif # some X.test.o files have runtime dependencies on Y.bpf.o files $(OUTPUT)/$(TRUNNER_BINARY): | $(TRUNNER_BPF_OBJS) =20 -$(OUTPUT)/$(TRUNNER_BINARY): $(TRUNNER_TEST_OBJS) \ - $(TRUNNER_EXTRA_OBJS) $$(BPFOBJ) \ +$(OUTPUT)/$(TRUNNER_BINARY): $(TRUNNER_EXTRA_OBJS) $$(BPFOBJ) \ $(TRUNNER_LIB_OBJS) \ $(TRUNNER_BPFTOOL) \ $(OUTPUT)/veristat \ - | $(TRUNNER_BINARY)-extras + | $(TRUNNER_BINARY)-extras \ + $(TRUNNER_TEST_OBJS) $$(call msg,BINARY,,$$@) - $(Q)$$(CC) $$(CFLAGS) $$(filter %.a %.o,$$^) $$(LDLIBS) $$(LLVM_LDLIBS) $= $(LDFLAGS) $$(LLVM_LDFLAGS) -o $$@ + $(Q)$$(CC) $$(CFLAGS) $$(filter %.a %.o,$$(wildcard $(TRUNNER_TEST_OBJS))= $$^) $$(LDLIBS) $$(LLVM_LDLIBS) $$(LDFLAGS) $$(LLVM_LDFLAGS) -o $$@ $(Q)ln -sf $(if $2,..,.)/tools/build/bpftool/$(USE_BOOTSTRAP)bpftool \ $(OUTPUT)/$(if $2,$2/)bpftool =20 --=20 2.53.0