From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id CAAC0C433F5 for ; Wed, 4 May 2022 21:42:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4B6826B0071; Wed, 4 May 2022 17:42:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 466036B0073; Wed, 4 May 2022 17:42:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 306C76B0074; Wed, 4 May 2022 17:42:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 226186B0071 for ; Wed, 4 May 2022 17:42:20 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id ED87D60657 for ; Wed, 4 May 2022 21:42:19 +0000 (UTC) X-FDA: 79429384398.14.1254344 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf14.hostedemail.com (Postfix) with ESMTP id BA676100087 for ; Wed, 4 May 2022 21:42:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651700538; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=HRX5qtW2EEmGEMXHczUsthdcbz9ukh0nNBZ98bC28bc=; b=fjd4lYYwU7BHl1xAHTTL1H6jV1d6CP27MRUllnpneOZUeH5HvGLf3NGyJxPiPBbDA/k/of 9TSYBhdTR2SiYA+eZeUmhvQPEWDl6fwSmC9WzdBDQuOanD+28nGo3DYpXkUheZuCk8hETp bR+dedBGg3RJmYAZK435id5kWOG3QyM= Received: from mail-yb1-f197.google.com (mail-yb1-f197.google.com [209.85.219.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-442-j45iy-w0Op2519ShTz9jtA-1; Wed, 04 May 2022 17:42:17 -0400 X-MC-Unique: j45iy-w0Op2519ShTz9jtA-1 Received: by mail-yb1-f197.google.com with SMTP id a17-20020a258051000000b00648703d0c56so2151590ybn.22 for ; Wed, 04 May 2022 14:42:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HRX5qtW2EEmGEMXHczUsthdcbz9ukh0nNBZ98bC28bc=; b=N4kv6dJ983Nioh0YUcT4xsXdiNXK34NvcQTo8BNLDHM0+2MOwyFrQe59kYuRH6JyRA yh0Bis05XngwxAwP2u1cEyyeka24SmecAJVJXh1eP03LWB8rPiNqiVBOwxvk/oVT5+Jb nPpEYZTsXdBvt91WVIH3VArjURTFhuvCg/Qq5WT7YOr6dImHZIXLigsKdCZhzaoAHFzI 1FUXZs2+2BWgMVqsI5YffqglwX70uT9AX5/Wcrtd2Wjl6b3tyRdxsmzsMCoV6W6WVFke HdLm3y09+zc/Wj6nZeKo0CbwSdNV58mfl0aeqibAxEpVv3pLfmCk8GPupuigTzzwM2tF h53A== X-Gm-Message-State: AOAM533jgPaQOhmOCwOqL7/m+6FcdHj4NL8VCWmB8McRQ5eoXOfGTpvx saEalTPPXQhGCDOutLm9u9F+R9r6dgJqEBLi6d/VAtg3qTDtKVk5RIt8WzDUMWWzMoNem2wIVpE KvCV2bPs3b0icpOLzvuNUOEXuZ58= X-Received: by 2002:a81:24d2:0:b0:2f7:b684:de49 with SMTP id k201-20020a8124d2000000b002f7b684de49mr21320560ywk.310.1651700536520; Wed, 04 May 2022 14:42:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWzirRBL9vf89yPl1FPvWpTzLBtnPK9ujluJTtUo5/JWthmBEQ3LMFqKZkp2R0Xo//8BMYUVIjDhyyfJU26pc= X-Received: by 2002:a81:24d2:0:b0:2f7:b684:de49 with SMTP id k201-20020a8124d2000000b002f7b684de49mr21320551ywk.310.1651700536331; Wed, 04 May 2022 14:42:16 -0700 (PDT) MIME-Version: 1.0 References: <20220504213454.1282532-1-jsavitz@redhat.com> In-Reply-To: <20220504213454.1282532-1-jsavitz@redhat.com> From: Joel Savitz Date: Wed, 4 May 2022 17:42:00 -0400 Message-ID: Subject: Re: [PATCH] selftests: vm: Makefile: rename TARGETS to VMTARGETS To: linux-kernel Cc: Andrew Morton , Shuah Khan , Sandipan Das , Dave Hansen , Nico Pache , linux-mm@kvack.org, linux-kselftest@vger.kernel.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="000000000000be641205de367f53" X-Stat-Signature: nxckn6bgjdhcc1crhbhw1fyzng6pyxr7 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: BA676100087 X-Rspam-User: Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=fjd4lYYw; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf14.hostedemail.com: domain of jsavitz@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=jsavitz@redhat.com X-HE-Tag: 1651700537-101356 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: --000000000000be641205de367f53 Content-Type: text/plain; charset="UTF-8" On Wed, May 4, 2022 at 5:35 PM Joel Savitz wrote: > The tools/testing/selftests/vm/Makefile uses the variable TARGETS > internally to generate a list of platform-specific binary build targets > suffixed with _{32,64}. When building the selftests using its own > Makefile directly, such as via the following command run in a kernel > tree: > > Oops, forgot to put the actual command in here, sending follow up. > One receives an error such as the following: > > make: Entering directory '/root/linux/tools/testing/selftests' > make --no-builtin-rules ARCH=x86 -C ../../.. headers_install > make[1]: Entering directory '/root/linux' > INSTALL ./usr/include > make[1]: Leaving directory '/root/linux' > make[1]: Entering directory '/root/linux/tools/testing/selftests/vm' > make[1]: *** No rule to make target 'vm.c', needed by > '/root/linux/tools/testing/selftests/vm/vm_64'. Stop. > make[1]: Leaving directory '/root/linux/tools/testing/selftests/vm' > make: *** [Makefile:175: all] Error 2 > make: Leaving directory '/root/linux/tools/testing/selftests' > > The TARGETS variable passed to tools/testing/selftests/Makefile collides > with the TARGETS used in tools/testing/selftests/vm/Makefile, so rename > the latter to VMTARGETS, eliminating the collision with no functional > change. > > Fixes: f21fda8f6453 ("selftests: vm: pkeys: fix multilib builds for > x86") > > Signed-off-by: Joel Savitz > --- > tools/testing/selftests/vm/Makefile | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/tools/testing/selftests/vm/Makefile > b/tools/testing/selftests/vm/Makefile > index 04a49e876a46..5b1ecd00695b 100644 > --- a/tools/testing/selftests/vm/Makefile > +++ b/tools/testing/selftests/vm/Makefile > @@ -57,9 +57,9 @@ CAN_BUILD_I386 := $(shell ./../x86/check_cc.sh "$(CC)" > ../x86/trivial_32bit_prog > CAN_BUILD_X86_64 := $(shell ./../x86/check_cc.sh "$(CC)" > ../x86/trivial_64bit_program.c) > CAN_BUILD_WITH_NOPIE := $(shell ./../x86/check_cc.sh "$(CC)" > ../x86/trivial_program.c -no-pie) > > -TARGETS := protection_keys > -BINARIES_32 := $(TARGETS:%=%_32) > -BINARIES_64 := $(TARGETS:%=%_64) > +VMTARGETS := protection_keys > +BINARIES_32 := $(VMTARGETS:%=%_32) > +BINARIES_64 := $(VMTARGETS:%=%_64) > > ifeq ($(CAN_BUILD_WITH_NOPIE),1) > CFLAGS += -no-pie > @@ -112,7 +112,7 @@ $(BINARIES_32): CFLAGS += -m32 -mxsave > $(BINARIES_32): LDLIBS += -lrt -ldl -lm > $(BINARIES_32): $(OUTPUT)/%_32: %.c > $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(notdir $^) $(LDLIBS) -o $@ > -$(foreach t,$(TARGETS),$(eval $(call gen-target-rule-32,$(t)))) > +$(foreach t,$(VMTARGETS),$(eval $(call gen-target-rule-32,$(t)))) > endif > > ifeq ($(CAN_BUILD_X86_64),1) > @@ -120,7 +120,7 @@ $(BINARIES_64): CFLAGS += -m64 -mxsave > $(BINARIES_64): LDLIBS += -lrt -ldl > $(BINARIES_64): $(OUTPUT)/%_64: %.c > $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(notdir $^) $(LDLIBS) -o $@ > -$(foreach t,$(TARGETS),$(eval $(call gen-target-rule-64,$(t)))) > +$(foreach t,$(VMTARGETS),$(eval $(call gen-target-rule-64,$(t)))) > endif > > # x86_64 users should be encouraged to install 32-bit libraries > -- > 2.27.0 > > --000000000000be641205de367f53 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Wed, May 4, 2022 at 5:35 PM Joel Savitz <jsavitz@redhat.com> wrote:
= The tools/testing/selftests/vm/Makefile uses the variable TARGETS
internally to generate a list of platform-specific binary build targets
suffixed with _{32,64}. When building the selftests using its own
Makefile directly, such as via the following command run in a kernel
tree:

Oops, forgot to put the actual command in here, sendi= ng follow up.
=C2=A0
One receives an error such as the following:

make: Entering directory '/root/linux/tools/testing/selftests'
make --no-builtin-rules ARCH=3Dx86 -C ../../.. headers_install
make[1]: Entering directory '/root/linux'
=C2=A0 INSTALL ./usr/include
make[1]: Leaving directory '/root/linux'
make[1]: Entering directory '/root/linux/tools/testing/selftests/vm'= ;
make[1]: *** No rule to make target 'vm.c', needed by '/root/li= nux/tools/testing/selftests/vm/vm_64'.=C2=A0 Stop.
make[1]: Leaving directory '/root/linux/tools/testing/selftests/vm'=
make: *** [Makefile:175: all] Error 2
make: Leaving directory '/root/linux/tools/testing/selftests'

The TARGETS variable passed to tools/testing/selftests/Makefile collides with the TARGETS used in tools/testing/selftests/vm/Makefile, so rename
the latter to VMTARGETS, eliminating the collision with no functional
change.

Fixes: f21fda8f6453 ("selftests: vm: pkeys: fix multilib builds for x86")

Signed-off-by: Joel Savitz <jsavitz@redhat.com>
---
=C2=A0tools/testing/selftests/vm/Makefile | 10 +++++-----
=C2=A01 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/= vm/Makefile
index 04a49e876a46..5b1ecd00695b 100644
--- a/tools/testing/selftests/vm/Makefile
+++ b/tools/testing/selftests/vm/Makefile
@@ -57,9 +57,9 @@ CAN_BUILD_I386 :=3D $(shell ./../x86/check_cc.sh "$(= CC)" ../x86/trivial_32bit_prog
=C2=A0CAN_BUILD_X86_64 :=3D $(shell ./../x86/check_cc.sh "$(CC)" = ../x86/trivial_64bit_program.c)
=C2=A0CAN_BUILD_WITH_NOPIE :=3D $(shell ./../x86/check_cc.sh "$(CC)&qu= ot; ../x86/trivial_program.c -no-pie)

-TARGETS :=3D protection_keys
-BINARIES_32 :=3D $(TARGETS:%=3D%_32)
-BINARIES_64 :=3D $(TARGETS:%=3D%_64)
+VMTARGETS :=3D protection_keys
+BINARIES_32 :=3D $(VMTARGETS:%=3D%_32)
+BINARIES_64 :=3D $(VMTARGETS:%=3D%_64)

=C2=A0ifeq ($(CAN_BUILD_WITH_NOPIE),1)
=C2=A0CFLAGS +=3D -no-pie
@@ -112,7 +112,7 @@ $(BINARIES_32): CFLAGS +=3D -m32 -mxsave
=C2=A0$(BINARIES_32): LDLIBS +=3D -lrt -ldl -lm
=C2=A0$(BINARIES_32): $(OUTPUT)/%_32: %.c
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(notdir $^) $(= LDLIBS) -o $@
-$(foreach t,$(TARGETS),$(eval $(call gen-target-rule-32,$(t))))
+$(foreach t,$(VMTARGETS),$(eval $(call gen-target-rule-32,$(t))))
=C2=A0endif

=C2=A0ifeq ($(CAN_BUILD_X86_64),1)
@@ -120,7 +120,7 @@ $(BINARIES_64): CFLAGS +=3D -m64 -mxsave
=C2=A0$(BINARIES_64): LDLIBS +=3D -lrt -ldl
=C2=A0$(BINARIES_64): $(OUTPUT)/%_64: %.c
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(notdir $^) $(= LDLIBS) -o $@
-$(foreach t,$(TARGETS),$(eval $(call gen-target-rule-64,$(t))))
+$(foreach t,$(VMTARGETS),$(eval $(call gen-target-rule-64,$(t))))
=C2=A0endif

=C2=A0# x86_64 users should be encouraged to install 32-bit libraries
--
2.27.0

--000000000000be641205de367f53--