File tree Expand file tree Collapse file tree
Source/UnrealEnginePython/Private Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,8 +28,27 @@ void unreal_engine_init_py_module();
2828void init_unreal_engine_builtin ();
2929
3030#if PLATFORM_LINUX
31+ // so something seems to have changed between 4.18 and 4.25 which means we can no longer
32+ // import python extension modules that have/are dynamic libraries (ie site?dist-packages modules)
33+ // eg import ctypes fails with missing dynamic link symbol found in the primary python shared library
34+ // it seems that the python extension modules are not able to access the primary
35+ // python shared library /usr/lib/x86_64-linux-gnu/libpythonx.x.so symbols
36+ // OK so this gets even more confusing as apparently on other linux distributions the python extension libraries
37+ // ARE linked with the primary python shared library - this is a debian/ubuntu issue
38+ // it appears what happened is that the default symbol visibility for global symbols was changed from default to hidden
39+ // - likely to reduce chance of symbol clashes - it could be particularly true now with Unreals python implementation
40+ // although that seems to use static linking - but this fixup may mean we cannot have both python implementations
41+ // active
42+ // note that ue4_module_options is a symbol whose existence and value is checked in either LinuxPlatformProcess.cpp (4.18)
43+ // or UnixPlatformProcess.cpp (4.25) to determine if to load dynamic libraries using RTLD_GLOBAL
44+ // - otherwise RTLD_LOCAL is used
45+ // it apparently has to be a global symbol itself for this to work
46+ #if ENGINE_MINOR_VERSION >= 25
47+ const char *ue4_module_options __attribute__ ((visibility(" default" ))) = "linux_global_symbols";
48+ #else
3149const char *ue4_module_options = " linux_global_symbols" ;
3250#endif
51+ #endif
3352
3453#include " Runtime/Core/Public/Misc/CommandLine.h"
3554#include " Runtime/Core/Public/Misc/ConfigCacheIni.h"
You can’t perform that action at this time.
0 commit comments