All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wen Congyang <wency@cn.fujitsu.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Euan Harris <euan.harris@citrix.com>,
	Olaf Hering <olaf@aepfle.de>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	xen-devel@lists.xen.org
Subject: Re: [PATCH v2] Fix building error
Date: Tue, 20 Jan 2015 18:39:22 +0800	[thread overview]
Message-ID: <54BE305A.5010805@cn.fujitsu.com> (raw)
In-Reply-To: <1421749121.10440.199.camel@citrix.com>

On 01/20/2015 06:18 PM, Ian Campbell wrote:
> On Tue, 2015-01-20 at 10:21 +0800, Wen Congyang wrote:
>> On 01/19/2015 11:23 PM, Ian Campbell wrote:
>>> On Thu, 2015-01-15 at 11:26 +0000, Ian Jackson wrote:
>>>> Wen Congyang writes ("[PATCH v2] Fix building error"):
>>>>>  ifeq ($(debug),y)
>>>>>  # Disable optimizations and enable debugging information for macros
>>>>>  CFLAGS += -O0 -g3
>>>>> +# _FORTIFY_SOURCE requires compiling with optimization
>>>>> +CFLAGS += -Wp,-U_FORTIFY_SOURCE
>>>>
>>>> I'm not entirely convinced about this.  I have two kinds of concern:
>>>>
>>>> One is practical, which is that ATM AIUI a debug build, while not
>>>> intended for production use, is not any less secure.  (Leaving aside
>>>> the ability of guests to perform a DoS with copious debugging output.)
>>>>
>>>> The other is that we seem to be entering into a battle of escalation
>>>> between various Makefiles.  Specifically, this seems to be a
>>>> workaround for a bug in some other Makefiles we are using: the bug
>>>> being that these other Makefiles can't cope with -O0.  And
>>>> unconditionally squashing the other Makefiles' options seems like a
>>>> big hammer.
>>>>
>>>> The fact that Fortify doesn't support -O0 is a property of Fortify
>>>> which ought to be encoded in Fortify (or the places where it is
>>>> enabled).
>>>>
>>>> Assuming that the underlying bug is intractible
>>>
>>> I think so, see <54B73623.9040503@cn.fujitsu.com>. I suppose one could
>>> enter into a dialogue with Fedora about the practice of enabling these
>>> flags for all Python modules built on a Fedora system vs. just those
>>> built via RPM etc.
>>>
>>>>  I think the right
>>>> answer is for an affected developer
>>>
>>> Which will be all developers using Fedora AFAICT.
>>>
>>>>  to do one of the following, as a
>>>> workaround: either, manually override Fortify when requesting a debug
>>>> build (by setting EXTRA_CFLAGS_XEN_TOOLS), or manually override the
>>>> -O0 setting.
>>>>
>>>> To make this easier to do without editing tools/Rules.mk I would
>>>> support a patch to Rules.mk which has it honour a variable containing
>>>> a debug-specific set of CFLAGS.
>>
>> I don't understand your suggestion.
> 
> He means for the build system to honour a new
> EXTRA_FLAGS_XEN_TOOLS_DEBUG (or similar) iff debug=y.
> 
>>> This seems reasonable enough to me.
>>>
>>> The original patch in <54B73658.6030309@cn.fujitsu.com> (correctly IMHO)
>>> applied the workaround only to the Python parts of the build
>>> (tools/{python,pygrub}) whereas this v2 and your suggestion would affect
>>> all of tools/*. That seems like a reasonable compromise under the
>>> circumstances (the alternative being special overrides for Python or
>>> something, no nice).
>>
>> Building problems only affect developers, so I think we should fix this problem.
>>
>> If the developers add extra flags to define the macro _FORTIFY_SOURCE, it also
>> breaks building.
> 
> So can adding all manner of random macros to the build. If a developer
> adds such flags then they should be prepared to deal with the
> consequences, including dealing with any breakage which results.

Agree with it.

> 
> The only reason we aren't taking this hard line with the situation you
> find yourself in is that a major distro has seen fit to define these
> extra macros into the default Python build system on that distro, hence
> we are trying to find a reasonable compromise for users/developers of
> that distro without making things worse for users/developers of other
> distros which don't do this.
> 
>>  We can disable debug for such case, or undefine the macro
>> in Rules.mk. If the macro _FORTIFY_SOURCE is not defined, undefining it is harmless.
> 
> On the other hand a user who has a fixed version of fortify which is
> compatible with -O0 then cannot enable it if we do this.

Yes. We can detect it in the configure. And only undefine it when fortify cannot work with -O0

Thanks
Wen Congyang

> 
> Ian.
> 
> .
> 

  reply	other threads:[~2015-01-20 10:39 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-01 10:39 [PATCH] libxl/Makefile: Don't optimize debug builds; add macro debugging information Euan Harris
2014-12-01 11:43 ` Ian Campbell
2014-12-01 11:55   ` Euan Harris
2014-12-01 12:12     ` Ian Campbell
2014-12-01 14:21       ` [PATCH v2] tools/Rules.mk: " Euan Harris
2015-01-08 17:16         ` Ian Campbell
2015-01-12 16:42           ` Ian Campbell
2015-01-13  5:52         ` Wen Congyang
2015-01-13 10:11           ` Ian Campbell
2015-01-13 10:38             ` Wen Congyang
2015-01-13 11:17             ` Wen Congyang
2015-01-13 11:30               ` Ian Campbell
2015-01-15  3:38                 ` Wen Congyang
2015-01-15  3:39         ` [PATCH] Fix building error Wen Congyang
2015-01-15  7:57           ` Olaf Hering
2015-01-15  9:04             ` Wen Congyang
2015-01-15  9:21               ` Olaf Hering
2015-01-15  9:28                 ` Wen Congyang
2015-01-15  9:33                   ` [PATCH v2] " Wen Congyang
2015-01-15 11:26                     ` Ian Jackson
2015-01-19 15:23                       ` Ian Campbell
2015-01-20  2:21                         ` Wen Congyang
2015-01-20 10:18                           ` Ian Campbell
2015-01-20 10:39                             ` Wen Congyang [this message]
2015-01-20 12:47                         ` Olaf Hering
2015-01-23 11:34                         ` Julien Grall
2015-02-04 15:37                       ` Jan Beulich
2015-02-04 15:43                         ` Ian Jackson
2015-02-04 16:02                           ` Jan Beulich
2015-02-04 16:10                             ` Ian Jackson
2015-02-04 16:42                         ` Olaf Hering

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54BE305A.5010805@cn.fujitsu.com \
    --to=wency@cn.fujitsu.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=euan.harris@citrix.com \
    --cc=olaf@aepfle.de \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.