Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Aug 2005 14:03:41 +0900
From:      Hajimu UMEMOTO <ume@freebsd.org>
To:        Dan Nelson <dnelson@allantgroup.com>
Cc:        hackers@freebsd.org
Subject:   Re: Converting libfoo.so for linux to freebsd
Message-ID:  <ygevf2e4c42.wl%ume@mahoroba.org>
In-Reply-To: <20050809213130.GB71687@dan.emsphone.com>
References:  <20050809.133734.08360256.imp@bsdimp.com> <20050809213130.GB71687@dan.emsphone.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

>>>>> On Tue, 9 Aug 2005 16:31:30 -0500
>>>>> Dan Nelson <dnelson@allantgroup.com> said:

dnelson> In the last episode (Aug 09), M. Warner Losh said:
> I have recently purcahsed a device that comes with a .so for linux,
> but no sources.  Is there any way one can take an arbitrary linux .so
> which appears to have no dependencies to a FreeBSD .so?  The binary
> code is about 20k or so.

dnelson> As long as any structs that are passed back and forth have the same
dnelson> members and alignment, it should work.  This includes struct FILE,
dnelson> which means if the app tries to use stdio it'll likely crash.

dnelson> I just compiled a little "hello world" object file on SUSE and linked
dnelson> it on FreeBSD and it ran (it just calls printf, which is safe since it
dnelson> doesn't pass a FILE *).

As far as the Linux shlib uses the functions which ABI are compatible
with FreeBSD's one, it should work.  However, if there are some ABI
incompatibility, you may want to consider the approach of
linuxpluginwrapper.
The PIPS ports (print/pips*) link Linux shlib to FreeBSD binary.  To
do this, the PIPS ports use www/linuxpluginwrapper to fixup some ABI
incompatibility.

Sincerely,

--
Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan
ume@mahoroba.org  ume@{,jp.}FreeBSD.org
http://www.imasy.org/~ume/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ygevf2e4c42.wl%ume>