diff --git a/core/cc/dl_loader.cpp b/core/cc/dl_loader.cpp index da0321048b..7994f039d4 100644 --- a/core/cc/dl_loader.cpp +++ b/core/cc/dl_loader.cpp @@ -23,6 +23,9 @@ #elif TARGET_OS == GAPID_OS_OSX # include # include +#elif TARGET_OS == GAPID_OS_LINUX +# include +# include #else # include #endif @@ -51,6 +54,16 @@ void* load(const char* name) { } } return res; +#elif TARGET_OS == GAPID_OS_LINUX + void* res = dlopen(name, RTLD_NOW | RTLD_LOCAL); + if (res != nullptr) { + return res; + } + // Try name + ".1" + size_t len = strlen(name) + sizeof(".1"); + char* fallback_name = new char[len]; + strcat(fallback_name, ".1"); + return dlopen(name, RTLD_NOW | RTLD_LOCAL); #else return dlopen(name, RTLD_NOW | RTLD_LOCAL); #endif // TARGET_OS