Subject: Re: Mixing NetBSD and Linux shared libs
To: Thomas Runge <>
From: Bill Studenmund <>
List: current-users
Date: 04/19/2002 12:45:34
On Fri, 19 Apr 2002, Thomas Runge wrote:

> > 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?

As others have noted, you might get lucky, but you're getting lucky. The
safest thing to do is use the suse compiler. ;-)

One problem you will porbably run into is that the program you make above
will, on NetBSD, probably get identified as a NetBSD program. The problem
is that we, Linux, SVR4, and others all use the same file format, yet have
different syscall numbers. We get around this ambiguity by adding a
section to the file that says, "this is a NetBSD file." The linker will by
default add this section to the output file, so NetBSD will think your
program is a NetBSD one, not a Linux one.

Take care,