Linking linux libs

Alexander Leidinger Alexander at Leidinger.net
Tue Jul 12 11:10:16 GMT 2005


On Tue, 12 Jul 2005 00:57:41 +0400
Vladimir Grebenschikov <vova at fbsd.ru> wrote:

> __ ____, 11/07/2005 __ 13:32 -0500, Dan Nelson __________:
> > In the last episode (Jul 11), Jim Bodkikns (Dakotacom) said:
> > >   A linux emulation question.
> > > 
> > >   I suspect I know the answer to this, but what about linking to
> > > vendor supplied linux libs? (A vendor product that is provided in the
> > > form of libraries that are linked into your apps).
> > 
> > As long as you compile and link using linux gcc and ld to generate a
> > Linux executable, it'll work.  Don't try and link a Linux library into
> > a FreeBSD executable, though, unless the ABI is very simple.  For
> > example, a standalone crypto module that takes a buffer and a key would
> > probably work; anything that tries to do any stdio or call libc
> > functions that pass structures won't.
> 
> I have know examples of more complex magic on linking big database linux
> static library into FreeBSD applications, but it was like black magic
> with lot of libc compatibility hacks.

www/linuxpluginwrapper does something like this. It does it at run-
time, not at (static-)link-time.

You can also do a little bit of magic (like renaming symbols) with the
proprietary object code, like in the lang/icc port.

For short: you "just" have to provide the missing symbols at link-time.

Bye,
Alexander.

-- 
            Secret hacker rule #11: hackers read manuals.

http://www.Leidinger.net                       Alexander @ Leidinger.net
  GPG fingerprint = C518 BC70 E67F 143F BE91  3365 79E2 9C60 B006 3FE7


More information about the freebsd-emulation mailing list