public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jacob Kroon <jacob.kroon@gmail.com>
To: Jakub Jelinek <jakub@redhat.com>, Andrew Pinski <pinskia@gmail.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [RFC PATCH] gcc: Improve reproducability when building cc1/cc1plus
Date: Sat, 20 Nov 2021 09:42:45 +0100	[thread overview]
Message-ID: <709a5d8c-b239-06cf-0598-2bf059fd8b4f@gmail.com> (raw)
In-Reply-To: <20211120083221.GY2646553@tucnak>

On 11/20/21 09:32, Jakub Jelinek wrote:
> On Sat, Nov 20, 2021 at 12:24:21AM -0800, Andrew Pinski via Gcc-patches wrote:
>> On Sat, Nov 20, 2021 at 12:18 AM Jacob Kroon via Gcc-patches
>> <gcc-patches@gcc.gnu.org> wrote:
>>>
>>> cc1/cc1plus both include a checksum of the object files, archives and
>>> options used during linking. Unless the host binutils has been built
>>> with --enable-deterministic-archives, the archives will have different
>>> checksums each build due to changes in timestamps of the containing
>>> object files, and thus the checksum that is embedded in cc1/cc1plus will
>>> also change.
>>>
>>> Fix this by passing "D" to ar/ranlib when creating the archives.
>>
>> How portable is the D option? That does it work with Mac OS X's ar;
>> what about AIX's ar; what about Solaris's ar, etc?
>> GNU binutils is not the only ar which is supported for the host.
> 
> It isn't portable and even if ar/ranlib do support that option, not all
> users will want it, so forcing it upon them unconditionally is IMO not a
> good idea.  If anything, configure needs to check if those options are
> supported and there needs to be preferrably non-default gcc configure
> option to request it.
> 

Aha, I see. Then perhaps an easier and more portable solution for 
improving the reproducibility would be to make it optional whether or 
not to include the archives when calculating the checksums.

Or perhaps by checksumming the containing object files instead of the 
archives themselves ?

Would something like that be acceptable ?

Jacob

  reply	other threads:[~2021-11-20  8:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-20  8:17 Jacob Kroon
2021-11-20  8:24 ` Andrew Pinski
2021-11-20  8:32   ` Jakub Jelinek
2021-11-20  8:42     ` Jacob Kroon [this message]
2021-11-22  8:51       ` Richard Biener

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=709a5d8c-b239-06cf-0598-2bf059fd8b4f@gmail.com \
    --to=jacob.kroon@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=pinskia@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).