From owner-svn-src-head@FreeBSD.ORG Wed Feb 23 22:04:33 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 714A2106566B; Wed, 23 Feb 2011 22:04:33 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id 0E02C8FC17; Wed, 23 Feb 2011 22:04:32 +0000 (UTC) Received: from c122-107-114-89.carlnfd1.nsw.optusnet.com.au (c122-107-114-89.carlnfd1.nsw.optusnet.com.au [122.107.114.89]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p1NM4Sln021350 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 24 Feb 2011 09:04:30 +1100 Date: Thu, 24 Feb 2011 09:04:28 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Dimitry Andric In-Reply-To: <201102232117.p1NLHcuE011679@svn.freebsd.org> Message-ID: <20110224084812.F1571@besplex.bde.org> References: <201102232117.p1NLHcuE011679@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Feb 2011 22:04:33 -0000 On Wed, 23 Feb 2011, Dimitry Andric wrote: > Log: > Fix the 32-bit build stage on amd64 when WITH_CTF is enabled. It seems > ctfconvert will corrupt object files that are compiled with -g, if it is > not run with -g itself. > > To fix it, remove -g from CFLAGS in lib/librt/Makefile. If you need to > compile this library with debug info, use DEBUG_FLAGS=-g instead, which > will work correctly, even when using WITH_CTF. Hard-coded -g is a style bug, but I wonder if this works even with -g in DEBUG_FLAGS. 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 % % Script done on Wed Feb 23 21:47:24 2011 gdb also cannot find `main'. But if everything is compiled without -g, gdb can find `main'. Similarly with multiple files, some compiled via asm and some via (implicit) .o's. I haven't found an incantantion that works. The asm file contains lots of debugging info, but the info is apparently incomplete or invalid. The object file produced from the asm file differs from the one produced directly from the C file. Perhaps you already fixed this by importing newer binutils. Bruce