Received: by 2002:a05:7412:8d09:b0:fa:4c10:6cad with SMTP id bj9csp369519rdb; Tue, 16 Jan 2024 03:01:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IGuuTicqQ7Pk2eWFiv0yrPFqrLYszObwjUk6t94ynR4s2Iiu3Y7qSV2a1cn4j4INPq8CgoY X-Received: by 2002:a67:c90f:0:b0:467:dedd:f638 with SMTP id w15-20020a67c90f000000b00467deddf638mr3436972vsk.31.1705402873536; Tue, 16 Jan 2024 03:01:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705402873; cv=none; d=google.com; s=arc-20160816; b=UNlNpDtvRwKDDV9CS1KNnKpnEVT5kIZCdDSPMfIt7BKPyLKSTF4iBGq98+1sUqjlP9 gEGnM4IKunD2UEVt4tvaQwZuCZiO8Hu3fNxFgzj4XpNxNvrmz2s6eUnKrKqsvEyVd0sI /u13g/dlM+qj6+ixMSSRjwdx3cKF5kgujjdOw9ufITjKOZMnuXFDBR1lobSPIrEaCoUy x3GwNTwh91n+1U0ZCUKE2/l5kCwfvRdpzIy0rPb16X7j0uXePfHmMyyU8xGDOmJYu9vA FfPNDT59Lq87EbgFp8V5gRgjP5HWgvQpIPtHnd9rOhIkQPXflrGTEOrV7qjTRc1XvjZS jyJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=pcWb4xdqODQ3UbCtXDY2YkyDoMiqkV+ea15F+gX5k5c=; fh=V4pSvV2Azm+DXmKToQGZQrLvHsSdjiaUmN1sVJAr58g=; b=m2Xd9bDjaotor+2rCM2HLzly9QAjKd6+Fp0grKfDrRTjsZ2hHO4JvdjfQ1tx8k7ma+ DZrXEdFiLwNB5hK47DjUBdYq9kd/A8luLEBRqLhVd8x+9mEvuk1HSVbvwgZTKgSbtX5G uH2RXwT7fZJ0M+svk9HteyZQ09w+JfWVo4AC1U8a5MKpFXD9Eri5BDXHyp4KnrUK4xN0 2tTGvsFm1VwtE5Z1zn19De6KyGksutJSO+LPGdV9ZcoR9hJzkdOyCREewlhngLSFoShT DfGowdgSP8EO7MulI3u/hq95G2+gYFlF+Gzcete+ZjIHq2UMEEjawTEPQ64JvfqGiGCz VYGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=b2kyqoKz; spf=pass (google.com: domain of linux-kernel+bounces-27285-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-27285-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id r5-20020a0c8d05000000b0067f2c590fd8si9251503qvb.527.2024.01.16.03.01.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 03:01:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-27285-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=b2kyqoKz; spf=pass (google.com: domain of linux-kernel+bounces-27285-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-27285-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 4A4861C22FE2 for ; Tue, 16 Jan 2024 11:01:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A3AEE1A594; Tue, 16 Jan 2024 11:01:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="b2kyqoKz" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 D89EF1A58B; Tue, 16 Jan 2024 11:01:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 56D2AC433C7; Tue, 16 Jan 2024 11:01:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705402865; bh=VhwDL3RVVRvjZm9EKpeTMkUVJ50Ng4cKI1vqO1YAXs0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=b2kyqoKzlVYBmMLSk/cso/xPCijzR4O/K2pp43h7eBoVGitzw4lVg/JBSuKS9jdmt p7JThLZ5dakHKCUgqkpRlNjHLzDrHxH+Hwp13CWNtPB/8SbWbVWa1me2BosbhWM3Pi s97s2laKsL0gZwzhXD7R0XI0qETI2lOiufCJa5JQCo98NJx8QoBj6QCCPcXGWXOK0E ydabhHbwRIh47yH28+ADtdSQocSFvuRIKyNPsYxFNrybL3BmuxAg0dwuzt9wkyc3fU aDh8LI3odnIUh6a4bBrNKRNMSSez8wqC9ZuS9KVuRUrEh70rOui+2vNdyOU6T4Vdyq N8r+B/qq37dKA== Received: by mail-oa1-f54.google.com with SMTP id 586e51a60fabf-204520717b3so6729721fac.0; Tue, 16 Jan 2024 03:01:05 -0800 (PST) X-Gm-Message-State: AOJu0YyNlvDitihsp6pZQi5zmUyu5hdC2FW83NVZm43INIwWIiQSmOZh cOSRKppLnS0Xrv5Rt52Rrnn0BZ/oWcCbWmrCv6M= X-Received: by 2002:a05:6870:c085:b0:205:6728:92c5 with SMTP id c5-20020a056870c08500b00205672892c5mr9527038oad.3.1705402864710; Tue, 16 Jan 2024 03:01:04 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240115001606.15477-1-richard.weiyang@gmail.com> In-Reply-To: <20240115001606.15477-1-richard.weiyang@gmail.com> From: Masahiro Yamada Date: Tue, 16 Jan 2024 20:00:28 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] kbuild: take vmlinux.[ao] out of single-targets To: Wei Yang Cc: nathan@kernel.org, nicolas@fjasle.eu, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Miguel Ojeda Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jan 15, 2024 at 9:17=E2=80=AFAM Wei Yang wrote: > > For current kernel, when we make vmlinux.a or vmlinux.o, following > message would display. > > $make vmlinux.o > /dir/to/kernel/Makefile:1887: warning: overriding recipe for target 'vmli= nux.o' > /dir/to/kernel/Makefile:1138: warning: ignoring old recipe for target 'vm= linux.o' > CALL scripts/checksyscalls.sh > DESCEND objtool > INSTALL libsubcmd_headers > make[2]: Nothing to be done for 'vmlinux.o'. > > The reason is vmlinux.[ao] is treated as single target, while the rule > is written in root Makefile. > > This patch fixes this by take them out of single-targets. > > Signed-off-by: Wei Yang > CC: Masahiro Yamada > CC: Miguel Ojeda > CC: Nathan Chancellor > --- Not all targets can be built by the single-target. Just do not do "make vmlinux.o". > Makefile | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/Makefile b/Makefile > index f1b2fd977275..66fb08f6d971 100644 > --- a/Makefile > +++ b/Makefile > @@ -280,6 +280,7 @@ no-dot-config-targets :=3D $(clean-targets) \ > no-sync-config-targets :=3D $(no-dot-config-targets) %install modules_si= gn kernelrelease \ > image_name > single-targets :=3D %.a %.i %.ko %.lds %.ll %.lst %.mod %.o %.rsi %.s %.= symtypes %/ > +no-single-targets :=3D vmlinux.o vmlinux.a > > config-build :=3D > mixed-build :=3D > @@ -315,11 +316,14 @@ ifeq ($(KBUILD_EXTMOD),) > endif > > # We cannot build single targets and the others at the same time > -ifneq ($(filter $(single-targets), $(MAKECMDGOALS)),) > +ifneq ($(filter-out $(no-single-targets), $(filter $(single-targets), $(= MAKECMDGOALS))),) > single-build :=3D 1 > ifneq ($(filter-out $(single-targets), $(MAKECMDGOALS)),) > mixed-build :=3D 1 > endif > + ifneq ($(filter $(no-single-targets), $(MAKECMDGOALS)),) > + mixed-build :=3D 1 > + endif > endif > > # For "make -j clean all", "make -j mrproper defconfig all", etc. > -- > 2.34.1 > --=20 Best Regards Masahiro Yamada