From owner-freebsd-hackers@FreeBSD.ORG Mon Dec 24 03:17:57 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DD84770A; Mon, 24 Dec 2012 03:17:57 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-oa0-f46.google.com (mail-oa0-f46.google.com [209.85.219.46]) by mx1.freebsd.org (Postfix) with ESMTP id 8B4D28FC13; Mon, 24 Dec 2012 03:17:57 +0000 (UTC) Received: by mail-oa0-f46.google.com with SMTP id h16so6445482oag.19 for ; Sun, 23 Dec 2012 19:17:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=tu3uOoQn7o5/xqV98hGGdwcgoxV6SsK1ev8S9IqYc6I=; b=vNyMdaqcixzsO0B4CdMjw8JwCnOST4XFFP4echdO4TOQ0sY/a8p4BnD/FHqngHXvlA yBWb7Rn66/e6BykJFS+GYaNHXBCZob/noECDmzGilRkg12H7zdpFBBfUCJfrkEXzrf3q v4sUaNz7IRRpzdZoCZQX4l14y00A3erELQrNa7uv8Ukz0XBIleHlp/8ZI0HD3TpGfXVX rry4eL2jLUmvXmmHxXIcgR26XE6+Vb/zc92utEnGkLiMgiJUbLz6gC8oCcBp8TDa78FJ 94Q9A166X/AV8TkZ8/aER6zwEDsPKo0JycC5JG/IdY9Gg8ahb9s8LTbUkRYZmBnkL7BN GVVA== MIME-Version: 1.0 Received: by 10.60.0.165 with SMTP id 5mr5439020oef.128.1356319071445; Sun, 23 Dec 2012 19:17:51 -0800 (PST) Received: by 10.76.143.33 with HTTP; Sun, 23 Dec 2012 19:17:50 -0800 (PST) In-Reply-To: <50D684D7.8050906@mu.org> References: <20121222164602.GB32022@sandvine.com> <1Tmb5f-000Jy5-CT@internal.tormail.org> <50D684D7.8050906@mu.org> Date: Sun, 23 Dec 2012 19:17:50 -0800 Message-ID: Subject: Re: [PATCH] Add WITH_DEBUG_FILES knob to enable separate debug files From: Garrett Cooper To: Alfred Perlstein Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-hackers@freebsd.org, Ed Maste , Jan Beich X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Dec 2012 03:17:57 -0000 On Sat, Dec 22, 2012 at 8:13 PM, Alfred Perlstein wrote: > On 12/22/12 6:14 PM, Jan Beich wrote: >> >> Ed Maste writes: >> >>> When this knob is set standalone debug files for shared objects are >>> built and installed in /usr/lib/debug/.debug. GDB >>> searches this path for debug data. >> >> [...] >> What about ports? They are not allowed to install outside of PREFIX. >> >> $ cd multimedia/cuse4bsd-kmod >> $ make install PREFIX=/tmp/aaa PKG_DBDIR=/tmp/pkg WITH_DEBUG= >> [...] >> install -C -o root -g wheel -m 444 libcuse4bsd.a /tmp/aaa/lib >> install -s -o root -g wheel -m 444 libcuse4bsd.so.1 /tmp/aaa/lib >> install -o root -g wheel -m 444 libcuse4bsd.so.1.debug >> /usr/lib/debug/tmp/aaa/lib >> install: /usr/lib/debug/tmp/aaa/lib: No such file or directory >> *** [_libinstall] Error code 71 > > I have a patch for this. I am building world to see what happens, if you > want to try it, or comment on it, please let me know. > > Changes are: > base DEBUGDIR on LIBDIR for ports > create intermediate directories for debug objs. One thing about this (and the original patch) that may or may not make sense is that DEBUGDIR should be undefined and passed in via CFLAGS in the Makefile (reason being is that it would reduce duplication IMO and it's less duplicated magic juju hanging around some gdb header files). Another thing that might be a good idea is that the changes in bsd.lib.mk diverge from standard expectations for the file extension (.symbols -> .debug), so at the very least this should be documented. Finally, what about debug symbols for programs (bsd.prog.mk)? I assume that's coming soon, but I figured I should ask :). Thanks! -Garrett PS Awesome solution for the ports issue :).