[Python-bugs-list] [Bug #110701] undefined symbol in custom interpeter (PR#191)

noreply@sourceforge.net noreply@sourceforge.net
Tue, 5 Sep 2000 15:14:54 -0700


Bug #110701, was updated on 2000-Jul-31 14:29
Here is a current snapshot of the bug.

Project: Python
Category: None
Status: Closed
Resolution: None
Bug Group: Not a Bug
Priority: 5
Summary: undefined symbol in custom interpeter (PR#191)

Details: Jitterbug-Id: 191
Submitted-By: gurney_j@efn.org
Date: Tue, 25 Jan 2000 12:33:51 -0500 (EST)
Version: 1.5.2
OS: FreeBSD 3.4R


When I try to run the following program I get an undefined symbol on
PyDict_SetString.

#include <Python.h>

void
main()
{
        Py_Initialize();
        PyRun_SimpleString("import base64\n");
        Py_Finalize();
}

I believe this is because the interpeter library doesn't reference all of the
symbols
that it may need when loading modules.  So the linker will throw out any
unecessary
symbols which happen to include PyDict_SetString.  I tried to include
PyDict_SetString into
my program, but was unable to make it work.


====================================================================
Audit trail:
Mon Feb 07 12:36:08 2000	guido	changed notes
Mon Feb 07 12:36:08 2000	guido	moved from incoming to platformbug

Follow-Ups:

Date: 2000-Sep-05 15:00
By: loewis

Comment:
This is not a bug in Python. When linking a custom interpreter, you need
to make sure all symbols are exported to modules. On FreeBSD, you
do this by adding -Wl,--export-dynamic to the linker line.
-------------------------------------------------------

Date: 2000-Sep-05 15:14
By: jhylton

Comment:
On python-dev, Martin von Löwis wrote:

This is not a bug in Python. When linking a custom interpreter, you
need to make sure all symbols are exported to modules. On FreeBSD, you
do this by adding -Wl,--export-dynamic to the linker line.

-------------------------------------------------------

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=110701&group_id=5470