public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Enabling debugging symbols only for specific packages
@ 2011-01-10 18:11 Nikos Chantziaras
  2011-01-10 19:28 ` Mike Edenfield
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Nikos Chantziaras @ 2011-01-10 18:11 UTC (permalink / raw
  To: gentoo-user

Is there a way to enable debugging symbols only for some packages?  I 
need to do that for about 15 packages.  Currently, all I can do is edit 
make.conf all the time when emerging one of those and add "-g" to CFLAGS 
and "splitdebug" to FEATURES.  But I *always* forget about it the first 
time, ending up building twice.

Before anyone replies about enabling the "debug" USE flag on those 
package: No.  This is not what this USE flag is there for.




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

* Re: [gentoo-user] Enabling debugging symbols only for specific packages
  2011-01-10 18:11 [gentoo-user] Enabling debugging symbols only for specific packages Nikos Chantziaras
@ 2011-01-10 19:28 ` Mike Edenfield
  2011-01-10 22:43   ` [gentoo-user] " Nikos Chantziaras
  2011-01-10 19:54 ` Hartmut Figge
  2011-01-10 20:29 ` [gentoo-user] " Alex Schuster
  2 siblings, 1 reply; 8+ messages in thread
From: Mike Edenfield @ 2011-01-10 19:28 UTC (permalink / raw
  To: gentoo-user; +Cc: Nikos Chantziaras

On 1/10/2011 1:11 PM, Nikos Chantziaras wrote:
> Is there a way to enable debugging symbols only for some packages?  I
> need to do that for about 15 packages.  Currently, all I can do is edit
> make.conf all the time when emerging one of those and add "-g" to CFLAGS
> and "splitdebug" to FEATURES.  But I *always* forget about it the first
> time, ending up building twice.

I think you can drop a file in /etc/portage/env for these packages to
change the variables, something like:

/etc/portage/env/sys-apps/portage/bashrc:
	FEATURES="${FEATURES} splitdebug"
	CFLAGS="${CFLAGS} -g"




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

* [gentoo-user] Re: Enabling debugging symbols only for specific packages
  2011-01-10 18:11 [gentoo-user] Enabling debugging symbols only for specific packages Nikos Chantziaras
  2011-01-10 19:28 ` Mike Edenfield
@ 2011-01-10 19:54 ` Hartmut Figge
  2011-01-10 22:44   ` Nikos Chantziaras
  2011-01-10 20:29 ` [gentoo-user] " Alex Schuster
  2 siblings, 1 reply; 8+ messages in thread
From: Hartmut Figge @ 2011-01-10 19:54 UTC (permalink / raw
  To: gentoo-user

Nikos Chantziaras:

> Is there a way to enable debugging symbols only for some packages?  I 
> need to do that for about 15 packages.  Currently, all I can do is edit 
> make.conf all the time when emerging one of those and add "-g" to CFLAGS 
> and "splitdebug" to FEATURES.  But I *always* forget about it the first 
> time, ending up building twice.

*g*

I would probably do it this way. Having a make.conf-normal and a
make.conf-special and a file containing the names of the 15 packages.

Then an executable shell script with the name emerge in /usr/local/bin
with /usr/local/bin in the path before /usr/bin and in this script:

- test if the package to emerge is in the file
- if so, copy make.conf-special to make.conf else copy make.conf-normal
to make.conf.
- then execute /usr/bin/emerge for the package to emerge

But you have to avoid running multiple emerge at the same time. ;)

Hartmut
-- 
Notwendig, weil hier meine privaten Patche fehlen




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

* Re: [gentoo-user] Enabling debugging symbols only for specific packages
  2011-01-10 18:11 [gentoo-user] Enabling debugging symbols only for specific packages Nikos Chantziaras
  2011-01-10 19:28 ` Mike Edenfield
  2011-01-10 19:54 ` Hartmut Figge
@ 2011-01-10 20:29 ` Alex Schuster
  2011-01-10 22:59   ` [gentoo-user] " Nikos Chantziaras
  2 siblings, 1 reply; 8+ messages in thread
From: Alex Schuster @ 2011-01-10 20:29 UTC (permalink / raw
  To: gentoo-user

Nikos Chantziaras writes:

> Is there a way to enable debugging symbols only for some packages?  I 
> need to do that for about 15 packages.  Currently, all I can do is edit 
> make.conf all the time when emerging one of those and add "-g" to CFLAGS 
> and "splitdebug" to FEATURES.  But I *always* forget about it the first 
> time, ending up building twice.

This is possible. I have the problem that older GCCs do not know about
the -march=k8-sse3 CFLAG, so I had to change this to build them. So, I
created the file /etc/portage/env/sys-devel/gcc:3.4, containing this:

  touch /tmp/package.env-gcc:3.4
  CFLAGS="-march=k8"
  CXXFLAGS=$CFLAGS

The files can contain any bash code. I added the touch comand in order
to verify that this code is actually being used. You could put this
inside there:

  CFLAGS="$CFLAGS -g"
  CXXFLAGS=$CFLAGS
  FEATURES="$FEATURES splitdebug"

This seems to work for me. The portage man page has some info about
this, it also mentions /etc/portage/package.env containing lines like
  <category>/<package> <conffile>
with <file> being /etc/portage/env/<conffile>. It suggests to use this
instead of my approach I described above. I did not use this yet, I
assume it should be used when making generic changes for a package, but
as I want the change not for all GCCs, but only for certain slots, I use
the method I described.

I'm using portage-2.2 BTW.

	Wonko



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

* [gentoo-user] Re: Enabling debugging symbols only for specific packages
  2011-01-10 19:28 ` Mike Edenfield
