From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 80757 invoked by alias); 15 May 2018 12:58:13 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 78012 invoked by uid 89); 15 May 2018 12:58:11 -0000 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 Received: from mail-it0-f66.google.com (HELO mail-it0-f66.google.com) (209.85.214.66) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 15 May 2018 12:58:09 +0000 Received: by mail-it0-f66.google.com with SMTP id p3-v6so1150071itc.0 for ; Tue, 15 May 2018 05:58:09 -0700 (PDT) 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) Received: from [192.168.0.19] ([50.4.50.42]) by smtp.gmail.com with ESMTPSA id o1-v6sm151468ite.37.2018.05.15.05.58.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 May 2018 05:58:07 -0700 (PDT) Subject: Re: Defaulting to stabs debug output from AS Cygwin64 To: cygwin@cygwin.com References: Reply-To: cygwin@cygwin.com From: cyg Simple Openpgp: preference=signencrypt Autocrypt: addr=cygsimple@gmail.com; prefer-encrypt=mutual; keydata= xsFNBFW7cuMBEADJg9disJJSBGRlDxdAt2hR6I6Ruzm8vw+zpjEGLsYyWiBhoLV1EEmHLyhh bdPEJx0DU2sPVbTcESRiYaTOVK6wJQMFur+WZ5cUkIXfJBQPUPRUcxbjrY8MtWYguhACSP/T ZGjtxl9w92fGYLTBDqVmOb9rjEo9UbmZwDTCYhjkAvlXR/K+q6+jGgrXLIC1CpiWqE1l2yH9 RGclbNc3Yjq9RJgqiHI+VgRa2P16NteTLSrD428YJS5p8rFIYngZooNClCJsrSAZCJ2abQ40 0S+kP/lcoSph5JXIDAL6sB6hUZg9sVpL4iU2Qsm7EKDBgvw72+AGH+ApxEgijYCPe8O1aybd qq2KWOeIg40gAua3ZPq7XIGd4TGIA0kzAK0wnE1LjSWF4h/bkf8CmGn3s7upAkNa75XOKApa V2cVMmi6qdcgjCDkNQbbgvv0V4VmqQYlFXYLfzOZZB3Lgyde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uPWUbedGasF6T+vJocWLz/R18FLB6p7EInQLGMWg wGsTPx//LTR5MItkY82S3yWiLFIqep9tz2AfSFA8OmMt89DcAtNaueK5RmhlaqLGExrd5UDh 9DEdG0tpWfTT50qekW9xvQM0BX//jKwZmW0BBpesbuvPT/2o88k6IVZ36KocuZ2bOIPILi32 wg+5v1su/z8BRNE2vrXyEBUtHkSNxAfJO9jDWlqec3RAmyvHFNORmrT2jwBYn6tWRk1frBVh rQ3yLvQckFdqNQzJ9xxtLpa+g6QvjEDsWx3edL7PHaIqtxe5F9nMnEKEI4f/92ssTst9Ot3Z 57mvQ2yi7GXAyBGBmMvhVno= Message-ID: <551ec1bb-60e2-2372-8e1a-f4cb839ae454@gmail.com> Date: Tue, 15 May 2018 13:18:00 -0000 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: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2018-05/txt/msg00192.txt.bz2 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. -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) > 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