Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3903758ybl; Mon, 26 Aug 2019 02:20:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqzdqg1hHZ2B0xTZDDyQT47LQQyOhzItran48cRKa6u7QP5RvW1km4t3CUmdLrpZS9LGsVn9 X-Received: by 2002:a17:902:f204:: with SMTP id gn4mr8785449plb.23.1566811230044; Mon, 26 Aug 2019 02:20:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566811230; cv=none; d=google.com; s=arc-20160816; b=oO8CTz05bWaM7vUxmJ3isfTjCYtN4GHzqNbcnHKfgGxauSmHQsfnJZSdDtKgfM1YOZ jy9jo8zJRD5z8cJWfyNN2F6eaVBSNlXX/YxW6d2hHQMlTV3h71/TIWCd8amOWHlq/a+m BfWYb12A+mafNkJLC5nxD92QurhICZmOwViaQeGpWf8DcfleS5+IIMIPuoRob5RsWwm3 DHmPlKa2kHWxR8Oet9QKNcy1Ovw0Slgaq+8duUmZqZqA/YPYqxkM99eSBeFktaKVIieh 8ZySJkU8Gowv7QcvhFzPTU90FGk+cALCfK7yyJkldTzF8ELyJRE9th7Xjj1OofLfLenn m2Kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:organization:user-agent :references:in-reply-to:subject:cc:to:from:message-id:date; bh=1GgbTeu/O44urixlZpaMCMaT1hhBo5zC8TkEfyGf4Oo=; b=raoScjIJSk5WXgeylPU+6PVqsRJBMU7+2+JrZ2faIYulwR3QFO3oTVBwmO/9I1aC68 D4Oi+H5cDKqRHF1gS1fW6Tmb/yVbIArbeifTdaBgMUBXDd7Fv2fp/LT+X8Pvu5W5I2EV Kl0nI+4GAxeIn8LwVDoGTzjfOj4jW0mMCexjzQSicZWknzmEZxVfDiw8bkLeRMlDxnGL +un0IRUnwwSKvOSN7gTCDB2brsSX0yybdRkkO9YCYJCX/E5/1qZhQw6brX7Hb7j0mSOC 0uUezUbO/LPK6bgrvFvW6bcDXBbnr4O0q+C43hYjfFQG+3PdHcUX6ZpdfdAG5RNBjE1p GH/Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v14si9053451pjb.82.2019.08.26.02.20.14; Mon, 26 Aug 2019 02:20:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730806AbfHZJSN (ORCPT + 99 others); Mon, 26 Aug 2019 05:18:13 -0400 Received: from foss.arm.com ([217.140.110.172]:55088 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726354AbfHZJSN (ORCPT ); Mon, 26 Aug 2019 05:18:13 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6DC111570; Mon, 26 Aug 2019 02:18:12 -0700 (PDT) Received: from big-swifty.misterjones.org (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E865A3F59C; Mon, 26 Aug 2019 02:17:27 -0700 (PDT) Date: Mon, 26 Aug 2019 10:17:22 +0100 Message-ID: <86sgpomgkd.wl-maz@kernel.org> From: Marc Zyngier To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, Andy Lutomirski , Borislav Petkov , "H. Peter Anvin" , Ingo Molnar , James Morse , Julien Thierry , Michal Marek , Russell King , Suzuki K Poulose , Thomas Gleixner , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH 1/2] kbuild: change *FLAGS_.o to take the path relative to $(obj) In-Reply-To: <20190825172833.5708-1-yamada.masahiro@socionext.com> References: <20190825172833.5708-1-yamada.masahiro@socionext.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 EasyPG/1.0.0 Emacs/26 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Organization: Approximate MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 25 Aug 2019 18:28:32 +0100, Masahiro Yamada wrote: > > Kbuild provides per-file compiler flag addition/removal: > > CFLAGS_.o > CFLAGS_REMOVE_.o > AFLAGS_.o > AFLAGS_REMOVE_.o > CPPFLAGS_ > HOSTCFLAGS_.o > HOSTCXXFLAGS_.o > > The is the filename of the target without its suffix. > > This syntax comes into a trouble when two files with the same name > appear in one Makefile, for example: > > obj-y += foo.o > obj-y += dir/foo.o > CFLAGS_foo.o := > > Here, the applies to both foo.o and dir/foo.o > > The real world problem is: > > scripts/kconfig/util.c > scripts/kconfig/lxdialog/util.c > > Both files are compiled into scripts/kconfig/mconf, but only the > latter should be given with additional flags for ncurses. > > It is more sensible to use the relative path to the Makefile, like this: > > obj-y += foo.o > CFLAGS_foo.o := > obj-y += dir/foo.o > CFLAGS_dir/foo.o := > > The $* variable is replaced with the stem ('%') part in a pattern rule. > In other words, this only works for pattern rules. > > Signed-off-by: Masahiro Yamada > --- > > arch/arm/kvm/Makefile | 5 +++-- > arch/x86/entry/vdso/Makefile | 3 ++- > scripts/Makefile.host | 30 +++++++++++++++--------------- > scripts/Makefile.lib | 10 +++++----- > scripts/kconfig/Makefile | 8 ++++---- > 5 files changed, 29 insertions(+), 27 deletions(-) For the KVM/arm part: Acked-by: Marc Zyngier Thanks, M. -- Jazz is not dead, it just smells funny.