From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout02.t-online.de (mailout02.t-online.de [194.25.134.17]) by sourceware.org (Postfix) with ESMTPS id BE2A93858D32 for ; Mon, 18 Sep 2023 10:42:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BE2A93858D32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=t-online.de Authentication-Results: sourceware.org; spf=none smtp.mailfrom=t-online.de Received: from fwd84.aul.t-online.de (fwd84.aul.t-online.de [10.223.144.110]) by mailout02.t-online.de (Postfix) with SMTP id B5C9E162A1 for ; Mon, 18 Sep 2023 12:41:58 +0200 (CEST) Received: from [192.168.2.101] ([91.57.246.1]) by fwd84.t-online.de with (TLSv1.3:TLS_AES_256_GCM_SHA384 encrypted) esmtp id 1qiBhT-3Y2hRQ0; Mon, 18 Sep 2023 12:41:55 +0200 Subject: Re: cygport may not create debug info if top directory contains a symlink To: cygwin-apps@cygwin.com References: <9bc07a5f-86d9-76ee-f45d-e1956c9035f8@t-online.de> From: Christian Franke Message-ID: <8f480c7f-e2d0-c2b2-f6fb-24a1e54c2b19@t-online.de> Date: Mon, 18 Sep 2023 12:41:55 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 SeaMonkey/2.53.16 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-TOI-EXPURGATEID: 150726::1695033715-2B024649-8744B1E4/0/0 CLEAN NORMAL X-TOI-MSGID: a8709cea-7073-499b-876c-3777a7d51709 X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Brian Inglis wrote: > On 2023-09-17 08:01, Jon Turney via Cygwin-apps wrote: >> On 16/09/2023 15:17, Christian Franke via Cygwin wrote: >>> Found during tests of busybox package: >>> If the path of the top build directory contains a symlink and the >>> project's build scripts normalize pathnames, no debug info is >>> created by cygport. >>> >>> This is because options like >>>   -fdebug-prefix-map=${B}=/usr/src/debug/${PF} >>> have no effect because ${B} contains a symlink but the compiler is >>> run with the real source path. >> >> I think that there was some historical bug with gcc where a relative >> path for the old path in this mapping wasn't correctly handled, which >> is why were using an absolute path here at all. >> >> So changing it to something like [1] (if that works), might be better. >> >> [1] >> https://github.com/jon-turney/cygport/commit/4175d456a9184c5cdebd8bfb4b5ba30583cedd66 >> >> Sidenote: we should probably also be using file-prefix-map, now we're >> on a gcc which supports it. Definitely. in particular useful in conjunction with reproducible builds and this cygport patch: https://sourceware.org/pipermail/cygwin-apps/2023-August/043108.html The related newlib-cygwin patch has been pushed already: https://cygwin.com/git/?p=newlib-cygwin.git;a=commit;h=f5e37b93 >> >> >>> The postinstall code then does not find any line number info with >>> source path /usr/src/debug/${PF}/... >>> >>> Could be fixed easily in line 414 of /bin/cygport: >>> >>> -declare -r top=$(cd ${_topdir}; pwd); >>> +declare -r top=$(cd ${_topdir}; /bin/pwd); >> >> Can you explain why this makes a difference? > > In cygport, pwd is a bash builtin defaulting to -L; /bin/pwd defaults > to -P. > Both commands support both options and we might expect the same output. > It would be better to use builtin `pwd -P` if that produces the > correct result. It does. > > An STC script which creates test dirs to demonstrate the issue and > show the alternative outputs would be nice so anyone can see. $ ln -s /usr/src /tmp/source $ cd /tmp/source $ pwd /tmp/source $ /bin/pwd /usr/src $ pwd -P /usr/src $ /bin/pwd -L /tmp/source -- Regards, Christian