From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 77864 invoked by alias); 13 Feb 2018 07:59:42 -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 77760 invoked by uid 89); 13 Feb 2018 07:59:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=alastair.mckinstry@sceal.ie, alastairmckinstryscealie, jb@gcc.gnu.org, jbgccgnuorg X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-lf0-f50.google.com Received: from mail-lf0-f50.google.com (HELO mail-lf0-f50.google.com) (209.85.215.50) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 13 Feb 2018 07:59:39 +0000 Received: by mail-lf0-f50.google.com with SMTP id f137so23893024lfe.4; Mon, 12 Feb 2018 23:59:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=OYydqXSCdy13DIJJG/EyEGe2wL3bif28syumaDgFe+M=; b=B0bg9Rzvcgpk6ZOThKvzwemb9Y/FDDxL4haW5gUym3hpI2L1K2QwwPGsOXRllBH4O6 W9CbCyetGQgbHp1gKfHTMdFO+TxeAeA3w7mCQizcruYcq6xVnpUEq5ipAApjAJUwcmpm QLHMeTDVRkUM9xwaYcgRjdpJcj3QU+ZRSTXgHQ3wMpJM62ICZRYBVkLO4xNs7ktLuKbM PWVPZSSqNiOLaBnER8QwVtJMh8TsAizV4sRgQoJKscA98aWYl5g1UiLjz296uVOp29ut uzLmxcMcba7MQZUqHAVu3taUPVJyOWnu7bXdU6xgsLPNxp9PQLzH3mtnpOFnH8RTay7h nKHQ== X-Gm-Message-State: APf1xPCUR/CtGdjcNmvDevComOdH4wC/Bas9RhUHN9+Z+k9JkwiVdX+G 5IAF6/tde/KjuM5vq9bEK0/0zQ== X-Google-Smtp-Source: AH8x225aUz8ONd2dCIOQJ5g1fOYjfiKWV8UvGTDP07BJ1yf/EoZpwVLEOSnQdgxd9HXNz88+VSWkJw== X-Received: by 10.46.56.18 with SMTP id f18mr325378lja.4.1518508777257; Mon, 12 Feb 2018 23:59:37 -0800 (PST) Received: from dt.lan (88-114-247-254.elisa-laajakaista.fi. [88.114.247.254]) by smtp.gmail.com with ESMTPSA id g17sm1375593ljf.22.2018.02.12.23.59.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Feb 2018 23:59:36 -0800 (PST) From: Janne Blomqvist To: fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org Cc: Janne Blomqvist Subject: [PATCH, committed] Make module files reproducible Date: Tue, 13 Feb 2018 07:59:00 -0000 Message-Id: <1518508769-3277-1-git-send-email-blomqvist.janne@gmail.com> X-SW-Source: 2018-02/txt/msg00706.txt.bz2 Using lbasename ensures that the build path does not end up in the module file. Regtested on x86_64-pc-linux-gnu, committed to trunk. Will shortly backport to the 6 and 7 branches as well. 2018-02-13 Alastair McKinstry Janne Blomqvist * module.c (dump_module): Use lbasename to ensure that module files are reproducible. --- gcc/fortran/module.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c index b120501..c833e67 100644 --- a/gcc/fortran/module.c +++ b/gcc/fortran/module.c @@ -6148,8 +6148,10 @@ dump_module (const char *name, int dump_flag) gfc_fatal_error ("Can't open module file %qs for writing at %C: %s", filename_tmp, xstrerror (errno)); + /* Use lbasename to ensure module files are reproducible regardless + of the build path (see the reproducible builds project). */ gzprintf (module_fp, "GFORTRAN module version '%s' created from %s\n", - MOD_VERSION, gfc_source_file); + MOD_VERSION, lbasename (gfc_source_file)); /* Write the module itself. */ iomode = IO_OUTPUT; -- 2.7.4