From owner-svn-src-all@FreeBSD.ORG Wed Feb 23 22:17:57 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 1518B106566B; Wed, 23 Feb 2011 22:17:57 +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 C70168FC12; Wed, 23 Feb 2011 22:17:56 +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 D4C295C37; Wed, 23 Feb 2011 23:17:55 +0100 (CET) Message-ID: <4D65879C.8090607@FreeBSD.org> Date: Wed, 23 Feb 2011 23:18:04 +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> In-Reply-To: <20110224084812.F1571@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:17:57 -0000 On 2011-02-23 23:04, Bruce Evans wrote: > Hard-coded -g is a style bug, but I wonder if this works even with -g in > DEBUG_FLAGS. Yes, it works, I tested it. The issue is that bsd.lib.mk contains this fragment: .if defined(WITH_CTF) .undef NO_CTF .endif .if defined(DEBUG_FLAGS) CFLAGS+= ${DEBUG_FLAGS} .if !defined(NO_CTF) && (${DEBUG_FLAGS:M-g} != "") CTFFLAGS+= -g .endif .endif E.g. if you put '-g' in CFLAGS, this fragment will fail to add the required '-g to CTFFLAGS. On the other hand, if you add '-g' to DEBUG_FLAGS, '-g' will be added to both CFLAGS and CTFFLAGS. > This may be related to the bug that -g is broken if the compilation is > via an intermediate asm file: > > "cc -g -o foo foo.c" != "cc -g -S foo.c; cc -g -o foo foo.s" > > The former works, but the latter gives: > > % Script started on Wed Feb 23 21:47:19 2011 > % > % pts/0:bde@ref9-i386:~/r> gdb foo > % 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"...Dwarf Error: Could not find abbrev number 47 [in module /dumpster/home/bde/r/foo] > % > % (gdb) q > % pts/0:bde@ref9-i386:~/r> exit Seems to work fine here (tree as of r218915, so with binutils 2.17.50): $ cc -g -S hello.c $ cc -g hello.s -o hello $ 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 } (gdb) > Perhaps you already fixed this by importing newer binutils. Apparently, yes. Maybe ref9-i386 should be updated again. :)