Subject: Re: Mixing NetBSD and Linux shared libs
To: Michal Pasternak <michal@pasternak.w.lub.pl>
From: Alistair Crooks <agc@wasabisystems.com>
List: current-users
Date: 04/19/2002 13:02:04
On Fri, Apr 19, 2002 at 09:48:18AM +0000, Micha? Pasternak wrote:
> Thomas Runge [Fri, Apr 19, 2002 at 09:26:21AM +0200]:
> > 
> > > Calling libc functions, or any other function outside of the scope of
> > > the fixed JNI API (which is usually the point of JNI in the first place
> > > :) typically will not work without actually using Linux includes and
> > > libraries (and typically, compiler, since the crtbegin/crtend files are
> > > different).
> > 
> > Do I get it right? If we use our native compiler/linker
> > with -nostdinc and -nostdlib but providing Linux's
> > includes, libs and startup files, we can get a binary
> > that works on a real Linux box?
> 
> I doubt so. You can install linux-gcc from .rpm or whatever, and it should
> work. You can compile gcc to use target i386-linux or such for compilation,
> and it should work also. But I really doubt, that NetBSD's gcc could produce
> Linux binaries.

I have successfully compiled, debugged and run Linux binaries on NetBSD
using the pkgsrc/devel/suse_devel package - taken from its description:

> Linux compatibility package based on the SuSE Linux distribution, take a
> look at "http://www.suse.com/" for more information about it.
> 
> This package contains basic Linux system development tools in ELF binary
> format, linked with glibc2.

Regards,
Alistair