Date: Sat, 24 Jun 2006 11:21:24 -0500 From: Dan Nelson <dnelson@allantgroup.com> To: Simeon Nifos <archwndas@yahoo.com> Cc: freebsd-questions@freebsd.org Subject: Re: howto convert Linux shared libraries foo.so to FreeBSD shared libraries Message-ID: <20060624162124.GB83209@dan.emsphone.com> In-Reply-To: <20060624151124.23405.qmail@web55210.mail.re4.yahoo.com> References: <20060624151124.23405.qmail@web55210.mail.re4.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Jun 24), Simeon Nifos said: > Does anybody know how to convert a shared object compiled in Linux > foo-linux.so to a shared object compiled for FreeBSD freebsd-foo.so? > I mean a freebsd-foo.so to which I can link with objects compiled by > a native FreeBSD compiler. Or equivalently how to create a FreeBSD > foo.so from a linux foo.so which would be identical to that which > would be compiled from source in FreeBSD? I don't think either of these are possible because internal library structures (the size of off_t, or the field sizes and ordering of struct stat or FILE, for example) are different. Any converter would have to decompile the code into C (impossible in practice) and recompile it at a FreeBSD binary. > I do not need to run a Linux binary. What I need to do is to link my > object (.o) files compiled natively in FreeBSD with a foo.so which is > a linux library. Take a look at the www/linuxpluginwrapper port, which creates wrapper libraries that convert Linux function calls to FreeBSD ones. You then use libmap.conf to substitute these libraries for any ones called by the Linux shared library. Depending on what your library's API looks like, and what external functions it calls, you might be able to get it to work. The correct solution would be to ask your vendor for either a FreeBSD shared library, or the source :) -- Dan Nelson dnelson@allantgroup.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060624162124.GB83209>
