From owner-freebsd-hackers@FreeBSD.ORG Thu Jul 17 01:06:45 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7638106564A for ; Thu, 17 Jul 2008 01:06:45 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.delphij.net (delphij-pt.tunnel.tserv2.fmt.ipv6.he.net [IPv6:2001:470:1f03:2c9::2]) by mx1.freebsd.org (Postfix) with ESMTP id 448BC8FC08 for ; Thu, 17 Jul 2008 01:06:45 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [211.166.10.233]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.delphij.net (Postfix) with ESMTPS id 01DB728448 for ; Thu, 17 Jul 2008 09:06:44 +0800 (CST) Received: from localhost (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id B93A3EB6BF0; Thu, 17 Jul 2008 09:06:43 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by localhost (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with ESMTP id 4-SrbWGcF6rj; Thu, 17 Jul 2008 09:06:38 +0800 (CST) Received: from charlie.delphij.net (71.5.7.139.ptr.us.xo.net [71.5.7.139]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id AEAAEEB0E56; Thu, 17 Jul 2008 09:06:36 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=aYT8c/AaWNSQV2S7ge+8e/byXT7Wgsd3+LuYQJWIgW+bbXXpc605mysgvZnpfX6+C XMvK6vbgcdIDPuhWabDdQ== Message-ID: <487E9B1A.4040809@delphij.net> Date: Wed, 16 Jul 2008 18:06:34 -0700 From: Xin LI Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.14 (X11/20080616) MIME-Version: 1.0 To: xorquewasp@googlemail.com References: <20080716234933.GA85290@logik.internal.network> <487E9466.5010701@delphij.net> <20080717005548.GA51632@logik.internal.network> In-Reply-To: <20080717005548.GA51632@logik.internal.network> X-Enigmail-Version: 0.95.6 OpenPGP: id=18EDEBA0; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, d@delphij.net Subject: Re: do not strip, compile with debugging symbols X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2008 01:06:45 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 xorquewasp@googlemail.com wrote: | On 20080716 17:37:58, Xin LI wrote: |> -----BEGIN PGP SIGNED MESSAGE----- |> Hash: SHA1 |> |> xorquewasp@googlemail.com wrote: |> | Hello. |> | |> | What's the correct way to ensure that ports are built with '-g' |> | and that binaries/libraries created are not stripped? I'm assuming |> | the first one involves setting CFLAGS in /etc/make.conf (admittedly, |> | it's apparently not supported but I'm not building world with this |> | setting anyway). |> | |> | The second, I'm not so sure about. I thought I'd heard of a NO_STRIP |> | setting but if it exists, it's not documented. |> |> I think the setting is spelled as 'WITH_DEBUG=yes' which will add '-g' |> and remove stripping. However, it still depends on the ported software |> whether they will strip, most times they will obey the settings (if not |> then it's a bug that should have fixed anyway). | | Hi. | | Yes, that does seem to work. The only problem is that it also disables | any optimization flags (I was hoping to compile with -O2 -g as I don't | need to do in-depth debugging, just have decent stack traces). | | I tried setting CFLAGS to '-O2' but WITH_DEBUG seems to override this, | too. Maybe you want DEBUG_FLAGS='-O2 -pipe -fno-strict-aliasing -g'? - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEARECAAYFAkh+mxoACgkQi+vbBBjt66B/fgCgrenfepYZBy4Hd5zLFCvXv7OF 6J4AnR6O9WqnIMegrp5INv1LdXavYjba =wyq3 -----END PGP SIGNATURE-----