delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2018/05/15/08:58:23

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:to:references:reply-to:from:message-id
:date:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=U6oThrYbsFGMMA/R
2uz6A5AHKfGyfS1b11iuHpAscG4o+0sCnLY/SFqJRbxB81JDlc7dvGckhctXvbch
8pqNKUCcQMB1nxm+UZ3gOQYjWgs/NemAB1FVBruDkb7wHrRArZoHI8ainvtN2Lur
zRPKnUpdPGSIxAVslUUczEIncWs=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:to:references:reply-to:from:message-id
:date:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=fTys/z77CLWCj3dsnA8bn1
qzgVI=; b=iZUkbSKjnMhFYNZ4TmMVRSCVIz8v/UpRjjhQc7ViekI033gV43lV+Z
3YGdrgkjLQ5S+ditRvIsDdDnbsmn8T+cqBhlOXNLWifyfc7jYAvRUwNKIPg2LwLV
BClOqrDk8E8OY6GmBBFep+8ky5F5VQ2vDyg4pv605eHI4KcYFZl5k=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_NUMSUBJECT,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 spammy=enright, Enright, refuse, onlinedocs
X-HELO: mail-it0-f66.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:reply-to:from:openpgp :autocrypt:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=QECFe4fX1rNosLgQ5pKvCeQHmAFavwlCodip/9GWtTQ=; b=t4R/9tco+QEcC8sdWP6z2/tY4zGP0LxPknF8GfHG27q193HzZwrhnGOoh48d/wY5rz ZoZL/Af9H+MsNwv79wVzrQJapq5n2ifUwgftN/MRpHPvVi7VZ9/3/wSenqDjhQ7Um/ut 3uM7rzhSec1Gp8TggQR8tjtrk2gwl88QAGAA1rqv8CQ0+Rw/pvr5X1/3KMm4o/dW3QXG 6v0lHYo3jZteJnNguaUusqu4SxbSX37DI7hEf2jAZKjLMJ6vhaCi05isWN/96sJSbSLs Pej3qDqzY2XmNcBKcUnJ/WK7cG2NOw1BI51nOmY4N8B3Do7F6Aec+dJzl1VuMRCKLqWS X/tg==
X-Gm-Message-State: ALKqPweox2zdutF/an5gv9eUrBGdluGhDaKwzBqOfBNCw6ZlZLRwIzsq 37QfdrkyVgLAl2mTwDR2PWMP5Q==
X-Google-Smtp-Source: AB8JxZqLg9KBXe842ix2g4mx6jMzBjQpt2VSEWi1CUrGsO/M437ghslTFaryULVgrV0Fs3zNmTYVFw==
X-Received: by 2002:a24:6243:: with SMTP id d64-v6mr13987927itc.78.1526389088007; Tue, 15 May 2018 05:58:08 -0700 (PDT)
Subject: Re: Defaulting to stabs debug output from AS Cygwin64
To: cygwin AT cygwin DOT com
References: <CAOC2fq-rSqiikBs2r3K-s=G6VWfGu_bE19KFEdn8jymwkTreBQ AT mail DOT gmail DOT com>
Reply-To: cygwin AT cygwin DOT com
From: cyg Simple <cygsimple AT gmail DOT com>
Openpgp: preference=signencrypt
Autocrypt: addr=cygsimple AT gmail DOT com; prefer-encrypt=mutual; keydata= xsFNBFW7cuMBEADJg9disJJSBGRlDxdAt2hR6I6Ruzm8vw+zpjEGLsYyWiBhoLV1EEmHLyhh bdPEJx0DU2sPVbTcESRiYaTOVK6wJQMFur+WZ5cUkIXfJBQPUPRUcxbjrY8MtWYguhACSP/T ZGjtxl9w92fGYLTBDqVmOb9rjEo9UbmZwDTCYhjkAvlXR/K+q6+jGgrXLIC1CpiWqE1l2yH9 RGclbNc3Yjq9RJgqiHI+VgRa2P16NteTLSrD428YJS5p8rFIYngZooNClCJsrSAZCJ2abQ40 0S+kP/lcoSph5JXIDAL6sB6hUZg9sVpL4iU2Qsm7EKDBgvw72+AGH+ApxEgijYCPe8O1aybd qq2KWOeIg40gAua3ZPq7XIGd4TGIA0kzAK0wnE1LjSWF4h/bkf8CmGn3s7upAkNa75XOKApa V2cVMmi6qdcgjCDkNQbbgvv0V4VmqQYlFXYLfzOZZB3LgydeoMERX+74aVEHKv5PxEbfwLnv 29nsKvB7yLhfYSbaHQPOIqkgMuw+bx8m1Zh9IKJv0/O8Ta/yvyW2sHWMcAAmd4t1gykbZCZa NbvKAhvIP9NWjREae+jjsJJj98mbvsI8pCFbc2coHWNAk4JyBjDcMFrhTNA+8+D5RveRERrc yFu2qU6Bl7Bz2U1VLsmo2HcmRQRO6L0CwwsIlgeZGSmyJxPzzwARAQABzStFYXJuZXN0IEJv eWQgPGVib3lkNTNlbnRlcnByaXNlc0BnbWFpbC5jb20+wsF/BBMBCAApBQJVu3LjAhsjBQkJ ZgGABwsJCAcDAgEGFQgCCQoLBBYCAwECHgECF4AACgkQcYOkK+VgItVscRAApR0Iad65JnDa 7RlhEducTNM836qBbqcsQSPoEGJ5sNhHP9VF2jB2Kd4JONyksLyVD/nU+hJwTB4SnUC5dwRo 0a4HQbYSaiLoXZNlRGGP++ACy7E0BT+pvV9gd9tmLtYDvuHzEbEY70nm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FPswDxjexBt8uaAwCgJUdr7x u6Q3ydTst6UXrzEowtKo7utm8L823gKcNjktKhDGHpddseC5RgPIWwp7/QDb4uiPw2Y6UI3n BH6x7dYcV0bQfsHtJ1ytdWhI5GgmPZsWoLBHtZg/065R
Message-ID: <551ec1bb-60e2-2372-8e1a-f4cb839ae454@gmail.com>
Date: Tue, 15 May 2018 08:58:04 -0400
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0
MIME-Version: 1.0
In-Reply-To: <CAOC2fq-rSqiikBs2r3K-s=G6VWfGu_bE19KFEdn8jymwkTreBQ@mail.gmail.com>
X-IsSubscribed: yes


