mirror of
https://github.com/cemu-project/idapython.git
synced 2024-11-24 10:09:20 +01:00
python.cpp: Importing binary Python extensions now works more reliably on Linux. Thanks to Phil Ashby for the patch!
This commit is contained in:
parent
791fde6af7
commit
097a6ae4b0
15
python.cpp
15
python.cpp
@ -19,6 +19,9 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#ifdef __LINUX__
|
||||||
|
#include <dlfcn.h>
|
||||||
|
#endif
|
||||||
#include <ida.hpp>
|
#include <ida.hpp>
|
||||||
#include <idp.hpp>
|
#include <idp.hpp>
|
||||||
#include <ieee.h>
|
#include <ieee.h>
|
||||||
@ -618,6 +621,18 @@ bool IDAPython_Init(void)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __LINUX__
|
||||||
|
/* Export symbols from libpython to resolve imported module deps */
|
||||||
|
qsnprintf(tmp, sizeof(tmp), "libpython%d.%d.so",
|
||||||
|
PY_MAJOR_VERSION,
|
||||||
|
PY_MINOR_VERSION);
|
||||||
|
if (!dlopen(tmp, RTLD_NOLOAD | RTLD_GLOBAL))
|
||||||
|
{
|
||||||
|
warning("IDAPython: dlopen(%s) failed", tmp);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Start the interpreter */
|
/* Start the interpreter */
|
||||||
Py_Initialize();
|
Py_Initialize();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user