Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How portable is linking executables against loadable modules?

I have a project on my hand with some libraries that are compiled as loadable modules, i.e. linked with libtool's -module flag. These libraries are supposed to contain all the necessary functions in themselves or their dependencies, that is, they should yield a complete program when linked with a simple main() function that simply calls all functions of the module interface for my program.

Since I had issues with incomplete and thus unusable modules before, I have a few simple check programs that do just contain a main() and are linked against the modules. When a function is missing, the linker croaks with appropriate warnings, so all good there. However, libtool gives me one warning:

*** Warning: Linking the executable checkplugin_locprec against the loadable module
*** liblocprec.so is not portable!

I understand the purpose and intent of this warning (don't link a program against a library built with -module), however not its severity, and that's my question:

How severe is this warning? Am I just lucky that this works on the platforms I am compiling for (i386/x86_64 Linux and MinGW) or is this warning just relevant for some obscure backwood platform I can safely ignore?

like image 374
thiton Avatar asked Nov 05 '22 13:11

thiton


1 Answers

The main platform were this doesn't work is Mac OS X. On other platforms, it should generally work, but might fail depending on other build options you use. If you used libtool, then you are probably safe on other platforms.

like image 71
Peter Eisentraut Avatar answered Nov 09 '22 10:11

Peter Eisentraut