Dynamic loading of libreadline opens wrong library filename

Ross Burton <[email protected]>
Newsgroups gmane.comp.lang.lua.general
Message-ID <[email protected]>
Hi,

As of lua 5.5[1] libreadline is no longer linked to at build time but 
instead dlopen()'d.  However, the library that is dlopen'd out of the box 
on Linux is "libreadline.so":

 #if defined(LUA_USE_LINUX)
 #define LUA_USE_POSIX
 #define LUA_USE_DLOPEN         /* needs an extra library: -ldl */
+#define LUA_READLINELIB                "libreadline.so"
 #endif

This filename will only be available on systems where readline was compiled 
by the user, where the readline development package has been installed. 
 For example, it will only be available on Debian systems where 
libreadline-dev has been installed[2], as the actual library is 
libreadline.so.8.2 (with a symlink of libreadline.so.8) [3].

Also, if readline changes API and switches to libreadline.so.9 then you 
might well be using the wrong API, causing crashes.

I think lua should be explicitly loading libreadline.so.8, this will work 
for everyone and be sure that you get a library with the ABI that you 
expect.

Cheers,
Ross

[1] https://github.com/lua/lua/commit/366c85564874d560b3608349f752e9e490f9002d
[2] https://packages.debian.org/trixie/amd64/libreadline-dev/filelist
[3] https://packages.debian.org/trixie/amd64/libreadline8t64/filelist

-- 
You received this message because you are subscribed to the Google Groups "lua-l" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/lua-l/556884c5-aa53-43e9-896d-e879fe3f9372n%40googlegroups.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.