* python config question
@ 2010-03-02 0:37 Michael Snyder
2010-03-02 5:22 ` Joel Brobecker
0 siblings, 1 reply; 9+ messages in thread
From: Michael Snyder @ 2010-03-02 0:37 UTC (permalink / raw)
To: gdb
Question about --with-python=$PATH.
If I have python version X installed "natively" on my build machine
(eg. at /usr/lib/libpython.*), and version Y installed somewhere else
(eg. at $PYPATH), and I tell configure that I want to use the one at
$PYPATH, eg.
configure --with-python=$PYPATH
Shouldn't I expect gdb to be linked against python version Y?
That doesn't seem to be what happens, in fact "ldd" tells me
that gdb wants to use version X at /usr/lib/libpython*.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: python config question
2010-03-02 0:37 python config question Michael Snyder
@ 2010-03-02 5:22 ` Joel Brobecker
2010-03-02 18:11 ` Michael Snyder
0 siblings, 1 reply; 9+ messages in thread
From: Joel Brobecker @ 2010-03-02 5:22 UTC (permalink / raw)
To: Michael Snyder; +Cc: gdb
> configure --with-python=$PYPATH
>
> Shouldn't I expect gdb to be linked against python version Y?
I would think so. But from what I can tell by looking at the configury,
I think that your GDB was in fact linked against the Python install
that you provided (using -L${with_python}/lib in the link command).
However, your loader is selecting the libpython in your default install
because it does not know about you local one. You have several solutions
to fix this, typical ones being: use th rpath during the link, or
add your python install lib dir to LD_LIBRARY_PATH, for instance.
--
Joel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: python config question
2010-03-02 5:22 ` Joel Brobecker
@ 2010-03-02 18:11 ` Michael Snyder
2010-03-03 4:51 ` Joel Brobecker
0 siblings, 1 reply; 9+ messages in thread
From: Michael Snyder @ 2010-03-02 18:11 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb
Joel Brobecker wrote:
>> configure --with-python=$PYPATH
>>
>> Shouldn't I expect gdb to be linked against python version Y?
>
> I would think so. But from what I can tell by looking at the configury,
> I think that your GDB was in fact linked against the Python install
> that you provided (using -L${with_python}/lib in the link command).
> However, your loader is selecting the libpython in your default install
> because it does not know about you local one. You have several solutions
> to fix this, typical ones being: use th rpath during the link, or
> add your python install lib dir to LD_LIBRARY_PATH, for instance.
>
Maybe the configure option should include rpath?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: python config question
2010-03-02 18:11 ` Michael Snyder
@ 2010-03-03 4:51 ` Joel Brobecker
2010-03-03 9:21 ` Jan Kratochvil
0 siblings, 1 reply; 9+ messages in thread
From: Joel Brobecker @ 2010-03-03 4:51 UTC (permalink / raw)
To: Michael Snyder; +Cc: gdb
> Maybe the configure option should include rpath?
It could. We're touching at something that is very platform-dependent,
though - perhaps you want to look at using libtool (although I'll admit
to a severe aversion to this tool, probably unjustified). If I were in
your position, I might consider linking statically against libpython.
At AdaCore, the plan is to use LD_LIBRARY_PATH, which we'll have to do,
since customers are free to install the binary package wherever they
want (hence preventing rpath from working).
--
Joel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: python config question
2010-03-03 4:51 ` Joel Brobecker
@ 2010-03-03 9:21 ` Jan Kratochvil
2010-03-03 9:46 ` Joel Brobecker
2010-03-03 15:29 ` Daniel Jacobowitz
0 siblings, 2 replies; 9+ messages in thread
From: Jan Kratochvil @ 2010-03-03 9:21 UTC (permalink / raw)
To: Joel Brobecker; +Cc: Michael Snyder, gdb
On Wed, 03 Mar 2010 05:50:39 +0100, Joel Brobecker wrote:
> > Maybe the configure option should include rpath?
>
> It could. We're touching at something that is very platform-dependent,
> though - perhaps you want to look at using libtool (although I'll admit
> to a severe aversion to this tool, probably unjustified). If I were in
> your position, I might consider linking statically against libpython.
> At AdaCore, the plan is to use LD_LIBRARY_PATH, which we'll have to do,
> since customers are free to install the binary package wherever they
> want (hence preventing rpath from working).
IIUC you ship libpython*.so.* libraries bundled with the shipped gdb.
Isn't ld.so's $ORIGIN useful?
$ORIGIN and rpath
ld.so understands the string $ORIGIN (or equivalently ${ORIGIN}) in an
rpath specification (DT_RPATH or DT_RUNPATH) to mean the directory
containing the application executable. Thus, an application located
in somedir/app could be compiled with gcc -Wl,-rpath,'$ORIGIN/../lib'
so that it finds an associated shared library in somedir/lib no matter
where somedir is located in the directory hierarchy. This facilitates
the creation of "turn-key" applications that do not need to be
installed into special directories, but can instead be unpacked into
any directory and still find their own shared libraries.
Regards,
Jan
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: python config question
2010-03-03 9:21 ` Jan Kratochvil
@ 2010-03-03 9:46 ` Joel Brobecker
2010-03-03 15:29 ` Daniel Jacobowitz
1 sibling, 0 replies; 9+ messages in thread
From: Joel Brobecker @ 2010-03-03 9:46 UTC (permalink / raw)
To: Jan Kratochvil; +Cc: Michael Snyder, gdb
> IIUC you ship libpython*.so.* libraries bundled with the shipped gdb.
> Isn't ld.so's $ORIGIN useful?
Yep - very useful (in fact, I had forgotten about this already).
I just wanted to give Michael some of the standard options to deal
with his situation...
--
Joel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: python config question
2010-03-03 9:21 ` Jan Kratochvil
2010-03-03 9:46 ` Joel Brobecker
@ 2010-03-03 15:29 ` Daniel Jacobowitz
2010-03-03 17:46 ` Michael Snyder
1 sibling, 1 reply; 9+ messages in thread
From: Daniel Jacobowitz @ 2010-03-03 15:29 UTC (permalink / raw)
To: Jan Kratochvil; +Cc: Joel Brobecker, Michael Snyder, gdb
On Wed, Mar 03, 2010 at 10:20:47AM +0100, Jan Kratochvil wrote:
> IIUC you ship libpython*.so.* libraries bundled with the shipped gdb.
> Isn't ld.so's $ORIGIN useful?
>
> $ORIGIN and rpath
FYI, this is how we do it, and part of why I don't think automatic
-rpath is a good idea.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: python config question
2010-03-03 15:29 ` Daniel Jacobowitz
@ 2010-03-03 17:46 ` Michael Snyder
2010-03-03 17:53 ` Daniel Jacobowitz
0 siblings, 1 reply; 9+ messages in thread
From: Michael Snyder @ 2010-03-03 17:46 UTC (permalink / raw)
To: Jan Kratochvil, Joel Brobecker, Michael Snyder, gdb
Daniel Jacobowitz wrote:
> On Wed, Mar 03, 2010 at 10:20:47AM +0100, Jan Kratochvil wrote:
>> IIUC you ship libpython*.so.* libraries bundled with the shipped gdb.
>> Isn't ld.so's $ORIGIN useful?
>>
>> $ORIGIN and rpath
>
> FYI, this is how we do it, and part of why I don't think automatic
> -rpath is a good idea.
You're saying that you ship the python library, install it in the
same directory as gdb, and get the runtime loader to look for it there?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: python config question
2010-03-03 17:46 ` Michael Snyder
@ 2010-03-03 17:53 ` Daniel Jacobowitz
0 siblings, 0 replies; 9+ messages in thread
From: Daniel Jacobowitz @ 2010-03-03 17:53 UTC (permalink / raw)
To: Michael Snyder; +Cc: Jan Kratochvil, Joel Brobecker, gdb
On Wed, Mar 03, 2010 at 09:46:12AM -0800, Michael Snyder wrote:
> You're saying that you ship the python library, install it in the
> same directory as gdb, and get the runtime loader to look for it there?
It goes in $ORIGIN/../lib/ actually, but yes.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2010-03-03 17:53 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-02 0:37 python config question Michael Snyder
2010-03-02 5:22 ` Joel Brobecker
2010-03-02 18:11 ` Michael Snyder
2010-03-03 4:51 ` Joel Brobecker
2010-03-03 9:21 ` Jan Kratochvil
2010-03-03 9:46 ` Joel Brobecker
2010-03-03 15:29 ` Daniel Jacobowitz
2010-03-03 17:46 ` Michael Snyder
2010-03-03 17:53 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox