From owner-svn-src-all@FreeBSD.ORG Wed Feb 23 22:31:40 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D4C1106566C; Wed, 23 Feb 2011 22:31:40 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 5AF978FC1B; Wed, 23 Feb 2011 22:31:40 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:1131:79f:9a2b:b0a3] (unknown [IPv6:2001:7b8:3a7:0:1131:79f:9a2b:b0a3]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 9C79C5C37; Wed, 23 Feb 2011 23:31:39 +0100 (CET) Message-ID: <4D658AD4.9020602@FreeBSD.org> Date: Wed, 23 Feb 2011 23:31:48 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.15pre) Gecko/20110221 Lanikai/3.1.9pre MIME-Version: 1.0 To: Bruce Evans References: <201102232117.p1NLHcuE011679@svn.freebsd.org> <20110224084812.F1571@besplex.bde.org> <20110224090558.E1571@besplex.bde.org> In-Reply-To: <20110224090558.E1571@besplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r218984 - head/lib/librt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Feb 2011 22:31:40 -0000 On 2011-02-23 23:13, Bruce Evans wrote: > Now found it easly using gcc -v. gcc -c -v foo.c produces "... /usr/bin/as > -o foo.o /var/tmp/whatever.s", but gcc -c -v foo.s produces "... /usr/bin/as > -gdwarf2 -o foo.o foo.s". gcc's generation of -gdwarf2 is inconsistent > with itself. Do we use a nonstandard not-gdwarf2 option for the usual case > but forget to change this for asm files? I don't think so, but there is simply no need to pass '-g' in the gcc invocation that assembles and links the .s file, since the debug info is already embedded in the .s file itself. E.g. the following works just fine: $ cc -g -S hello.c $ cc -o hello hello.s $ file hello hello: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), dynamically linked (uses shared libs), for FreeBSD 9.0 (900033), not stripped $ gdb ./hello GNU gdb 6.1.1 [FreeBSD] Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-marcel-freebsd"... (gdb) list 1 #include 2 3 int main(void) 4 { 5 puts("Hello World!"); 6 7 return 0; 8 } Apparently, if you use --gdwarf2 with GNU as 2.15, it messes up the already existing debug info. It looks like 2.17.50 has no such problem, though.