@ 2011-01-10 22:43   ` Nikos Chantziaras
  0 siblings, 0 replies; 8+ messages in thread
From: Nikos Chantziaras @ 2011-01-10 22:43 UTC (permalink / raw
  To: gentoo-user

On 01/10/2011 09:28 PM, Mike Edenfield wrote:
> On 1/10/2011 1:11 PM, Nikos Chantziaras wrote:
>> Is there a way to enable debugging symbols only for some packages?  I
>> need to do that for about 15 packages.  Currently, all I can do is edit
>> make.conf all the time when emerging one of those and add "-g" to CFLAGS
>> and "splitdebug" to FEATURES.  But I *always* forget about it the first
>> time, ending up building twice.
>
> I think you can drop a file in /etc/portage/env for these packages to
> change the variables, something like:
>
> /etc/portage/env/sys-apps/portage/bashrc:
> 	FEATURES="${FEATURES} splitdebug"
> 	CFLAGS="${CFLAGS} -g"

Doesn't seem to work.  When emerging, I get:

/usr/lib64/portage/bin/ebuild.sh: line 1676: source: 
/etc/portage/env/sys-apps/portage: is a directory




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

* [gentoo-user] Re: Enabling debugging symbols only for specific packages
  2011-01-10 19:54 ` Hartmut Figge
@ 2011-01-10 22:44   ` Nikos Chantziaras
  0 siblings, 0 replies; 8+ messages in thread
From: Nikos Chantziaras @ 2011-01-10 22:44 UTC (permalink / raw
  To: gentoo-user

On 01/10/2011 09:54 PM, Hartmut Figge wrote:
> Nikos Chantziaras:
>
>> Is there a way to enable debugging symbols only for some packages?  I
>> need to do that for about 15 packages.  Currently, all I can do is edit
>> make.conf all the time when emerging one of those and add "-g" to CFLAGS
>> and "splitdebug" to FEATURES.  But I *always* forget about it the first
>> time, ending up building twice.
>
> *g*
>
> I would probably do it this way. Having a make.conf-normal and a
> make.conf-special and a file containing the names of the 15 packages.
>
> Then an executable shell script with the name emerge in /usr/local/bin
> with /usr/local/bin in the path before /usr/bin and in this script:
>
> - test if the package to emerge is in the file
> - if so, copy make.conf-special to make.conf else copy make.conf-normal
> to make.conf.
> - then execute /usr/bin/emerge for the package to emerge
>
> But you have to avoid running multiple emerge at the same time. ;)

This won't help with emerge -u world, which is my primary concern.




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

* [gentoo-user] Re: Enabling debugging symbols only for specific packages
  2011-01-10 20:29 ` [gentoo-user] " Alex Schuster
