diff mbox series

[DOCUMENTATION] Document ASLR for Precompiled Headers.

Message ID f8a2430c-f068-2290-6b95-dc369a9ac385@suse.cz
State New
Headers show
Series [DOCUMENTATION] Document ASLR for Precompiled Headers. | expand

Commit Message

Martin Liška Feb. 4, 2020, 1:45 p.m. UTC
Hi.

The patch is about enhancement of the documentation, where
we do not support ASLR for Precompiled Headers.

Ready for trunk?
Thanks,
Martin

gcc/ChangeLog:

2020-02-04  Martin Liska  <mliska@suse.cz>

	PR c++/92717
	* doc/invoke.texi: Document that one should
	not combine ASLR and -fpch.
---
  gcc/doc/invoke.texi | 2 ++
  1 file changed, 2 insertions(+)

Comments

Richard Biener Feb. 4, 2020, 1:55 p.m. UTC | #1
On Tue, Feb 4, 2020 at 2:45 PM Martin Liška <mliska@suse.cz> wrote:
>
> Hi.
>
> The patch is about enhancement of the documentation, where
> we do not support ASLR for Precompiled Headers.
>
> Ready for trunk?

I think we support ASLR just fine?

> Thanks,
> Martin
>
> gcc/ChangeLog:
>
> 2020-02-04  Martin Liska  <mliska@suse.cz>
>
>         PR c++/92717
>         * doc/invoke.texi: Document that one should
>         not combine ASLR and -fpch.
> ---
>   gcc/doc/invoke.texi | 2 ++
>   1 file changed, 2 insertions(+)
>
>
Martin Liška Feb. 4, 2020, 1:56 p.m. UTC | #2
On 2/4/20 2:55 PM, Richard Biener wrote:
> On Tue, Feb 4, 2020 at 2:45 PM Martin Liška <mliska@suse.cz> wrote:
>>
>> Hi.
>>
>> The patch is about enhancement of the documentation, where
>> we do not support ASLR for Precompiled Headers.
>>
>> Ready for trunk?
> 
> I think we support ASLR just fine?

There's issue where somebody confirms the opposite:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92717#c8
Martin

> 
>> Thanks,
>> Martin
>>
>> gcc/ChangeLog:
>>
>> 2020-02-04  Martin Liska  <mliska@suse.cz>
>>
>>          PR c++/92717
>>          * doc/invoke.texi: Document that one should
>>          not combine ASLR and -fpch.
>> ---
>>    gcc/doc/invoke.texi | 2 ++
>>    1 file changed, 2 insertions(+)
>>
>>
Jakub Jelinek Feb. 4, 2020, 1:59 p.m. UTC | #3
On Tue, Feb 04, 2020 at 02:55:31PM +0100, Richard Biener wrote:
> On Tue, Feb 4, 2020 at 2:45 PM Martin Liška <mliska@suse.cz> wrote:
> >
> > Hi.
> >
> > The patch is about enhancement of the documentation, where
> > we do not support ASLR for Precompiled Headers.
> >
> > Ready for trunk?
> 
> I think we support ASLR just fine?

We do support ASLR just fine, just the PCH from it will not be bitwise
reproduceable.  So the doc patch is misplaced (putting it between sentence
talking about options and the list of those options is weird) and should make
it clear that ASLR may result in non-reproduceable PCH files.

> > gcc/ChangeLog:
> >
> > 2020-02-04  Martin Liska  <mliska@suse.cz>
> >
> >         PR c++/92717
> >         * doc/invoke.texi: Document that one should
> >         not combine ASLR and -fpch.
> > ---
> >   gcc/doc/invoke.texi | 2 ++
> >   1 file changed, 2 insertions(+)
> >
> >

	Jakub
