From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id 8087C3858289 for ; Mon, 15 Aug 2022 17:15:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8087C3858289 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.93,238,1654588800"; d="scan'208";a="81201267" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 15 Aug 2022 09:15:53 -0800 IronPort-SDR: x0Zbu0gwmOkcmC1NIYrTaDdDzhEC+TYEOzoTCBNkUuiCX8jTLCYiu/2Em5d5oxrJf3DzyvBe8W hB7rY9QYm0o+v2ZeflH63A2DvoWp5x6tyfnteJsChb4gt3eHoXMMqRqF/5xnvkd3dcXgS7RnLQ zEQXbswAVHwfDoQkfx4S+7zoxHRzZC8o/XGURT2ZuTyyXbtIvtRMClSQTT+Zxywk2qiFzZ/mid vxC0oGWre2AFeQKXmQJ9uWwOSyzKCNyx1zUafBEDpvm/ExdbWY5DPBV2ujlA0BBTcUU/xCZKXN 4EI= Date: Mon, 15 Aug 2022 17:15:46 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: Richard Purdie CC: , Khem Raj Subject: Re: Reproducible builds - supporting relative paths in *-prefix-map In-Reply-To: <1c0ab23fd0cc1bc34a229287529963526141327a.camel@linuxfoundation.org> Message-ID: References: <1c0ab23fd0cc1bc34a229287529963526141327a.camel@linuxfoundation.org> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-13.mgc.mentorg.com (139.181.222.13) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-3111.8 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Aug 2022 17:15:57 -0000 On Mon, 15 Aug 2022, Richard Purdie via Gcc wrote: > Currently it works well for absolute paths but if a file uses a > relative path or a path with a symlink in, or a non-absolute path, it > will miss those cases. For relative paths in particular it is > problematic as you can't easily construct a compiler commandline that > would cover all relative path options. I'd expect a relative path to be naturally relocatable without needing to be remapped. (For example, DW_AT_comp_dir would be relocated in debug info, but there would be no need to relocate the paths to individual files that are relative to DW_AT_comp_dir.) Is the issue that you're using relative paths between two directories that don't have a fixed relative path between them, such as between the build and source directories, as opposed to relative paths within the source directory or within the build directory? > which address a realpath() call into the prefix mapping code. I did That would run the risk of breaking relocation for anyone who has deliberately used the paths they pass to the compiler (possibly involving symlinks, for example) in their remapping options - not expecting a further level of processing to be applied to those paths before remapping. -- Joseph S. Myers joseph@codesourcery.com