-lModules -lPython -lObjects -lParser

Anton Graph "aglyport\" at n-o.s,p/a__m.yahoo.com>
Mon May 20 16:59:43 EDT 2002


Martin v. Loewis wrote:
> Anton Graph <""aglyport\"@n-o.s,p/a__m.yahoo.com> writes:
> 
> 
>>Btw, whatever happened to Modules Python Objects Parser quadruplet?
>>Was it replaced by the pythonX.Y lib?
> 
> 
> Yes; that happened in Python 1.5, I believe.
> 
> 
>>And why is config file a part of that lib now?
> 
> 
> Because the build process combines essentially all objects; libpython
> is linked to main. Does this cause problems?

It does for me:

g++ -V 2.95.3 -g  -o metadb metadb.o metaadb.o metaddl.o metapy.o 
i386-linux.o -L/usr/local/lib/python2.2/config -lpython2.2  config2.o 
-lpthread -ldl -lutil -lm
config2.o(.data+0x0):/usr/local/agl/metadb/config2.c: multiple 
definition of `_PyImport_Inittab'
/usr/local/lib/python2.2/config/libpython2.2.a(config.o)(.data+0x0):/usr/local/src/Python-2.2.1/Modules/config.c: 
first defined here
/usr/bin/ld: Warning: size of symbol `_PyImport_Inittab' changed from 
120 to 128 in config2.o
/usr/local/lib/python2.2/config/libpython2.2.a(posixmodule.o): In 
function `posix_tmpnam':
/usr/local/src/Python-2.2.1/./Modules/posixmodule.c:4501: the use of 
`tmpnam_r' is dangerous, better use `mkstemp'
/usr/local/lib/python2.2/config/libpython2.2.a(posixmodule.o): In 
function `posix_tempnam':
/usr/local/src/Python-2.2.1/./Modules/posixmodule.c:4451: the use of 
`tempnam' is dangerous, better use `mkstemp'
collect2: ld returned 1 exit status

What am I doing wrong?

In 1.4 I was modifying config.c and linking it with the python libs to 
extend the interpreter. But now it no longer works.

config2.c:

struct _inittab _PyImport_Inittab[] = {

	{"thread", initthread},
	{"signal", initsignal},
	{"posix", initposix},
	{"_sre", init_sre},
	{"new", initnew},
	{"_symtable", init_symtable},
	{"xxsubtype", initxxsubtype},

/* -- ADDMODULE MARKER 2 -- */

	/* This module lives in marshal.c */
	{"marshal", PyMarshal_Init},

	/* This lives in import.c */
	{"imp", initimp},

	/* These entries are here for sys.builtin_module_names */
	{"__main__", NULL},
	{"__builtin__", NULL},
	{"sys", NULL},
	{"exceptions", NULL},

#ifdef WITH_CYCLE_GC
	/* This lives in gcmodule.c */
	{"gc", initgc},
#endif
	/* AGL's modules */
	{"metadb", initmetadbtypes},
^^^^^^^^^^^^^^^^^^^^^^^^^^ I've added this type.

	/* Sentinel */
	{0, 0}
};


I have about three different programs with different extension modules 
so I would rather avoid having three diffrerent libpython2.2 libs
differing only in the config.c part.




More information about the Python-list mailing list