This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Is it possible to statically link python into gdb?
- From: <Paul_Koning at Dell dot com>
- To: <tim at krieglstein dot org>
- Cc: <gdb at sourceware dot org>, <flameroc at gmail dot com>
- Date: Mon, 23 Jun 2014 15:48:21 +0000
- Subject: Re: Is it possible to statically link python into gdb?
- Authentication-results: sourceware.org; auth=none
- References: <CAGbRaL5PAaO-NHojLYfSOjZPsPajYGGb0e8FV2qr5g8OEJXqzQ at mail dot gmail dot com> <56168225 dot tkKpPXRO26 at dabox>
On Jun 23, 2014, at 9:49 AM, Tim Sander <tim@krieglstein.org> wrote:
> Hi Terry
>> I am trying to build a gdb with python support which doesn't depend on
>> system python at all. I can manage to build python into static library
>> like libpython2.7.a, then I can see that this static library is linked
>> into gdb. With command ldd, there is no libpython dependence in final
>> gdb. So far all good. But when run this gdb on another machine, I ran
>> into below errors and gdb can't be initiated:
>>
>> Could not find platform independent libraries <prefix>
>> Could not find platform dependent libraries <exec_prefix>
>> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
>>
>> I am working on Ubuntu x86 machines with gdb from master branch and
>> Python 2.7. Could some one please help me? Thanks in advance.
> I don't know much about python but might it be that you need the *.py files
> of PYTHONHOME/lib nevertheless to get a running python interpreter?
I assume you’d need at least a couple, for the standard Python startup machinery to work. Some of that can be suppressed when Python is involved by a command; I assume this can also be done when Python is embedded.
Note also that a lot of Python modules are not just .py files but also .so files or equivalent.
paul