On 5/15/2018 12:17 AM, Michael Enright wrote:
> I am working on a little compiler for fun, which generates assembly
> code. At this point I manually invoke as and ld.
> 
> For debugging I added the -g option to the invocation of as, but then
> ld failed with
> 

Years of work tells me to not trust the default of any option.  You
should be specific.

<quote src="https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html">
-g
Produce debugging information in the operating system’s native format
(stabs, COFF, XCOFF, or DWARF). GDB can work with this debugging
information.

On most systems that use stabs format, -g enables use of extra debugging
information that only GDB can use; this extra information makes
debugging work better in GDB but probably makes other debuggers crash or
refuse to read the program. If you want to control for certain whether
to generate the extra information, use -gstabs+, -gstabs, -gxcoff+,
-gxcoff, or -gvms (see below)
</quote>

>  t.o:t.s:1:(.stab+0x14): relocation truncated to fit: R_X86_64_32
> against `.text'
> 
> Looking into this on Stack Overflow I was taught that stabs is
> obsolete. I think 'obsolete' may not be quite the right
> interpretation, but 'wrong for Cygwin64' could be the right story.
> Practically speaking, without thinking about it too critically,
> -gdwarf2 in place of -g is the solution.
> 

The dwarf format isn't supported by native tools.  I think COFF should
be the default but that is just me and I don't maintain the distribution
of GCC.

> I'm trying to find authority for saying anything exact about the situation:
> 1) Is there a reason why stabs is the default for '-g' with Cygwin64?

I gave one above.

> 1a) Is a patch desired to make dwarf2 the default?

It would have to be at the upstream source level but I don't think so.

> 2) Is there a way within Cygwin64 that a .o file with stabs can be
> properly processed by ld to give proper input to gdb?

Does -gstabs+ help?

> 3) Is stabs fatally flawed for the purposes of Cygwin64 or could it be
> upgraded, within the existing meaning of the stabs specification, so
> that it would work?

That should be asked at the GCC upstream.

> 3a) To put it another way, is this just a stabs bug that could be
> fixed for Cygwin64?

I haven't looked at the source for the compiler to answer that.

> 
> Above when I say Cygwin64, I'm talking about straightforward native
> use of as, ld, and gdb, not cross-compiling to some other platform.

I question your use of Cygwin instead of MinGW for your compiler but
that is just a musing.

-- 
cyg Simple

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019