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 05-24-2008, 10:29 AM
dhk
 
Default Setting CFLAGS for a single build

I did the build the non-persistent way and ran my program with the
debugger. When I got to the breakpoint for the the library function it
says "no line number". See the following from gdb.


3271 pobj=xmlXPathEvalExpression(tag, pctx);
(gdb)

Breakpoint 3, 0x00002ab4493e4480 in xmlXPathEvalExpression ()
from /usr/lib/libxml2.so.2
(gdb)
Single stepping until exit from function xmlXPathEvalExpression,
which has no line number information.

Does this mean the source was removed after the emerge? If so how can I
keep the source.


Also I like the idea of using "/etc/portage/env/category/package" but
I'm not sure what to do since I don't have the env directory. Would I
just do a mkdir -p /etc/portage/env/dev-libs/ and create a file called
libxml2 with CFLAGS="$CFLAGS -g2" in it?


Thanks all,

Dave




Sebastian Magri wrote:

You can use the "/etc/portage/env/category/package" to declare environment
variables for specific packages...

2008/5/25 Erik Ruotsalainen <aegis@kapsi.fi>:


On Sat, May 24, 2008 at 10:02:50AM +0000, dhk wrote:

How can I modify the CFLAGS before emerging a package? I want to add
-g2 to the compile of libxml2 so I can step through their functions. If
I add -g2 to CFLAGS in make.conf it will do it for all packages which is
not what I want.

Thanks,

Dave
--
gentoo-user@lists.gentoo.org mailing list


Same way as with USE flags, I think.

# CFLAGS="-g2" emerge libxml2

- aegis
--
gentoo-user@lists.gentoo.org mailing list







--
gentoo-user@lists.gentoo.org mailing list
 
Old 05-24-2008, 02:38 PM
"Sebastian Magri"
 
Default Setting CFLAGS for a single build

Yes, it's a way to do it, also you can create a file with the options as "/etc/portage/env/options" and then simlink to "/etc/portage/env/category/package"...

This way you will always emerge this package with the settings declared in the environment dir, it's also usefull so made some optimizations over especific packages without affect the rest of the system, or when a package needs especial values in environment variables as LC_ALL, i.e. ghc-6.8...


2008/5/25 dhk <dhkuhl@optonline.net>:

I did the build the non-persistent way and ran my program with the debugger. *When I got to the breakpoint for the the library function it says "no line number". See the following from gdb.



3271 * * *pobj=xmlXPathEvalExpression(tag, pctx);

(gdb)



Breakpoint 3, 0x00002ab4493e4480 in xmlXPathEvalExpression ()

* from /usr/lib/libxml2.so.2

(gdb)

Single stepping until exit from function xmlXPathEvalExpression,

which has no line number information.



Does this mean the source was removed after the emerge? *If so how can I keep the source.



Also I like the idea of using "/etc/portage/env/category/package" but I'm not sure what to do since I don't have the env directory. *Would I just do a mkdir -p /etc/portage/env/dev-libs/ and create a file called libxml2 with CFLAGS="$CFLAGS -g2" in it?




Thanks all,



Dave









Sebastian Magri wrote:


You can use the "/etc/portage/env/category/package" to declare environment

variables for specific packages...



2008/5/25 Erik Ruotsalainen <aegis@kapsi.fi>:




On Sat, May 24, 2008 at 10:02:50AM +0000, dhk wrote:


How can I modify the CFLAGS before emerging a package? *I want to add

-g2 to the compile of libxml2 so I can step through their functions. *If

I add -g2 to CFLAGS in make.conf it will do it for all packages which is

not what I want.



Thanks,



Dave

--

gentoo-user@lists.gentoo.org mailing list




Same way as with USE flags, I think.



# CFLAGS="-g2" emerge libxml2



- aegis

--

gentoo-user@lists.gentoo.org mailing list













--

gentoo-user@lists.gentoo.org mailing list





