From nobody Mon Feb 9 09:22:52 2026 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:a02:b119:0:0:0:0:0 with SMTP id r25csp3700624jah; Tue, 18 Jan 2022 03:30:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJyd90HxlVyRs3owI8lT6NGy90RXSVcigHTA6qnCsGB1na8cWBKz8vPt7/8kYzcdyu/XdRNp X-Received: by 2002:a17:902:b08b:b0:149:ee23:8907 with SMTP id p11-20020a170902b08b00b00149ee238907mr27907189plr.59.1642505451594; Tue, 18 Jan 2022 03:30:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642505451; cv=none; d=google.com; s=arc-20160816; b=XhyVJDhtbspzjakoyr5Df8w9CSXJXQervvHK36cWzVZyMcuK5Qf+swPdNfLPrd6pNr LMOI8lwq0ih2ojjQUQG82mIqqTDISV2ejkF7G6KeY5tn2hPCd9KXRhcDyJt88ploDzm4 hY6QdvLSb6RYosreLdwBvaD2IuI/K3OYDGGjPxMyP21UytLtN2iqhMj7N8+4FF8BT9QT 6bhnIIWUdtO4xYTUsQJDFJGfWPdCisBz0PkFCDY1Z1p8MLcxTa6z+oOMHgBx4WdH5UEK lHG8JZAJIRUColC869RcOhGphjR7nDmZX1d3SK00DKncOgC2FJhHtn6fCrPEVZDRqkjy 6BcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=BaHsoZFWiX9mv47s4BV0uxhL1kBfcottdTr5yzS2FcM=; b=NUgHD55o+VeTzlSBYEIz/C49nOvd6eTfBv6QW3lEQAuPe401Y0vr976wp9oY6XqIka BrzZclI/9h4OcYc+i/WqPNXDsqlo4Gzj0Wlv23IaClhzS3Xh4DLct05Bmlcd5jOgqjUi 2uexoNq8TbMMc9FNzloqHBohgYWI6yGMnbjPTMnTB+/Pl/QMji/yzxYPxRE4zC0IqAm2 MAPK8bpuOEEbRYsuJmjewBzlPs1YyuyHzil7qHvcI+pZ4ubogVrGepzKecmZas3gWkow Y09oztt/hPLmfDM6pbJ++ey7JM2L1ZZN4WAuLrIr8/+nfN9XbKe1yUa5WfMUF95onNMj IfzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=H5Ez+RSq; spf=pass (google.com: domain of mptcp+bounces-3199-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 147.75.69.165 as permitted sender) smtp.mailfrom="mptcp+bounces-3199-wpasupplicant.patchew=gmail.com@lists.linux.dev"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from sjc.edge.kernel.org (sjc.edge.kernel.org. [147.75.69.165]) by mx.google.com with ESMTPS id w13si21647140plg.140.2022.01.18.03.30.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Jan 2022 03:30:51 -0800 (PST) Received-SPF: pass (google.com: domain of mptcp+bounces-3199-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 147.75.69.165 as permitted sender) client-ip=147.75.69.165; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=H5Ez+RSq; spf=pass (google.com: domain of mptcp+bounces-3199-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 147.75.69.165 as permitted sender) smtp.mailfrom="mptcp+bounces-3199-wpasupplicant.patchew=gmail.com@lists.linux.dev"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sjc.edge.kernel.org (Postfix) with ESMTPS id 28E343E0A57 for ; Tue, 18 Jan 2022 11:30:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4A49C2CA0; Tue, 18 Jan 2022 11:30:50 +0000 (UTC) X-Original-To: mptcp@lists.linux.dev Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A8E792C9C for ; Tue, 18 Jan 2022 11:30:48 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: usama.anjum) with ESMTPSA id E62571F43E07 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1642505447; bh=gjVHu+jWyShCzwYH7u0I9MtX/la4ZTeWCA5VgFyOCk0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H5Ez+RSqJ5X1uYdxMk4VSBSDHzgIj98jIrxhiayB5u+Bf/1+/fLT/K6COMerWQlfS VW/rkRju533nMAx2e090k8UIETKYz3QclugU8+pCks9IHB6IuQkWpSVjAh3OWdhso6 S5B9q/6noRCvHIWKgKph20ScEZj9ooGTIbEJemqnlrOsL3wsaJKfHZDYy43YkMJSaV bj+xXPckZj58v9uoUepZW9qEdbVxU5zVD5AV5ZElwlFEezpdkD052I5P7QjG6cniH5 Js/2yfMPqi9CvG9YUju7950Nip/slm5k1tvquYSS3ciIb/FcqCCs4Ac7L6DObu+l78 e2bEsfyep0R6A== From: Muhammad Usama Anjum To: Shuah Khan , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Darren Hart , Davidlohr Bueso , =?UTF-8?q?Andr=C3=A9=20Almeida?= , Paolo Bonzini , =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= , "David S. Miller" , Jakub Kicinski , Mat Martineau , Matthieu Baerts , Andrew Morton , chiminghao , linux-kselftest@vger.kernel.org (open list:KERNEL SELFTEST FRAMEWORK), linux-kernel@vger.kernel.org (open list), kvm@vger.kernel.org (open list:KERNEL VIRTUAL MACHINE (KVM)), linux-security-module@vger.kernel.org (open list:LANDLOCK SECURITY MODULE), netdev@vger.kernel.org (open list:NETWORKING [GENERAL]), mptcp@lists.linux.dev (open list:NETWORKING [MPTCP]), linux-mm@kvack.org (open list:MEMORY MANAGEMENT) Cc: Muhammad Usama Anjum , kernel@collabora.com Subject: [PATCH 01/10] selftests: set the BUILD variable to absolute path Date: Tue, 18 Jan 2022 16:29:00 +0500 Message-Id: <20220118112909.1885705-2-usama.anjum@collabora.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220118112909.1885705-1-usama.anjum@collabora.com> References: <20220118112909.1885705-1-usama.anjum@collabora.com> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The build of kselftests fails if relative path is specified through KBUILD_OUTPUT or O=3D method. BUILD variable is used to determine the path of the output objects. When make is run from other directories with relative paths, the exact path of the build objects is ambiguous and build fails. make[1]: Entering directory '/home/usama/repos/kernel/linux_mainline2/tool= s/testing/selftests/alsa' gcc mixer-test.c -L/usr/lib/x86_64-linux-gnu -lasound -o build/kselft= est/alsa/mixer-test /usr/bin/ld: cannot open output file build/kselftest/alsa/mixer-test Set the BUILD variable to the absolute path of the output directory. Make the logic readable and easy to follow. Use spaces instead of tabs for indentation as if with tab indentation is considered recipe in make. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/Makefile | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Mak= efile index d08fe4cfe811..a7b63860b7bc 100644 --- a/tools/testing/selftests/Makefile +++ b/tools/testing/selftests/Makefile @@ -114,19 +114,27 @@ ifdef building_out_of_srctree override LDFLAGS =3D endif =20 -ifneq ($(O),) - BUILD :=3D $(O)/kselftest +top_srcdir ?=3D ../../.. + +ifeq ("$(origin O)", "command line") + KBUILD_OUTPUT :=3D $(O) +endif + +ifneq ($(KBUILD_OUTPUT),) + # Make's built-in functions such as $(abspath ...), $(realpath ...) cann= ot + # expand a shell special character '~'. We use a somewhat tedious way he= re. + abs_objtree :=3D $(shell cd $(top_srcdir) && mkdir -p $(KBUILD_OUTPUT) &= & cd $(KBUILD_OUTPUT) && pwd) + $(if $(abs_objtree),, \ + $(error failed to create output directory "$(KBUILD_OUTPUT)")) + # $(realpath ...) resolves symlinks + abs_objtree :=3D $(realpath $(abs_objtree)) + BUILD :=3D $(abs_objtree)/kselftest else - ifneq ($(KBUILD_OUTPUT),) - BUILD :=3D $(KBUILD_OUTPUT)/kselftest - else - BUILD :=3D $(shell pwd) - DEFAULT_INSTALL_HDR_PATH :=3D 1 - endif + BUILD :=3D $(CURDIR) + DEFAULT_INSTALL_HDR_PATH :=3D 1 endif =20 # Prepare for headers install -top_srcdir ?=3D ../../.. include $(top_srcdir)/scripts/subarch.include ARCH ?=3D $(SUBARCH) export KSFT_KHDR_INSTALL_DONE :=3D 1 --=20 2.30.2