Martin Liška Feb. 4, 2020, 3:09 p.m. UTC | #4
On 2/4/20 2:59 PM, Jakub Jelinek wrote:
> On Tue, Feb 04, 2020 at 02:55:31PM +0100, Richard Biener wrote:
>> On Tue, Feb 4, 2020 at 2:45 PM Martin Liška <mliska@suse.cz> wrote:
>>>
>>> Hi.
>>>
>>> The patch is about enhancement of the documentation, where
>>> we do not support ASLR for Precompiled Headers.
>>>
>>> Ready for trunk?
>>
>> I think we support ASLR just fine?
> 
> We do support ASLR just fine, just the PCH from it will not be bitwise
> reproduceable.  So the doc patch is misplaced (putting it between sentence
> talking about options and the list of those options is weird) and should make
> it clear that ASLR may result in non-reproduceable PCH files.

You are right. I fixed the placing of the hunk and relaxed the wording.

Martin

> 
>>> gcc/ChangeLog:
>>>
>>> 2020-02-04  Martin Liska  <mliska@suse.cz>
>>>
>>>          PR c++/92717
>>>          * doc/invoke.texi: Document that one should
>>>          not combine ASLR and -fpch.
>>> ---
>>>    gcc/doc/invoke.texi | 2 ++
>>>    1 file changed, 2 insertions(+)
>>>
>>>
> 
> 	Jakub
>
Richard Biener Feb. 5, 2020, 7:52 a.m. UTC | #5
On Tue, Feb 4, 2020 at 4:09 PM Martin Liška <mliska@suse.cz> wrote:
>
> On 2/4/20 2:59 PM, Jakub Jelinek wrote:
> > On Tue, Feb 04, 2020 at 02:55:31PM +0100, Richard Biener wrote:
> >> On Tue, Feb 4, 2020 at 2:45 PM Martin Liška <mliska@suse.cz> wrote:
> >>>
> >>> Hi.
> >>>
> >>> The patch is about enhancement of the documentation, where
> >>> we do not support ASLR for Precompiled Headers.
> >>>
> >>> Ready for trunk?
> >>
> >> I think we support ASLR just fine?
> >
> > We do support ASLR just fine, just the PCH from it will not be bitwise
> > reproduceable.  So the doc patch is misplaced (putting it between sentence
> > talking about options and the list of those options is weird) and should make
> > it clear that ASLR may result in non-reproduceable PCH files.
>
> You are right. I fixed the placing of the hunk and relaxed the wording.

I think the wording is still too defensive - "non-reproducible" results suggest
the binaries produced are somehow not reproducible (or worse).  But it's
just the PCH file itself that can differ between builds.  So something like

"Address space layout randomization (ASLR) can lead to not binary identical
PCH files.  If you rely on stable PCH file contents disable ASLR when generating
PCH files."

?

>
> Martin
>
> >
> >>> gcc/ChangeLog:
> >>>
> >>> 2020-02-04  Martin Liska  <mliska@suse.cz>
> >>>
> >>>          PR c++/92717
> >>>          * doc/invoke.texi: Document that one should
> >>>          not combine ASLR and -fpch.
> >>> ---
> >>>    gcc/doc/invoke.texi | 2 ++
> >>>    1 file changed, 2 insertions(+)
> >>>
> >>>
> >
> >       Jakub
> >
>
Martin Liška Feb. 5, 2020, 8:56 a.m. UTC | #6
On 2/5/20 8:52 AM, Richard Biener wrote:
> "Address space layout randomization (ASLR) can lead to not binary identical
> PCH files.  If you rely on stable PCH file contents disable ASLR when generating
> PCH files."
> 
> ?

I'm fine with that. Installed as r10-6442-gf4239581925d6a9fba049f8f771e909a7a5e5ce7.

Martin
diff mbox series

Patch

diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 4dec0c8326b..eb4b786b405 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -31091,6 +31091,8 @@  for any cases where this rule is relaxed.
 @item Each of the following options must be the same when building and using
 the precompiled header:
 
+@item Address space layout randomization (ASLR) is disabled.
+
 @gccoptlist{-fexceptions}
 
 @item