From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sa-prd-fep-043.btinternet.com (mailomta22-sa.btinternet.com [213.120.69.28]) by sourceware.org (Postfix) with ESMTPS id F05B0385840F for ; Sun, 11 Feb 2024 17:01:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F05B0385840F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dronecode.org.uk Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dronecode.org.uk ARC-Filter: OpenARC Filter v1.0.0 sourceware.org F05B0385840F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=213.120.69.28 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707670908; cv=none; b=ObtJSA28DksmiqFCViEyUOYP8g4U+pm6XNnrvpVZiYMIb8AOWu+1gIrCiNuz7so8qoHqfojriW7O11qZyiCHiLgQBVYEniltHYlgoRKBc8De1Zk/qA7edIZNh80hNJucNJ7pvemTJUbfY1CfZ4jY+YY0CXL7yB/aRctpYsRz9FM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707670908; c=relaxed/simple; bh=KGueSM6+UktGZrx9yHjL2Ihai+OWcnpM4DqnTGNyk8g=; h=Message-ID:Date:MIME-Version:Subject:To:From; b=r+zkLHFWEgcAlOB0a3sKewRxGPubPmxc6+elNWydoqKL00fZYfNxqe2beX1irYqUV2nEXDgzb7RyJLR0HkORZlWEQytNSZZQIEKL+1pWEySl5vQfDJZKNNxe/Seb5Q48IFkwt2fFb5n5mf7gBCqfBghiW8OSmStzwGd5LRrwq34= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from sa-prd-rgout-001.btmx-prd.synchronoss.net ([10.2.38.4]) by sa-prd-fep-043.btinternet.com with ESMTP id <20240211170145.EDWP1396.sa-prd-fep-043.btinternet.com@sa-prd-rgout-001.btmx-prd.synchronoss.net>; Sun, 11 Feb 2024 17:01:45 +0000 Authentication-Results: btinternet.com; none X-SNCR-Rigid: 656684A009DD24D4 X-Originating-IP: [86.140.112.71] X-OWM-Source-IP: 86.140.112.71 X-OWM-Env-Sender: jon.turney@dronecode.org.uk X-VadeSecure-score: verdict=clean score=0/300, class=clean X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgedvledruddugdelkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemuceutffkvffkuffjvffgnffgvefqofdpqfgfvfenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepkfffgggfuffvfhfhvegjtgfgsehtkeertddtvdejnecuhfhrohhmpeflohhnucfvuhhrnhgvhicuoehjohhnrdhtuhhrnhgvhiesughrohhnvggtohguvgdrohhrghdruhhkqeenucggtffrrghtthgvrhhnpedtudeugeeltdefhedukeetfeegkeejiedvhedthfdukeduudeuvdeiffejgeeihfenucffohhmrghinhepghhithhhuhgsrdgtohhmnecukfhppeekiedrudegtddrudduvddrjedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehhvghloheplgduledvrdduieekrddurddutdelngdpihhnvghtpeekiedrudegtddrudduvddrjedupdhmrghilhhfrhhomhepjhhonhdrthhurhhnvgihsegurhhonhgvtghouggvrdhorhhgrdhukhdpnhgspghrtghpthhtohepvddprhgtphhtthhopeevhhhrihhsthhirghnrdfhrhgrnhhkvgesthdqohhnlhhinhgvrdguvgdprhgtphhtthhopegthihgfihinhdqrghpphhssegthihgfihinhdrtghomhdprhgvvhfkrfephhhoshhtkeeiqddugedtqdduuddvqdejuddrrhgrnhhgvgekiedqudegtddrsghttggvnhhtrhgrlhhplhhushdrtghomhdprghuthhhpghu shgvrhepjhhonhhtuhhrnhgvhiessghtihhnthgvrhhnvghtrdgtohhmpdhgvghokffrpefiuedpoffvtefjohhsthepshgrqdhprhguqdhrghhouhhtqddttddu X-RazorGate-Vade-Verdict: clean 0 X-RazorGate-Vade-Classification: clean Received: from [192.168.1.109] (86.140.112.71) by sa-prd-rgout-001.btmx-prd.synchronoss.net (authenticated as jonturney@btinternet.com) id 656684A009DD24D4; Sun, 11 Feb 2024 17:01:45 +0000 Message-ID: <39275431-2f86-45d5-9fa0-88369e63ae40@dronecode.org.uk> Date: Sun, 11 Feb 2024 17:01:45 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: cygport may not create debug info if top directory contains a symlink To: Christian Franke References: <9bc07a5f-86d9-76ee-f45d-e1956c9035f8@t-online.de> <8f480c7f-e2d0-c2b2-f6fb-24a1e54c2b19@t-online.de> <86ec734a-4277-f9be-81bb-75a4bbae6e76@Shaw.ca> <6ecfe72d-1f77-af76-9430-8594b8f13384@t-online.de> <7cecd318-a2ca-49cd-978d-5a27e0072e72@dronecode.org.uk> <4b32eb45-e167-9a30-1a67-2fac6e57f39e@t-online.de> Content-Language: en-GB From: Jon Turney Cc: cygwin-apps@cygwin.com In-Reply-To: <4b32eb45-e167-9a30-1a67-2fac6e57f39e@t-online.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00,BODY_8BITS,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,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 List-Id: On 30/10/2023 16:37, Christian Franke via Cygwin-apps wrote: > Jon Turney wrote: >> On 20/09/2023 11:58, Christian Franke via Cygwin-apps wrote: >>> Brian Inglis wrote: >>>> On 2023-09-18 04:41, Christian Franke via Cygwin-apps wrote: >>>>> 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 >>>> >>>> Should bin/cygport.in:534: not have $B between the == as in line 531: >>>> >>>>     declare ${flags}+=" -fdebug-prefix-map=${B}=/usr/src/debug/${PF}" >>>>     ... >>>>     declare ${flags}+=" -fdebug-prefix-map==/usr/src/debug/${PF}" >>>> >>>> or be hoist above the condition if identical, unless that is some >>>> undocumented default for cwd? >>> >>> I guess the == without ${B} is intentional because it makes the debug >>> source path relative to ${B} as lines 535-536 also do. >> [...]> >> (It's unclear to me how gcc compares paths to apply this mapping. If >> it's a literal string prefix, rather than on some (semi-)canonicalized >> path, then we're maybe going to lose here sometimes, depending on the >> vagaries of the build-system, unless we list all of relative, >> absolute, and canonical absolute paths?) >> >> (But then maybe we can push dealing with or indicating which of those >> is correct off onto the individual cygport?) >> > > Adding this if "$(cd ${S} && pwd -P)" != "${S}" should IMO be safe: >   -fdebug-prefix-map=$(cd ${B} && pwd -P)=/usr/src/debug/${PF} >   -fdebug-prefix-map=$(cd ${S} && pwd -P)=/usr/src/debug/${PF} > (or use realpath) > So it seems there's a new flag '-fcanon-prefix-map' in GCC 13, which looks like it maybe solves this problem.