lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Excerpts from Enrico Tassi's message of 2014-07-06 16:02:47 +0200:
> The shared objects for Lua 5.1 and 5.2 share a lot of symbol names.
> This is usually not a problem, since an application is either linked
> against Lua 5.1 or 5.2, so no confusion is made.  Unfortunately Lua is a
> popular extension language for libraries too.  So it may happen that a
> software links two distinct libraries that in turn are linked against
> different versions of Lua.  Boom.

DSO diamond problem happens now and then, and -Wl,--default-symver is the
traditional remedy. Works right out of the box, assuming sane conditions,
ie lua51.so vs lua52.so.

GNUism alright, but Debian only uses GNU binutils anyway,
so it's not that much of bother perhaps?

> 
> Would it be possible to name the symbols after the Lua version?  I'm
> wondering if something like having #define lua_foo lua53_foo for each
> symbol that is part of the public API would work.

One might argue massive macro infestation is painful as well, this time
on the porting side of things. API renaming that way is usually the last
resort to implement various hacks. Unintended consequences caveat emptor:

You are suggesting potential breakage across the board as a solution
to problem within the scope of Linux distro system linker.