Guido van Rossum | 1442177 | 1994-09-14 14:06:46 +0000 | [diff] [blame] | 1 | Subject: Dynamic Linking under HP-UX |
| 2 | From: "C. Derek Fields" <derek@gamekeeper.bellcore.com> |
| 3 | Date: Thu, 08 Sep 94 14:14:07 -0400 |
| 4 | |
| 5 | There are two important points. First, the python executable must be |
| 6 | linked with the -E option to explicitly export all symbols. This |
| 7 | works with the vanilla interpreter, but I am not sure how friendly it |
| 8 | will be when I try to embed the interpreter in a larger application. |
| 9 | It may be necessary to hand tune the exports using the -e option. |
| 10 | Anyway, the additional flag to $(CC) is "-Wl,-E", which passes the -E |
| 11 | flag to the compiler. My link line (from an actual run) looks like |
| 12 | this: |
| 13 | |
| 14 | cc config.o -Wl,-E libModules.a ../Python/libPython.a ../Objects/libObjects.a ../Parser/libParser.a -lm -ldld -o python |
| 15 | |
Guido van Rossum | ecd3b15 | 1997-07-19 20:44:33 +0000 | [diff] [blame] | 16 | [Guido's note: as of Python 1.5, replace the four libraries with |
| 17 | ../libpython$(VERSION).a] |
| 18 | |
Guido van Rossum | 1442177 | 1994-09-14 14:06:46 +0000 | [diff] [blame] | 19 | Second, the dynamic module must be compiled with the +z option to make |
| 20 | it position independent and then linked into a shared library: |
| 21 | |
| 22 | ld -b -o <modName>module.sl <object list> |
| 23 | |
| 24 | The -b tells the linker to produce a shared library. |