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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C1018C4829E for ; Thu, 15 Feb 2024 19:15:19 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=KcGlo1nP; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4TbPsL2B87z3vcx for ; Fri, 16 Feb 2024 06:15:18 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=KcGlo1nP; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.dev (client-ip=91.218.175.181; helo=out-181.mta0.migadu.com; envelope-from=andrew.jones@linux.dev; receiver=lists.ozlabs.org) Received: from out-181.mta0.migadu.com (out-181.mta0.migadu.com [91.218.175.181]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4TbPqq1XTDz3dlY for ; Fri, 16 Feb 2024 06:13:56 +1100 (AEDT) Date: Thu, 15 Feb 2024 20:13:30 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1708024415; 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=+sM3XuJbo/imwLbmrYIvBwXd4yxReBWwfCSoEs0rupM=; b=KcGlo1nPfVAJTNCWIozLp9o1WacJwy2+q4qL5TI39E572kA1yum8gibQzOeDIt4S3m0L9K AO16faP/P32D3nwchObpTbH95lbSluFZjkM2ognP472qS0mPc7gwiKBVMSnHUmTSpYm+GK D4NiqzXqoZAJv1AF4Z0mYzOs94ox/lo= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Andrew Jones To: Alexandru Elisei Subject: Re: [kvm-unit-tests PATCH v1 01/18] Makefile: Define __ASSEMBLY__ for assembly files Message-ID: <20240215-8527d5fd0c830d5d8d07f668@orel> References: <20231130090722.2897974-1-shahuang@redhat.com> <20231130090722.2897974-2-shahuang@redhat.com> <20240115-0c41f7d4aa09b7b82613faa8@orel> <20240215-f2a2e3798b1f64923417df00@orel> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Thomas Huth , Nico Boehr , kvm@vger.kernel.org, Shaoqin Huang , Nikos Nikoleris , Eric Auger , Nadav Amit , kvmarm@lists.linux.dev, linuxppc-dev@lists.ozlabs.org, David Woodhouse Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Thu, Feb 15, 2024 at 05:16:01PM +0000, Alexandru Elisei wrote: > Hi Drew, > > On Thu, Feb 15, 2024 at 05:32:22PM +0100, Andrew Jones wrote: > > On Thu, Feb 15, 2024 at 04:05:56PM +0000, Alexandru Elisei wrote: > > > Hi Drew, > > > > > > On Mon, Jan 15, 2024 at 01:44:17PM +0100, Andrew Jones wrote: > > > > On Thu, Nov 30, 2023 at 04:07:03AM -0500, Shaoqin Huang wrote: > > > > > From: Alexandru Elisei > > > > > > > > > > There are 25 header files today (found with grep -r "#ifndef __ASSEMBLY__) > > > > > with functionality relies on the __ASSEMBLY__ prepocessor constant being > > > > > correctly defined to work correctly. So far, kvm-unit-tests has relied on > > > > > the assembly files to define the constant before including any header > > > > > files which depend on it. > > > > > > > > > > Let's make sure that nobody gets this wrong and define it as a compiler > > > > > constant when compiling assembly files. __ASSEMBLY__ is now defined for all > > > > > .S files, even those that didn't set it explicitely before. > > > > > > > > > > Reviewed-by: Nikos Nikoleris > > > > > Reviewed-by: Andrew Jones > > > > > Signed-off-by: Alexandru Elisei > > > > > Signed-off-by: Shaoqin Huang > > > > > --- > > > > > Makefile | 5 ++++- > > > > > arm/cstart.S | 1 - > > > > > arm/cstart64.S | 1 - > > > > > powerpc/cstart64.S | 1 - > > > > > 4 files changed, 4 insertions(+), 4 deletions(-) > > > > > > > > > > diff --git a/Makefile b/Makefile > > > > > index 602910dd..27ed14e6 100644 > > > > > --- a/Makefile > > > > > +++ b/Makefile > > > > > @@ -92,6 +92,9 @@ CFLAGS += -Woverride-init -Wmissing-prototypes -Wstrict-prototypes > > > > > > > > > > autodepend-flags = -MMD -MP -MF $(dir $*).$(notdir $*).d > > > > > > > > > > +AFLAGS = $(CFLAGS) > > > > > +AFLAGS += -D__ASSEMBLY__ > > > > > + > > > > > LDFLAGS += -nostdlib $(no_pie) -z noexecstack > > > > > > > > > > $(libcflat): $(cflatobjs) > > > > > @@ -113,7 +116,7 @@ directories: > > > > > @mkdir -p $(OBJDIRS) > > > > > > > > > > %.o: %.S > > > > > - $(CC) $(CFLAGS) -c -nostdlib -o $@ $< > > > > > + $(CC) $(AFLAGS) -c -nostdlib -o $@ $< > > > > > > > > I think we can drop the two hunks above from this patch and just rely on > > > > the compiler to add __ASSEMBLY__ for us when compiling assembly files. > > > > > > I think the precompiler adds __ASSEMBLER__, not __ASSEMBLY__ [1]. Am I > > > missing something? > > > > > > [1] https://gcc.gnu.org/onlinedocs/cpp/macros/predefined-macros.html#c.__ASSEMBLER__ > > > > You're right. I'm not opposed to changing all the __ASSEMBLY__ references > > to __ASSEMBLER__. I'll try to do that at some point unless you beat me to > > it. > > Actually, I quite prefer the Linux style of using __ASSEMBLY__ instead of > __ASSEMBLER__, because it makes reusing Linux files easier. That, and the > habit formed by staring at Linux assembly files. Those are good arguments and also saves the churn. OK, let's keep this patch and __ASSEMBLY__ Thanks, drew