From owner-freebsd-current@FreeBSD.ORG Thu Aug 12 20:11:52 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DB39516A4CE for ; Thu, 12 Aug 2004 20:11:51 +0000 (GMT) Received: from tigra.ip.net.ua (tigra.ip.net.ua [82.193.96.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 385F543D49 for ; Thu, 12 Aug 2004 20:11:51 +0000 (GMT) (envelope-from ru@ip.net.ua) Received: from heffalump.ip.net.ua (heffalump.ip.net.ua [82.193.96.213]) by tigra.ip.net.ua (8.12.11/8.12.11) with ESMTP id i7CKBZiN056058 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 12 Aug 2004 23:11:36 +0300 (EEST) (envelope-from ru@ip.net.ua) Received: (from ru@localhost) by heffalump.ip.net.ua (8.12.11/8.12.11) id i7CKBc6P079709; Thu, 12 Aug 2004 23:11:38 +0300 (EEST) (envelope-from ru) Date: Thu, 12 Aug 2004 23:11:38 +0300 From: Ruslan Ermilov To: "Conrad J. Sabatier" Message-ID: <20040812201138.GA79664@ip.net.ua> References: <20040812195252.GA79364@ip.net.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BXVAT5kNtrzKuDFl" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new cc: freebsd-current@freebsd.org Subject: Re: builworld fails if debugging enabled in usr.sbin/pkg_install/lib X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Aug 2004 20:11:52 -0000 --BXVAT5kNtrzKuDFl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 12, 2004 at 02:58:23PM -0500, Conrad J. Sabatier wrote: >=20 > On 12-Aug-2004 Ruslan Ermilov wrote: > > On Thu, Aug 12, 2004 at 02:41:37PM -0500, Conrad J. Sabatier wrote: > >> To help in debugging a problem with news/pan2, I decided to try > >> rebuilding the port and all of its dependencies with debugging > >> enabled. > >> Then I decided to go ahead and do the same with the base system.=20 > >> The > >> buildworld with "-g" worked fine with one exception: > >>=20 > >> cc -O2 -pipe -march=3Dathlon64 -m64 -g 1 -Wsystem-headers -Wall > >> -Wno-format-y2k -W -Wstrict-prototypes -Wmissing-prototypes > >> -Wpointer-arith -Wno-uninitialized -Wformat=3D2 -Wno-format-extra-args > >> -c > >> /usr/src/usr.sbin/pkg_install/lib/file.c > >> cc: 1: No such file or directory > >> *** Error code 1 > >>=20 > >> Stop in /usr/src/usr.sbin/pkg_install/lib. > >>=20 > >> I can't figure out where this "1" just after the "-g" switch is > >> coming > >> from. Without "-g", the compile works OK: > >>=20 > >> cc -O2 -pipe -march=3Dathlon64 -m64 -Wsystem-headers -Wall > >> -Wno-format-y2k -W -Wstrict-prototypes -Wmissing-prototypes > >> -Wpointer-arith -Wno-uninitialized -Wformat=3D2 -Wno-format-extra-args > >> -c > >> /usr/src/usr.sbin/pkg_install/lib/file.c > >>=20 > >> Strange. > >>=20 > > How are you building your world with -g? >=20 > I have the following in /etc/make.conf: >=20 > .if defined(DEBUG) > CFLAGS+=3D-g > .endif >=20 > And then use "make -DDEBUG buildworld". >=20 I suspected something like this. src/usr.sbin/pkg_install/*/Makefile's added the contents of the DEBUG variable to CFLAGS. By passing the -DDEBUG to make(1), you effectively set the value of the DEBUG variable to 1 (see the make(1) manpage), so "1" was added to CFLAGS. I've "fixed" these makefiles to not add DEBUG to CFLAGS. Note that the name DEBUG is unsafe to use anyway. Also, there's an alternative and standard way to recompile your programs and libraries with -g: there's the DEBUG_FLAGS variable, so you could as well do it like this: make buildworld DEBUG_FLAGS=3D-g Passing DEBUG_FLAGS=3D-g to ``make installworld'' will also cause the binaries to *not* be stripped when installing, which is essential for having the debugger symbols in binaries. Please consider switching to this method of building world with debug infomation. Cheers, --=20 Ruslan Ermilov ru@FreeBSD.org FreeBSD committer --BXVAT5kNtrzKuDFl Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFBG876qRfpzJluFF4RAsrQAJ9iLuyTpwtUqsh9Fxla4QBkTY+3gACeKXuK 0ajVk3ztUCiT+FSw3W2XjGc= =rqvP -----END PGP SIGNATURE----- --BXVAT5kNtrzKuDFl--