From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56158) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yq0RJ-0002Mr-UZ for qemu-devel@nongnu.org; Wed, 06 May 2015 10:36:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yq0RE-0005jt-0g for qemu-devel@nongnu.org; Wed, 06 May 2015 10:36:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49387) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yq0RD-0005jo-Re for qemu-devel@nongnu.org; Wed, 06 May 2015 10:36:39 -0400 Message-ID: <554A26EE.7050108@redhat.com> Date: Wed, 06 May 2015 16:36:30 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1430920000-31229-1-git-send-email-famz@redhat.com> <554A2012.2080109@redhat.com> <20150506142315.GA1535@ad.nay.redhat.com> In-Reply-To: <20150506142315.GA1535@ad.nay.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] rules.mak: Force CFLAGS for all objects in DSO List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: Peter Maydell , agraf@suse.de, Michael Tokarev , qemu-devel@nongnu.org, Stefan Weil On 06/05/2015 16:23, Fam Zheng wrote: >>> > > + $(eval $($v:%.mo=3D%$(DSOSUF)) $($v) $(foreach o,$(= $v),$($o-objs)) .PHONY: CFLAGS +=3D -fPIC -DBUILD_DSO) > ^ ^ ^ = ^ > | | | = | > | | | = `- In case all others are empty. > | | | > | | `- Exp= ansion of all %.mo-objs so it's a %.o list. > | | For= $v=3Dblock-obj-m, this will contain curl.o, iscsi.o, ... > | | > | `- %.mo list > | For $v=3Dblock-obj-m= , this will contain curl.mo, iscsi.mo, ... > | > `- %.so list > For $v=3Dblock-obj-m, this will cont= ain curl.so, iscsi.so, . Great. :) You should have used Unicode drawing characters to be consistent with rules.mak! But hopefully the ASCII art is not needed at all. Do we need all of thos= e? - foo.mo is a prerequisite of foo.so. You cannot use foo.so (this is the bug you are fixing) but foo.so doesn't use CFLAGS in its rule, and you should be able to remove it. - can you use foo.mo without hitting the original bug? If so, could you simply use: -%$(DSOSUF): CFLAGS +=3D -fPIC -DBUILD_DSO +%.mo: CFLAGS +=3D -fPIC -DBUILD_DSO (and if so move the rule down, above "%.mo:")? If you cannot use foo.mo, foo.mo also doesn't use CFLAGS in its rules, and you should be able to remove foo.mo too. - so the other possibility is to just use $(foreach o,$($v),$($o-objs)). In this case there's already a convenient $(foreach) just above, and you can just add another $(eval) inside it. - and if that is true, you do not need .PHONY either because you have $(foreach ... $(eval)) instead of $(eval $(foreach)). Maybe I'm wrong, in which case the patch is ok. :) Paolo