On 27/04/2013, at 10:28 PM, john skaller wrote:

> BTW: There's a nasty problem now with plugins. Well, an ugliness anyhow.
> 
> Previously, a plugin was just a DLL. So the generated object file had to be
> suitable code: on the x86_64 on unices (Linux, OSX) this means specifying
> the flag -fPIC to get position independent code. Since there's an overhead 
> with 
> this we don't do it for static linkage.
> 
> But now, plugins can also be statically linked. So as well as making
> 
>       plugin.dylib (on OSX)
> 
> we have to make
> 
>       plugin.o        
> 
> for static linkage. The problem is this will work if we're linking the plugin 
> into
> an executable but NOT if we're linking it into a DLL (because to do that the
> code has to be position independent). So we have to have ANOTHER file as well:
> 
>       plugin.os
> 
> which is position independent, the same as the RTL. Grrrr.


By extension, we actually need the RTL to have TWO kinds of archive:

        libflx_something_static.a # for making executables
        libflx_something_dynamic.a # for making shared libs
        libflx_something_dynamic.so # for run time loading (either exes or dlls)

Now, there's a reason Felix puts _static.a and _dynamic.so: its to stop
idiot linkers like unix ld picking static link library if a dynamic link library
happens to be missing (and vice-versa). Systems like Debian make this
serious mistake, providing both *.a and *.so variants of a library:
its a bad idea given how broken ld is.

But now, we have the problem back! We actually need libflx_something_dynamic.a
to mean it contains *.os files, that is, files compiled with -fPIC which are 
therefore
suitable for linking into a shared library.

Which reintroduces the old problem ;(

--
john skaller
skal...@users.sourceforge.net
http://felix-lang.org




------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to