Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Aug 2005 16:31:30 -0500
From:      Dan Nelson <dnelson@allantgroup.com>
To:        "M. Warner Losh" <imp@bsdimp.com>
Cc:        hackers@freebsd.org
Subject:   Re: Converting libfoo.so for linux to freebsd
Message-ID:  <20050809213130.GB71687@dan.emsphone.com>
In-Reply-To: <20050809.133734.08360256.imp@bsdimp.com>
References:  <20050809.133734.08360256.imp@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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.

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

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

-- 
	Dan Nelson
	dnelson@allantgroup.com



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050809213130.GB71687>