From: "Jan Beulich" Subject: Re: [PATCH] tools: work around collision of -O0 and -D_FORTIFY_SOURCE Date: Thu, 05 Feb 2015 10:17:15 +0000 Message-ID: <54D3513B020000780005D299@mail.emea.novell.com> References: <54D25E95020000780005CFD8@mail.emea.novell.com> <54D2AC2F.70103@terremark.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YJJUq-0002Kv-HK for xen-devel@lists.xenproject.org; Thu, 05 Feb 2015 10:17:16 +0000 In-Reply-To: <54D2AC2F.70103@terremark.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Don Slutz Cc: Ian Campbell , Ian Jackson , Wei Liu , xen-devel , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org >>> On 05.02.15 at 00:33, wrote: > On 02/04/15 12:01, Jan Beulich wrote: >> 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. >> >> Determine Python's intended flags to be passed to the C compiler via >> "python-config --cflags", and replace -O0 by -O1 when a non-zero value >> gets set for _FORTIFY_SOURCE. >> >> Signed-off-by: Jan Beulich > > Well, this does not fix debug=y builds for me: > [...] > gcc -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions Where is this -Wp,-D_FORTIFY_SOURCE=2 coming from? Is python-config producing this? The patch provided certainly doesn't deal with that case. > Using this change: > > dcs-xen-54:~/xen-master>git show | cat > commit 3cda306a162e55d73c25efc14840e7afeec8d3d3 > Author: Don Slutz > Date: Wed Feb 4 17:57:00 2015 -0500 > > tools/Rules.mk: Drop -O0 for debug=y > > This is a partial revert of > > commit 1166ecf781b1016eaa61f8d5ba4fb1fde9d599b6 > Author: Euan Harris > Date: Mon Dec 1 14:21:05 2014 +0000 > > tools/Rules.mk: Don't optimize debug builds; add macro debugging > information > > Signed-off-by: Don Slutz > > diff --git a/tools/Rules.mk b/tools/Rules.mk > index 74cf37e..8bf603d 100644 > --- a/tools/Rules.mk > +++ b/tools/Rules.mk > @@ -56,7 +56,7 @@ SHLIB_libxenvchan = -Wl,-rpath-link=$(XEN_LIBVCHAN) > > ifeq ($(debug),y) > # Disable optimizations and enable debugging information for macros > -CFLAGS += -O0 -g3 > +CFLAGS += -g3 > endif > > LIBXL_BLKTAP ?= $(CONFIG_BLKTAP2) > > > I can now build with "debug=y" on Fedora 17. If you went through the earlier discussion, you'd have seen that this was already rejected as a possible fix. Jan