[education/rkward] rkward/rbackend: Try with dlmopen (is it available, everywhere?)

Thomas Friedrichsmeier null at kde.org
Sat May 11 14:00:56 BST 2024


Git commit f9d6475335831c2141d274350053c821fd0bf4a0 by Thomas Friedrichsmeier.
Committed on 11/05/2024 at 12:09.
Pushed by tfry into branch 'master'.

Try with dlmopen (is it available, everywhere?)

M  +3    -2    rkward/rbackend/rkrbackend_dlopen.cpp

https://invent.kde.org/education/rkward/-/commit/f9d6475335831c2141d274350053c821fd0bf4a0

diff --git a/rkward/rbackend/rkrbackend_dlopen.cpp b/rkward/rbackend/rkrbackend_dlopen.cpp
index b177ee914..00bb46add 100644
--- a/rkward/rbackend/rkrbackend_dlopen.cpp
+++ b/rkward/rbackend/rkrbackend_dlopen.cpp
@@ -32,8 +32,10 @@ void *resolve_symb(void* dllinfo, const char* name) {
 auto loadlib(const char* name) {
 #ifdef Win32
 	auto ret = LoadLibraryA(name);
+#elif defined(LM_ID_NEWLM)
+	auto ret = dlmopen(LM_ID_NEWLM, name, RTLD_NOW | RTLD_LOCAL); // NOTE: RTLD_DEEPBIND causes undiagnosed runtime failure on Suse Tumbleweed around 05/24 (while it works, elsewhere)
 #else
-	auto ret = dlopen(name, RTLD_NOW | RTLD_LOCAL); // NOTE: RTLD_DEEPBIND causes undiagnosed runtime failure on Suse Tumbleweed around 05/24 (while it works, elsewhere)
+	auto ret = dlopen(name, RTLD_NOW | RTLD_LOCAL);
 #endif
 	if (!ret) {
 #ifdef Win32
@@ -48,7 +50,6 @@ auto loadlib(const char* name) {
 
 int main(int argc, char *argv[]) {
 // TODO: Take lib name from CMake?
-// TODO: Use dlmopen, where available?
 
 /** NOTE: For a description of the rationale for this involved loading procedure rkapi.h ! */
 	if (argc > 10) {



More information about the rkward-tracker mailing list