From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by sourceware.org (Postfix) with ESMTPS id 78777385840F for ; Mon, 15 Aug 2022 19:51:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 78777385840F Received: by mail-wr1-x42d.google.com with SMTP id r16so990529wrm.6 for ; Mon, 15 Aug 2022 12:51:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc; bh=Hg8QlAaaO4uI9fJH7Cjw/drjZ8+bj67ZtNsYQ5nIWY0=; b=qM5YxrYHNvE1mAO2LSXX3s3UO8ujf8VNutnk5oUU1Ms11EFIRt6D2DvFNFR9yRCucP 7xFPVEsiETrbvFsQsqbywQ81mhjExxSV40rUUgjdfNx10fUQHd/3fjWXORbAtH72Cw9G XNwRDLTThmc5VN4lpw3kFeXqZWNAsRAtYRS/dX+iTdI/uXbUtXeTU6TRhKT6NGxoUgwF D8R5HMbyxLeF3/TWZE84ulmDfqXmLgBD4GmxlzW5W+0M6nb6gdpBDcuJwMlTvxXc7Woj j2XqbECRsUe2pG17NppqwlBI64pgCU72602pyNNGrQ+B6wgsr2RunpCGGzvE/B9AAZwZ RDkQ== X-Gm-Message-State: ACgBeo1OMxbLdCBVC9ll1SkFl68pxrKUJeJSTdhrMTX0fMbOQc1Zgcdl Z/fJ0ZJa1lNNzS1iaGnLCJNcvg== X-Google-Smtp-Source: AA6agR5HSjF+Y8a31EQY3rCn/QzEHHtSn+09FUFIIttlxlXCfwwZ6+wFzMltQjqa7AzGVnF9JDkJSA== X-Received: by 2002:a05:6000:61c:b0:220:6425:c113 with SMTP id bn28-20020a056000061c00b002206425c113mr10014451wrb.612.1660593115769; Mon, 15 Aug 2022 12:51:55 -0700 (PDT) Received: from ?IPv6:2001:8b0:aba:5f3c:1640:f887:39f5:69b1? ([2001:8b0:aba:5f3c:1640:f887:39f5:69b1]) by smtp.gmail.com with ESMTPSA id u18-20020a05600c19d200b003a2cf1ba9e2sm11275313wmq.6.2022.08.15.12.51.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Aug 2022 12:51:55 -0700 (PDT) Message-ID: Subject: Re: Reproducible builds - supporting relative paths in *-prefix-map From: Richard Purdie To: Joseph Myers Cc: gcc@gcc.gnu.org, Khem Raj Date: Mon, 15 Aug 2022 20:51:53 +0100 In-Reply-To: References: <1c0ab23fd0cc1bc34a229287529963526141327a.camel@linuxfoundation.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.1-0ubuntu1 MIME-Version: 1.0 X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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 19:52:00 -0000 On Mon, 2022-08-15 at 17:15 +0000, Joseph Myers wrote: > On Mon, 15 Aug 2022, Richard Purdie via Gcc wrote: >=20 > > 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. >=20 > I'd expect a relative path to be naturally relocatable without needing to= =20 > be remapped. (For example, DW_AT_comp_dir would be relocated in debug= =20 > info, but there would be no need to relocate the paths to individual file= s=20 > that are relative to DW_AT_comp_dir.) >=20 > Is the issue that you're using relative paths between two directories tha= t=20 > don't have a fixed relative path between them, such as between the build= =20 > and source directories, as opposed to relative paths within the source= =20 > directory or within the build directory? Yes, that is the issue.=C2=A0We build with separate build and source directories with a relative path between them and that relation doesn't work on target, particularly for installed binaries. It is a general problem but particularly where we build multiple components from the one shared source tree as those paths become multiple levels deep which makes creating a source layout on target to match even harder. > > which address a realpath() call into the prefix mapping code.=C2=A0I di= d >=20 > That would run the risk of breaking relocation for anyone who has=20 > deliberately used the paths they pass to the compiler (possibly involving= =20 > symlinks, for example) in their remapping options - not expecting a=20 > further level of processing to be applied to those paths before remapping= . It would be a change in behaviour but I'm not sure how many people would be relying on that or if they even should be. A relative path would only be relocated if it did match something in the prefix-map variables so this would be controllable. Cheers, Richard