From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH] tools: work around collision of -O0 and -D_FORTIFY_SOURCE Date: Thu, 5 Feb 2015 12:25:48 +0000 Message-ID: <1423139148.24924.100.camel@citrix.com> References: <54D25E95020000780005CFD8@mail.emea.novell.com> <21715.20257.88376.581397@mariner.uk.xensource.com> <54D35F85020000780005D36C@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YJLVV-0006Fi-NV for xen-devel@lists.xenproject.org; Thu, 05 Feb 2015 12:26:05 +0000 In-Reply-To: <54D35F85020000780005D36C@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Euan Harris , xen-devel , Ian Jackson , Wei Liu , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Thu, 2015-02-05 at 11:18 +0000, Jan Beulich wrote: > >>> On 05.02.15 at 12:08, wrote: > > Jan Beulich writes ("[PATCH] tools: work around collision of -O0 and > > -D_FORTIFY_SOURCE"): > >> The former gets enforced by our debug builds, the latter appears to be > >> not uncommon for certain distros' Python packages. Newer glibc warns on > >> uses of _FORTIFY_SOURCE without optimization being enabled, which with > >> -Werror causes the build to fail. > > ... > >> --- a/tools/pygrub/Makefile > >> +++ b/tools/pygrub/Makefile > >> @@ -2,15 +2,24 @@ > >> XEN_ROOT = $(CURDIR)/../.. > >> include $(XEN_ROOT)/tools/Rules.mk > >> > >> +py_cflags := $(shell $(PYTHON)-config --cflags) > >> +PY_CFLAGS = $(if $(strip $(py_cflags)),,\ > >> + $(error '$(PYTHON)-config --cflags' produced no output))\ > >> + $(if $(filter -D_FORTIFY_SOURCE=%,\ > >> + $(filter-out -D_FORTIFY_SOURCE=0,\ > >> + $(py_cflags))),\ > >> + $(patsubst -O0,-O1,$(CFLAGS)),\ > >> + $(CFLAGS)) $(APPEND_LDFLAGS) > > > > There are lots of copies of this. And it would IMO be better to do at > > least the probing in configure, resulting in something like this in > > configure: > > > > [ determine PY_XCFLAGS to be either '' or '-O0' ] > > AC_SUBST(PY_XCFLAGS) > > > > and > > > > PY_CFLAGS=@PY_CFLAGS@ > > > > CC="$(CC)" CFLAGS="$(CFLAGS) $(PY_XCFLAGS)" $(PYTHON) setup.py build > > > > (I assume that CFLAGS does override what comes out of setup.py.) > > For one, PY_XCFLAGS='' wouldn't help, as we get -O0 from the > incoming CFLAGS. And then I'm not really intending to fiddle with > the configure scripts (albeit, having done the patch in the presented > form, I expected you to want it done that way) - this and alike is > what I specifically want to stay out of if at all possible. Since in any > event commit 1166ecf781 introduced a regression for multiple > people, perhaps if that is not supposed to be reverted Euan should > look into addressing that regression? Euan -- do you think you might be able to whip up an autoconf-ification along the lines of what is described above? Ian.