--
En el pasado creímos que se nos acababa
el petróleo, pero en realidad lo que se nos
acababan eran las IDEAS.
Gentoo/* (Linux #455615)
53:04:4e:b5:f9:7e:4a:fb:66:a2:19:12:da:d5:97:f8

8A3A C955 715D D88A 87CD E21F F827 ADD7 F589 B4A4
Sebastian Magri (sebasmagri) <sebasmagri@gmail.com>
 
Old 05-24-2008, 03:55 PM
Alan McKinnon
 
Default Setting CFLAGS for a single build

On Saturday 24 May 2008, Erik Ruotsalainen wrote:
> On Sat, May 24, 2008 at 10:02:50AM +0000, dhk wrote:
> > How can I modify the CFLAGS before emerging a package? I want to
> > add -g2 to the compile of libxml2 so I can step through their
> > functions. If I add -g2 to CFLAGS in make.conf it will do it for
> > all packages which is not what I want.
> >
> > Thanks,
> >
> > Dave
> > --
> > gentoo-user@lists.gentoo.org mailing list
>
> Same way as with USE flags, I think.
>
> # CFLAGS="-g2" emerge libxml2

This works, but is not recommended.

Portage will not remember those settings in a way that can be
duplicated, so the next time that package gets remerged (especially as
part of a deep update) it will be recompiled without the custom CFLAGS.

This is a serious blunder and non-trivial to detect and fix. It violates
the sacrosanct Law Of No Unexpected Side Effects


--
Alan McKinnon
alan dot mckinnon at gmail dot com

--
gentoo-user@lists.gentoo.org mailing list
 
Old 05-24-2008, 04:49 PM
"Sebastian Magri"
 
Default Setting CFLAGS for a single build

2008/5/25 Alan McKinnon <alan.mckinnon@gmail.com>:

On Saturday 24 May 2008, Erik Ruotsalainen wrote:

> On Sat, May 24, 2008 at 10:02:50AM +0000, dhk wrote:

> > How can I modify the CFLAGS before emerging a package? *I want to

> > add -g2 to the compile of libxml2 so I can step through their

> > functions. *If I add -g2 to CFLAGS in make.conf it will do it for

> > all packages which is not what I want.

> >

> > Thanks,

> >

> > Dave

> > --

> > gentoo-user@lists.gentoo.org mailing list

>

> Same way as with USE flags, I think.

>

> # CFLAGS="-g2" emerge libxml2



This works, but is not recommended.



Portage will not remember those settings in a way that can be

duplicated, so the next time that package gets remerged (especially as

part of a deep update) it will be recompiled without the custom CFLAGS.



This is a serious blunder and non-trivial to detect and fix. It violates

the sacrosanct Law Of No Unexpected Side Effects



Alan is rigth, the best practice is not to declare any environment variable or USE Flag before the emerge sentence, but use the configuration files in "/etc/portage"



--

Alan McKinnon

alan dot mckinnon at gmail dot com



--

gentoo-user@lists.gentoo.org mailing list





--
En el pasado creímos que se nos acababa
el petróleo, pero en realidad lo que se nos
acababan eran las IDEAS.
Gentoo/* (Linux #455615)
53:04:4e:b5:f9:7e:4a:fb:66:a2:19:12:da:d5:97:f8

8A3A C955 715D D88A 87CD E21F F827 ADD7 F589 B4A4
Sebastian Magri (sebasmagri) <sebasmagri@gmail.com>
 
Old 05-25-2008, 02:51 AM
maxim wexler
 
Default Setting CFLAGS for a single build

--- On Sun, 5/25/08, Sebastian Magri <sebasmagri@gmail.com> wrote:

> From: Sebastian Magri <sebasmagri@gmail.com>
> Subject: Re: [gentoo-user] Setting CFLAGS for a single build
> To: gentoo-user@lists.gentoo.org
> Date: Sunday, May 25, 2008, 1:49 AM
> 2008/5/25 Alan McKinnon <alan.mckinnon@gmail.com>:
>
> > On Saturday 24 May 2008, Erik Ruotsalainen wrote:
> > > On Sat, May 24, 2008 at 10:02:50AM +0000, dhk
> wrote:
> > > > How can I modify the CFLAGS before emerging
> a package? I want to
> > > > add -g2 to the compile of libxml2 so I can
> step through their
> > > > functions. If I add -g2 to CFLAGS in
> make.conf it will do it for
> > > > all packages which is not what I want.
> > > >
> > > > Thanks,
> > > >
> > > > Dave
> > > > --
> > > > gentoo-user@lists.gentoo.org mailing list
> > >
> > > Same way as with USE flags, I think.
> > >
> > > # CFLAGS="-g2" emerge libxml2
> >
> > This works, but is not recommended.
> >
> > Portage will not remember those settings in a way that
> can be
> > duplicated, so the next time that package gets
> remerged (especially as
> > part of a deep update) it will be recompiled without
> the custom CFLAGS.
> >
> > This is a serious blunder and non-trivial to detect
> and fix. It violates
> > the sacrosanct Law Of No Unexpected Side Effects
> >
> > Alan is rigth, the best practice is not to declare any
> environment variable
> or USE Flag before the emerge sentence, but use the
> configuration files in
> "/etc/portage"
>

Interesting discussion. I'm glad I peeked in.

Here's some more treatment:

http://gentoo-wiki.com/CflagsExceptions

-mw





--
gentoo-user@lists.gentoo.org mailing list
 
Old 05-27-2008, 01:40 PM
Alex Schuster
 
Default Setting CFLAGS for a single build

dhk writes:

> Does this mean the source was removed after the emerge? If so how can
> I keep the source.

Try adding "nostrip" to your FEATURES.

> Also I like the idea of using "/etc/portage/env/category/package" but
> I'm not sure what to do since I don't have the env directory. Would I
> just do a mkdir -p /etc/portage/env/dev-libs/ and create a file called
> libxml2 with CFLAGS="$CFLAGS -g2" in it?

I think so. This is new to me, too - I know about this /etc/portage/env/
stuff, but I thought it was only a suggestion, and that you have to
create a /etc/portage/bashrc by hand which evaluates stuff in there. But
it seems portage is already capable of that.

So, this should work:

CFLAGS="$CFLAGS -g2"
FEATURES="$FEATURES -nostrip"

Wonko
--
gentoo-user@lists.gentoo.org mailing list
 
Old 05-27-2008, 07:16 PM
 
Default Setting CFLAGS for a single build

I made the changes, but I still can't step into the libxml2 functions.* Not sure why.

Thanks,

Dave

----- Original Message -----
From: Alex Schuster
Date: Tuesday, May 27, 2008 9:40 am
Subject: Re: [gentoo-user] Setting CFLAGS*for a single build
To: gentoo-user@lists.gentoo.org

> dhk*writes:
>
> > Does this mean the source was removed after the emerge? If so
> how can
> > I keep the source.
>
> Try adding "nostrip" to your FEATURES.
>
> > Also I like the idea of using
> "/etc/portage/env/category/package" but
> > I'm not sure what to do since I don't have the env*directory.
> Would I
> > just do a mkdir*-p /etc/portage/env/dev-libs/ and create a
> file called
> > libxml2 with CFLAGS="$CFLAGS*-g2" in it?
>
> I think so. This is new to me, too - I know about this
> /etc/portage/env/
> stuff, but I thought it was only a suggestion, and that you have
> to
> create a /etc/portage/bashrc*by hand which evaluates stuff in
> there. But
> it seems portage is already capable of that.
>
> So, this should work:
>
> CFLAGS="$CFLAGS*-g2"
> FEATURES="$FEATURES -nostrip"
>
> Wonko
> --
> gentoo-user@lists.gentoo.org mailing list
>
>
 
Old 05-28-2008, 07:17 AM
dhk
 
Default Setting CFLAGS for a single build

I tried it, but I still can't step into the libxml2 library functions.

Thanks,

Dave

Alex Schuster wrote:

dhk writes:


Does this mean the source was removed after the emerge? If so how can
I keep the source.


Try adding "nostrip" to your FEATURES.


Also I like the idea of using "/etc/portage/env/category/package" but
I'm not sure what to do since I don't have the env directory. Would I
just do a mkdir -p /etc/portage/env/dev-libs/ and create a file called
libxml2 with CFLAGS="$CFLAGS -g2" in it?


I think so. This is new to me, too - I know about this /etc/portage/env/
stuff, but I thought it was only a suggestion, and that you have to
create a /etc/portage/bashrc by hand which evaluates stuff in there. But
it seems portage is already capable of that.


So, this should work:

CFLAGS="$CFLAGS -g2"
FEATURES="$FEATURES -nostrip"

Wonko


--
gentoo-user@lists.gentoo.org mailing list
 
Old 05-28-2008, 12:47 PM
Alex Schuster
 
Default Setting CFLAGS for a single build

dhk writes:

(Could you please stop top posting, and put your answers below the quoted
part, or, even better, between the parts you quote selectively? This
makes it easier to follow the discussion. Thanks!)

> I tried it, but I still can't step into the libxml2 library functions.

That's too bad.


> Alex Schuster wrote:
> > dhk writes:
> >> Does this mean the source was removed after the emerge? If so how
> >> can I keep the source.
> >
> > Try adding "nostrip" to your FEATURES.

Um, I meand -nostrip, as I wrote in the example below. But I just tried
for myself - I see the -g2 (multiple times), but after building,
stripping takes place, even with the one-time FEATURES=-nostrip emerge -1
libxml2 approach:

strip: i686-pc-linux-gnu-strip --strip-unneeded -R .comment
usr/lib/libxml2.so.2.6.31
usr/lib/python2.4/site-packages/libxml2mod.so
usr/bin/xmllint
usr/bin/xmlcatalog
usr/lib/libxml2.a
usr/lib/python2.4/site-packages/libxml2mod.a

You might want to have a look at
<http://www.gentoo.org/proj/en/qa/backtraces.xml>, this explains how to
get debug information. There is a splitdebug FEATURE which is better than
using nostrip.

But I still do not know why it doesn't work for you. I'd look at the
emerge output and check what happened to the libraries when they were
built, just after the "Completed installing" message.

Wonko
--
gentoo-user@lists.gentoo.org mailing list
 
Old 05-28-2008, 12:58 PM
Anthony Metcalf
 
Default Setting CFLAGS for a single build

Alex Schuster wrote:
Um, I meand -nostrip, as I wrote in the example below. But I just tried
for myself - I see the -g2 (multiple times), but after building,
stripping takes place, even with the one-time FEATURES=-nostrip emerge -1
libxml2 approach:



Emmm, FEATURES="nostrip" will not strip the binary, i.e. leave the
debugging info there.....FEATURES="-nostrip" will jnot, not strip the
binary, i.e it will strip the bianry, i.e. it will remove the debugging
info! The " marks are vital....

--
gentoo-user@lists.gentoo.org mailing list
 

Thread Tools




All times are GMT. The time now is 12:01 PM.

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