Commit 21ea2b3
committed
Fix Linux: dlopen libpython with RTLD_GLOBAL for extension modules
On Linux, Python extension modules (like _socket.so) need to find
Python symbols like PyByteArray_Type. When embedding Python in a
shared library (NIF), these symbols aren't visible by default.
Fix by calling dlopen(libpython, RTLD_GLOBAL) before Py_Initialize
to export all Python symbols globally.1 parent 42d2f10 commit 21ea2b3
1 file changed
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
44 | 47 | | |
45 | 48 | | |
46 | 49 | | |
| |||
462 | 465 | | |
463 | 466 | | |
464 | 467 | | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
465 | 487 | | |
466 | 488 | | |
467 | 489 | | |
| |||
0 commit comments