@ 2011-01-10 22:59   ` Nikos Chantziaras
  2011-01-10 23:12     ` Nikos Chantziaras
  0 siblings, 1 reply; 8+ messages in thread
From: Nikos Chantziaras @ 2011-01-10 22:59 UTC (permalink / raw
  To: gentoo-user

On 01/10/2011 10:29 PM, Alex Schuster wrote:
> Nikos Chantziaras writes:
>
>> Is there a way to enable debugging symbols only for some packages?  I
>> need to do that for about 15 packages.  Currently, all I can do is edit
>> make.conf all the time when emerging one of those and add "-g" to CFLAGS
>> and "splitdebug" to FEATURES.  But I *always* forget about it the first
>> time, ending up building twice.
>
> This is possible. I have the problem that older GCCs do not know about
> the -march=k8-sse3 CFLAG, so I had to change this to build them. So, I
> created the file /etc/portage/env/sys-devel/gcc:3.4, containing this:
>
>    touch /tmp/package.env-gcc:3.4
>    CFLAGS="-march=k8"
>    CXXFLAGS=$CFLAGS
>
> The files can contain any bash code. I added the touch comand in order
> to verify that this code is actually being used. You could put this
> inside there:
>
>    CFLAGS="$CFLAGS -g"
>    CXXFLAGS=$CFLAGS
>    FEATURES="$FEATURES splitdebug"
>
> This seems to work for me.

Seems to work here too.  Though it seems to be sourced four times.  The 
packages are being compiled with "-g -g -g -g" :P  But in this case it 
doesn't harm anything.


> The portage man page has some info about
> this, it also mentions /etc/portage/package.env containing lines like
>    <category>/<package>  <conffile>
> with<file>  being /etc/portage/env/<conffile>. It suggests to use this
> instead of my approach I described above. I did not use this yet, I
> assume it should be used when making generic changes for a package, but
> as I want the change not for all GCCs, but only for certain slots, I use
> the method I described.

Thanks for the pointer.  It looks like this is even better since you 
only need one file to deal with.


> I'm using portage-2.2 BTW.

2.1 here.




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

* [gentoo-user] Re: Enabling debugging symbols only for specific packages
  2011-01-10 22:59   ` [gentoo-user] " Nikos Chantziaras
@ 2011-01-10 23:12     ` Nikos Chantziaras
  0 siblings, 0 replies; 8+ messages in thread
From: Nikos Chantziaras @ 2011-01-10 23:12 UTC (permalink / raw
  To: gentoo-user

On 01/11/2011 12:59 AM, Nikos Chantziaras wrote:
> On 01/10/2011 10:29 PM, Alex Schuster wrote:
>[...]
>> The portage man page has some info about
>> this, it also mentions /etc/portage/package.env containing lines like
>> <category>/<package> <conffile>
>> with<file> being /etc/portage/env/<conffile>. It suggests to use this
>> instead of my approach I described above. I did not use this yet, I
>> assume it should be used when making generic changes for a package, but
>> as I want the change not for all GCCs, but only for certain slots, I use
>> the method I described.
>
> Thanks for the pointer. It looks like this is even better since you only
> need one file to deal with.

OK, just tried that.  Works perfectly and without the "-g -g -g -g" glitch.

Thanks everyone for the responses :-)




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

end of thread, other threads:[~2011-01-11  0:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-10 18:11 [gentoo-user] Enabling debugging symbols only for specific packages Nikos Chantziaras
2011-01-10 19:28 ` Mike Edenfield
2011-01-10 22:43   ` [gentoo-user] " Nikos Chantziaras
2011-01-10 19:54 ` Hartmut Figge
2011-01-10 22:44   ` Nikos Chantziaras
2011-01-10 20:29 ` [gentoo-user] " Alex Schuster
2011-01-10 22:59   ` [gentoo-user] " Nikos Chantziaras
2011-01-10 23:12     ` Nikos Chantziaras

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox