From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta002.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) by sourceware.org (Postfix) with ESMTPS id 610E73858D32 for ; Mon, 18 Sep 2023 17:24:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 610E73858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=Shaw.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=shaw.ca Received: from shw-obgw-4001a.ext.cloudfilter.net ([10.228.9.142]) by cmsmtp with ESMTP id iE0mqXQGy6NwhiHyeqw4ni; Mon, 18 Sep 2023 17:24:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=shaw.ca; s=s20180605; t=1695057844; bh=/0y1W9L71JdQQ2toZNgsXtb5nRAfq4mrVou9cNpun3M=; h=Date:Reply-To:Subject:To:References:From:Cc:In-Reply-To; b=TEubhMQSURhjhhMGJjr3qbmRFR1EYHmuAKILsm6THoTXEei6fMV9v4ewVLA0cPl37 lYC/YTSsslH71G99yuaoNj6eHUq667o7LCH0VzhUh7bqYKr3XXDrOsN24KS6+dBTtt /NPf0wntZWRlZAYuRAKTnl8d4oIrxs+du+80RU5NootFHY/4kExFp23a9MOmMsjjbN G3+Zk/jDtAj+tdr5/1UB/e8NCU8vHx37JLqggb6dJATkoXzYYcgUvHqG1PY0KdBZYa 6DW4cEocK7KVEW/QF+rQFG9Y2B6t8LyHyaxXdu5L/FI6nOFM9XBynmmUEDhU0sVXIi Sk34ziJJ4Uc6g== Received: from [10.0.0.5] ([184.64.102.149]) by cmsmtp with ESMTP id iHyeq9VR5HFsOiHyeqyPAo; Mon, 18 Sep 2023 17:24:04 +0000 X-Authority-Analysis: v=2.4 cv=XZqaca15 c=1 sm=1 tr=0 ts=650887b4 a=DxHlV3/gbUaP7LOF0QAmaA==:117 a=DxHlV3/gbUaP7LOF0QAmaA==:17 a=IkcTkHD0fZMA:10 a=NEAV23lmAAAA:8 a=sjjbML_iNJy0pxhv08IA:9 a=QEXdDO2ut3YA:10 Message-ID: <86ec734a-4277-f9be-81bb-75a4bbae6e76@Shaw.ca> Date: Mon, 18 Sep 2023 11:24:04 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Reply-To: cygwin-apps@cygwin.com Subject: Re: cygport may not create debug info if top directory contains a symlink Content-Language: en-CA To: cygwin-apps@cygwin.com References: <9bc07a5f-86d9-76ee-f45d-e1956c9035f8@t-online.de> <8f480c7f-e2d0-c2b2-f6fb-24a1e54c2b19@t-online.de> From: Brian Inglis Organization: Inglis Cc: Christian Franke In-Reply-To: <8f480c7f-e2d0-c2b2-f6fb-24a1e54c2b19@t-online.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4xfNAN2pXL6X0fRGF+oG5nH62wSiNxmyHoHGPZXmQ+AQvQIl+ci1v+5l82i6N0QHjWwMqHzLKr/a3v8XNQH04sU9CxQYteKDC3CR+mx2QnZ9RzThxbxZRD fg0aSBTPnaL/oXMnnlAWqHhFZe77W5q9fR8Wj73JMqxEvuaTnnnWLH7/tzrPkX2VbfW6nNt4qYmzwoR6WwLa13VRzWMQqAnvXkd/Fhy3dnxuCm7Yusw+RKQu X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS,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: 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? >>> Sidenote: we should probably also be using file-prefix-map, now we're on a >>> gcc which supports it. ... also macro-prefix-map, although it looks like changing to -ffile-prefix-map is equivalent to -f*-prefix-map which future proofs the options! >>>> 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 Thanks, looks good - care to submit a patch, including above suggestions, to cover all bases? -- Take care. Thanks, Brian Inglis Calgary, Alberta, Canada La perfection est atteinte Perfection is achieved non pas lorsqu'il n'y a plus rien à ajouter not when there is no more to add mais lorsqu'il n'y a plus rien à retirer but when there is no more to cut -- Antoine de Saint-Exupéry