unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Installing gcc debugging symbols?
@ 2020-09-30 16:52 Simon South
  2020-10-01 12:10 ` Simon South
  0 siblings, 1 reply; 3+ messages in thread
From: Simon South @ 2020-09-30 16:52 UTC (permalink / raw)
  To: help-guix

Is there a way to install debugging information for gcc, as one can for
glibc and other packages?

I'm trying to test a change to Knot 3.0.0 and have found that gcc takes
forever to finish linking (and usually crashes from running out of
memory) when building the package using "guix build knot". Meanwhile, if
I build the source "manually", from within "guix environment --pure
knot", everything works fine.

I'd like to diagnose this but connecting to the running gcc instance
using gdb doesn't reveal much without gcc's debugging information
available.

I've tried "guix install gcc-toolchain@7.5:debug" but that installs
debugging information for only glibc.

I could edit gnu/packages/gcc.scm to set the "stripped?" variable to
false and rebuild gcc so its debugging symbols are preserved, but then
it's not clear how to install them. It seems I can build and install gcc
itself with

  guix package --install-from-expression='(@ (gnu packages gcc) gcc-7)'

but what I really want is

  guix package --install-from-expression='(@ (gnu packages gcc) (list gcc-7 "debug"))'

This fails with a syntax error, however, and I see the documentation for
"guix package" says

   Note that this option installs the first output of the specified
   package, which may be insufficient when needing a specific output of
   a multiple-output package.

Is there a trick to making this work?

-- 
Simon South
simon@simonsouth.net


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Installing gcc debugging symbols?
  2020-09-30 16:52 Installing gcc debugging symbols? Simon South
@ 2020-10-01 12:10 ` Simon South
  2020-10-21 22:01   ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Simon South @ 2020-10-01 12:10 UTC (permalink / raw)
  To: help-guix

Simon South <simon@simonsouth.net> writes:
> I could edit gnu/packages/gcc.scm to set the "stripped?" variable to
> false...

Of course if you're willing to make this change, you can just as easily
remove the "hidden-package" wrapper around gcc 4.7's package definition
and then install the debug symbols in the usual manner, i.e. with

  ./pre-inst-env guix install gcc@7.5:debug

At least, I assume this is going to work.

Still, I wonder if there is a more "official" method that involves less
hackery.

-- 
Simon South
simon@simonsouth.net


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Installing gcc debugging symbols?
  2020-10-01 12:10 ` Simon South
@ 2020-10-21 22:01   ` Ludovic Courtès
  0 siblings, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2020-10-21 22:01 UTC (permalink / raw)
  To: Simon South; +Cc: help-guix

Hi,

Simon South <simon@simonsouth.net> skribis:

> Simon South <simon@simonsouth.net> writes:
>> I could edit gnu/packages/gcc.scm to set the "stripped?" variable to
>> false...
>
> Of course if you're willing to make this change, you can just as easily
> remove the "hidden-package" wrapper around gcc 4.7's package definition
> and then install the debug symbols in the usual manner, i.e. with
>
>   ./pre-inst-env guix install gcc@7.5:debug
>
> At least, I assume this is going to work.
>
> Still, I wonder if there is a more "official" method that involves less
> hackery.

I’m afraid there’s no better method currently.  The new
‘--with-debug-info’ option wouldn’t help here since it’s compiled with
-g0 unless ‘stripped?’ is changed to #f.

We should make ‘stripped?’ a parameter somehow.

Ludo’.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-10-21 22:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-30 16:52 Installing gcc debugging symbols? Simon South
2020-10-01 12:10 ` Simon South
2020-10-21 22:01   ` Ludovic Courtès

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).