* how to build gdb-7.1 --with-python?
@ 2010-06-25 15:40 Steffen Dettmer
2010-06-25 17:13 ` Tom Tromey
0 siblings, 1 reply; 3+ messages in thread
From: Steffen Dettmer @ 2010-06-25 15:40 UTC (permalink / raw)
To: gdb
Hi,
I would like to play with gdb's Python support.
Usually I don't have problems with installing GNU software, but
here I encountered issues suggesting me that I'm doing something
weird or have something broken, missed or missunderstood.
I googled, but did not find installation instructions. gdb/README
just states `--with-python', so I though it would be easy, as
soon as I upgraded my Python. So from python.org I grabbed 2.5
and installed it (default configure options). I noticed that
"make test" hung (0% CPU) in some thread test. Hoped not to need
it and installed anyway.
Went back to gdb builddir and used:
../configure --with-python --target=arm-elf --disable-werror
--disable-expat --with-expat=no
Worked. Ran make. Failed after a while with:
checking for python2.5... no
checking for python2.4... no
configure: error: python is missing or unusable
make[1]: *** [configure-gdb] Error 1
make[1]: Leaving directory `/usr/local/build/gdb-7.1/build-python'
after another while I found gdb/config.log (it's a bit hidden I
think) telling -lpython2.5 could not be found.
I googled and found the recommendation to symlink it by myself. I
think this is doubtful, but I had no better idea, so I did:
host:/usr/local/lib # ln -s /usr/local/lib/python2.5/config/libpython2.5.a .
re-ran make. Now I got resolved symbols from libdl (dl_open and
friends) and even from libpthread (sem_init, pthread_create...).
I tried:
../configure --with-python --target=arm-elf --disable-werror \
--disable-expat --with-expat=no \
LIBS="-ldl -lpthread"
but since it seems not to be a recursive configure but some
sub-configure indepdently triggered by make, the parameters
(LIBS) seem not to be passed through; in gdb/config.log the shown
"Invocation command line" does not include the LIBS parameter.
Anyway, I think LIBS="-lpthread" cannot be right, should be
automatic.
Or do I have to build some single-threaded python?
Maybe also disabling libdl? Or is this essential?
Is my assumption to use "a standard python" correct or should a
specifically configured one be used? Maybe not even installed
system-wide?
Any hints or pointers appreciated.
oki,
Steffen
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: how to build gdb-7.1 --with-python?
2010-06-25 15:40 how to build gdb-7.1 --with-python? Steffen Dettmer
@ 2010-06-25 17:13 ` Tom Tromey
2010-06-28 11:04 ` Steffen Dettmer
0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2010-06-25 17:13 UTC (permalink / raw)
To: Steffen Dettmer; +Cc: gdb
>>>>> "Steffen" == Steffen Dettmer <steffen.dettmer@googlemail.com> writes:
Steffen> I googled, but did not find installation instructions. gdb/README
Steffen> just states `--with-python', so I though it would be easy, as
Steffen> soon as I upgraded my Python. So from python.org I grabbed 2.5
Steffen> and installed it (default configure options).
Ok. Default arguments means it was installed in /usr/local.
Steffen> Went back to gdb builddir and used:
Steffen> ../configure --with-python --target=arm-elf --disable-werror
Steffen> --disable-expat --with-expat=no
Steffen> Worked. Ran make. Failed after a while with:
Steffen> checking for python2.5... no
Steffen> checking for python2.4... no
Steffen> configure: error: python is missing or unusable
Try --with-python=/usr/local
With CVS gdb, you instead point to the 'python' executable.
Steffen> Now I got resolved symbols from libdl (dl_open and
Steffen> friends) and even from libpthread (sem_init, pthread_create...).
This sounds familiar... I think it was fixed after 7.1.
It is more ordinary to install and use libpython.so, not the .a.
If you want to go this route it may be simpler to try CVS gdb (though I
am not sure -- I'm always just using my distro's python).
Tom
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: how to build gdb-7.1 --with-python?
2010-06-25 17:13 ` Tom Tromey
@ 2010-06-28 11:04 ` Steffen Dettmer
0 siblings, 0 replies; 3+ messages in thread
From: Steffen Dettmer @ 2010-06-28 11:04 UTC (permalink / raw)
To: gdb
On Fri, Jun 25, 2010 at 7:12 PM, Tom Tromey <tromey@redhat.com> wrote:
>
> Steffen> checking for python2.5... no
> Steffen> checking for python2.4... no
> Steffen> configure: error: python is missing or unusable
>
> Try --with-python=/usr/local
Again, configure worked, but make failed after a while.
configure: WARNING: expat support disabled; some features may be
unavailable.
checking whether to use python... /usr/local
checking for python2.6... no
checking for python2.5... no
checking for python2.4... no
configure: error: no usable python found at /usr/local
make[1]: *** [configure-gdb] Error 1
make[1]: Leaving directory `/usr/local/build/gdb-7.1/build-python2'
make: *** [all] Error 2
BTW, I think specifying default directories might not be a good idea
and it leads to a gcc warning:
configure:9525: gcc -o conftest -g -O2 -I/usr/local/include
conftest.c -lncurses -lz -lm -L/usr/local/lib -lpython2.5 >&5
cc1: warning: changing search order for system directory "/usr/local/include"
cc1: warning: as it has already been specified as a non-system directory
but anyway, linking fails with exactly the same problem:
/usr/local/build/Python-2.5.5/build/../Python/dynload_shlib.c:130:
undefined reference to `dlopen'
(also dlsym, dlerror)
/usr/local/lib/libpython2.5.a(thread.o): In function `PyThread_acquire_lock':
/usr/local/build/Python-2.5.5/build/../Python/thread_pthread.h:334:
undefined reference to `sem_wait'
(also sem_trywait, pthread_attr_setstacksize, pthread_create...)
/usr/local/lib/libpython2.5.a(posixmodule.o): In function `posix_openpty':
/usr/local/build/Python-2.5.5/build/../Modules/posixmodule.c:3519:
undefined reference to `openpty'
(also forkpty)
as before, it seems to need -ldl and -lpthread, which is missing
on command line and cannot be added via `LIBS="-ldl -lpthread"'.
> With CVS gdb, you instead point to the 'python' executable.
>
> Steffen> Now I got resolved symbols from libdl (dl_open and
> Steffen> friends) and even from libpthread (sem_init, pthread_create...).
>
> This sounds familiar... I think it was fixed after 7.1.
i.e. in CVS gdb?
> It is more ordinary to install and use libpython.so, not the .a.
> If you want to go this route it may be simpler to try CVS gdb (though I
> am not sure -- I'm always just using my distro's python).
ok, I'll try python --enable-shared... I guess it has a bigger
chance to succeed?
Steffen
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-06-28 11:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-25 15:40 how to build gdb-7.1 --with-python? Steffen Dettmer
2010-06-25 17:13 ` Tom Tromey
2010-06-28 11:04 ` Steffen Dettmer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox