FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 01-10-2011, 06:28 PM
Mike Edenfield
 
Default Enabling debugging symbols only for specific packages

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"
 
Old 01-10-2011, 06:54 PM
Hartmut Figge
 
Default Enabling debugging symbols only for specific packages

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
 
Old 01-10-2011, 07:29 PM
Alex Schuster
 
Default Enabling debugging symbols only for specific packages

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
 
Old 01-10-2011, 09:43 PM
Nikos Chantziaras
 
Default Enabling debugging symbols only for specific packages

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
 
Old 01-10-2011, 09:44 PM
Nikos Chantziaras
 
Default Enabling debugging symbols only for specific packages

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.
 
Old 01-10-2011, 09:59 PM
Nikos Chantziaras
 
Default Enabling debugging symbols only for specific packages

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.
 
Old 01-10-2011, 10:12 PM
Nikos Chantziaras
 
Default Enabling debugging symbols only for specific packages

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 :-)
 

Thread Tools




All times are GMT. The time now is 07:46 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org