Next: GNU dynamic loading Up: Building a dynamically Previous: Shared libraries

SGI dynamic loading

bf IMPORTANT: You must compile your extension module with the additional C flag `-G0' (or `-G 0'). This instruct the assembler to generate position-independent code.

You don't need to link the resulting `foomodule.o' file; just copy it into a directory along the Python module search path.

The first time your extension is loaded, it takes some extra time and a few messages may be printed. This creates a file `foomodule.ld' which is an image that can be loaded quickly into the Python interpreter process. When a new Python interpreter is installed, the dl package detects this and rebuilds `foomodule.ld'. The file `foomodule.ld' is placed in the directory where `foomodule.o' was found, unless this directory is unwritable; in that case it is placed in a temporary directory.

If your extension modules uses additional system libraries, you must create a file `foomodule.libs' in the same directory as the `foomodule.o'. This file should contain one or more lines with whitespace-separated options that will be passed to the linker - normally only `-l' options or absolute pathnames of libraries (`.a' files) should be used.


guido@cwi.nl