From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32905) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yrybh-0007gn-UX for qemu-devel@nongnu.org; Mon, 11 May 2015 21:03:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yrybe-0007cX-Kx for qemu-devel@nongnu.org; Mon, 11 May 2015 21:03:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53184) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yrybe-0007cJ-Df for qemu-devel@nongnu.org; Mon, 11 May 2015 21:03:34 -0400 Date: Tue, 12 May 2015 09:03:29 +0800 From: Fam Zheng Message-ID: <20150512010329.GA1127@dhcp-14-122.nay.redhat.com> References: <1430981715-31465-1-git-send-email-famz@redhat.com> <55512C38.3010207@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <55512C38.3010207@suse.de> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2] rules.mak: Force CFLAGS for all objects in DSO List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?iso-8859-1?Q?F=E4rber?= Cc: qemu-devel@nongnu.org On Tue, 05/12 00:24, Andreas F=E4rber wrote: > Am 07.05.2015 um 08:55 schrieb Fam Zheng: > > Because of the trick of process-archive-undefs, all .mo objects, even > > with --enable-modules, are dependencies of executables. > >=20 > > This breaks CFLAGS propogation because the compiling of module object > > will happen too early before building for DSO. > >=20 > > With GCC 5, the linking would fail because .o doesn't have -fPIC. Als= o, > > BUILD_DSO will be missed. (module-common.o will have it, so the stamp > > symbol was still liked in .so). >=20 > Did you mean "linked"? Yes but it's too late, the commit is already applied to qemu.git :( Fam >=20 > Cheers, > Andreas >=20 > >=20 > > Fix the problem by forcing the CFLAGS on individual .o-cflags during > > unnest-vars. > >=20 > > Reported-by: Alexander Graf > > Signed-off-by: Fam Zheng > >=20 > > --- > >=20 > > v2: Simplify as Paolo suggested, while keeping the CFLAGS of > > module-common.o > > --- > > rules.mak | 4 +++- > > 1 file changed, 3 insertions(+), 1 deletion(-) > >=20 > > diff --git a/rules.mak b/rules.mak > > index 3a05627..aec27f8 100644 > > --- a/rules.mak > > +++ b/rules.mak > > @@ -102,7 +102,8 @@ endif > > %.o: %.dtrace > > $(call quiet-command,dtrace -o $@ -G -s $<, " GEN $(TARGET_DIR)$= @") > > =20 > > -%$(DSOSUF): CFLAGS +=3D -fPIC -DBUILD_DSO > > +DSO_OBJ_CFLAGS :=3D -fPIC -DBUILD_DSO > > +module-common.o: CFLAGS +=3D $(DSO_OBJ_CFLAGS) > > %$(DSOSUF): LDFLAGS +=3D $(LDFLAGS_SHARED) > > %$(DSOSUF): %.mo > > $(call LINK,$^) > > @@ -351,6 +352,7 @@ define unnest-vars > > # For non-module build, add -m to -y > > $(if $(CONFIG_MODULES), > > $(foreach o,$($v), > > + $(eval $($o-objs): CFLAGS +=3D $(DSO_OBJ_CFLAGS)) > > $(eval $o: $($o-objs))) > > $(eval $(patsubst %-m,%-y,$v) +=3D $($v)) > > $(eval modules: $($v:%.mo=3D%$(DSOSUF))), > >=20 >=20 >=20 > --=20 > SUSE Linux GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany > GF: Felix Imend=F6rffer, Jane Smithard, Dilip Upmanyu, Graham Norton; H= RB > 21284 (AG N=FCrnberg) >=20