4 ms·
> Didn't see one of the IMO biggest downsides of static linking in that list, which is that there is no sane way to prevent symbol clashes if different componen
by jcelerier 6y ago
> Didn't see one of the IMO biggest downsides of static linking in that list, which is that there is no sane way to prevent symbol clashes if different components of your application need different versions of the same dependency.
wouldn't symbol versioning allow to do something like this ? it needs a bit of modification of the Lua sources but that can likely be quickly automated with some bash script
annotate lua 5 functions definitions to look like
__attribute__ ((__symver__ ("lua_func@VERS_50")))
void lua_func_v50() { ... }
annotate lua 5.1 functions likewise
__attribute__ ((__symver__ ("lua_func@VERS_51")))
void lua_func_v51() { ... }
and then in the files which uses Lua 5 put at top level :
asm (".symver lua_func, lua_func@VERS_50");
and conversely VERS_51 for lua 5.1 - now that .o file should resolve to lua_func_v50 or lua_func_v51 when lua_func is called