Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Paul Koning <paul_koning@dell.com>
Cc: gdb@sourceware.org
Subject: Re: Undefined symbol while executing Python
Date: Sat, 02 Jul 2011 02:08:00 -0000	[thread overview]
Message-ID: <20110702020837.GG2421@adacore.com> (raw)
In-Reply-To: <00001CBF-4AB1-41C4-988A-4D817CA8ED73@dell.com>

> > (gdb) python import itertools
> > Traceback (most recent call last):
> >  File "<string>", line 1, in ?
> > ImportError: /usr/lib/python2.4/lib-dynload/itertoolsmodule.so: undefined symbol: PyObject_SelfIter
> > Error while executing Python code.
[...]
> More...  The symbol is defined in libpython2.4.so.  The native 7.0.1
> gdb has that library in its required libraries list.  The cross 7.2
> gdb I built does not.  That makes sense, it alllows that gdb to be
> executed on another machine that might not have the same python
> installed.  

Is GDB linked against the shared libpython? From what you are saying,
it seems like it is.  But I know that there are problems when linking
against the static version of libpython.  I have the following change
in python-config.py to deal with the same sort of issue after I linked
GDB with the static libpython.

+                if platform.system() == 'Linux':
+                    # Make sure that the loader can resolve symbols from
+                    # the libpython archive when loading modules implemented
+                    # as DSOs (Eg: "import time").  This is to work around
+                    # a side-effect of linking against the static version
+                    # of libpython.
+                    libs.insert(0, '-Xlinker -export-dynamic')

-- 
Joel


  reply	other threads:[~2011-07-02  2:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-01 19:38 Paul Koning
2011-07-01 20:56 ` Paul Koning
2011-07-02  2:08   ` Joel Brobecker [this message]
2011-07-05 13:57     ` Paul Koning
2011-07-05 15:01       ` Joel Brobecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110702020837.GG2421@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb@sourceware.org \
    --cc=paul_koning@dell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox