From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 82955 invoked by alias); 3 Aug 2017 17:02:46 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 80692 invoked by uid 89); 3 Aug 2017 17:02:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=our, HContent-Transfer-Encoding:8bit X-HELO: mail.headstrong.de Received: from mail.headstrong.de (HELO mail.headstrong.de) (81.7.4.112) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 03 Aug 2017 17:02:41 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.headstrong.de (Postfix) with ESMTP id 5544B1C00411; Thu, 3 Aug 2017 19:02:39 +0200 (CEST) Received: from mail.headstrong.de ([127.0.0.1]) by localhost (mail.headstrong.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 287nmggl9k7X; Thu, 3 Aug 2017 19:02:32 +0200 (CEST) Subject: Re: [PING^4][PATCH v2] Generate reproducible output independently of the build-path To: Jeff Law , GCC Patches References: <20170721161538.7508-1-infinity0@pwned.gg> <3136125b-bd88-7c0b-504e-a4e4de545bbb@redhat.com> <4b6c844f-9a46-4a4b-48c5-9dfeac54b97f@pwned.gg> From: Ximin Luo Message-ID: <9889cb35-54ed-b1d0-f31c-2f60087d7ee3@pwned.gg> Date: Thu, 03 Aug 2017 17:02:00 -0000 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-SW-Source: 2017-08/txt/msg00332.txt.bz2 Jeff Law: > On 08/02/2017 08:06 PM, Ximin Luo wrote: >> Jeff Law: >>> On 07/21/2017 10:15 AM, Ximin Luo wrote: >>>> (Please keep me on CC, I am not subscribed) >>>> >>>> >>>> Proposal >>>> ======== >>>> >>>> This patch series adds a new environment variable BUILD_PATH_PREFIX_MAP. When >>>> this is set, GCC will treat this as extra implicit "-fdebug-prefix-map=$value" >>>> command-line arguments that precede any explicit ones. This makes the final >>>> binary output reproducible, and also hides the unreproducible value (the source >>>> path prefixes) from CFLAGS et. al. which many build tools (understandably) >>>> embed as-is into their build output. >>> I'd *really* avoid doing this with magic environment variables. Make it >>> a first class option to the compiler. Yes, it means projects that want >>> this behavior have to arrange to pass that flag to their compiler, but >>> IMHO that's much preferred over environment variables. >>> >>> Jeff >>> >> >> Hi Jeff, >> >> If by "first class option" you meant a command-line flag, GCC *already has* that (-fdebug-prefix-map) and it wasn't enough to achieve reproducibility in many cases we tested. dpkg-buildflags actually already adds these flags to CFLAGS CXXFLAGS etc on Debian. However, with this patch using the environment variable, we are able to reproduce 1800 more packages out of 26000. > Then take what you've done with the environment variable and instead implement it on top of a switch. An environment variable is absolutely the wrong thing to do here. > >> >> GCC already supports a similar environment variable SOURCE_DATE_EPOCH, which was accepted about 2 years ago in a patch written by one of our GSoC students. We are not planning any more environment variables like this, and are committed to fixing other sources of non-determinism by patching the relevant build scripts. > I would have rejected that as well :-) One of the few times I would > have disagreed with Bernd. > > Could you go into some more detail on why you think an envvar is absolutely the wrong thing to do here? X -- GPG: ed25519/56034877E1F87C35 GPG: rsa4096/1318EFAC5FBBDBCE https://github.com/infinity0/pubkeys.git