From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30968 invoked by alias); 2 Jul 2011 02:08:57 -0000 Received: (qmail 30960 invoked by uid 22791); 2 Jul 2011 02:08:56 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 02 Jul 2011 02:08:42 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 9D3612BB4D7; Fri, 1 Jul 2011 22:08:40 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id jkPfatO8U6-7; Fri, 1 Jul 2011 22:08:40 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 6D6452BB4BB; Fri, 1 Jul 2011 22:08:40 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id DA2EB145615; Fri, 1 Jul 2011 19:08:37 -0700 (PDT) Date: Sat, 02 Jul 2011 02:08:00 -0000 From: Joel Brobecker To: Paul Koning Cc: gdb@sourceware.org Subject: Re: Undefined symbol while executing Python Message-ID: <20110702020837.GG2421@adacore.com> References: <674EAAD3-EF0C-451B-BC73-5D39F33E6780@dell.com> <00001CBF-4AB1-41C4-988A-4D817CA8ED73@dell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <00001CBF-4AB1-41C4-988A-4D817CA8ED73@dell.com> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2011-07/txt/msg00004.txt.bz2 > > (gdb) python import itertools > > Traceback (most recent call last): > > File "", 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