NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: linux binary convert



On Thu, Apr 16, 2020 at 04:37:23PM +0200, Fekete Zoltán wrote:
> Hi There,
> 
> I have a 3rd party, closed-source binary .so file.
> I can use it on NetBSD with the COMPAT_LINUX option and some other linux
> libraries along.
> So, I guess there is no linux-specific system call inside (Am I wrong?).

You are likely wrong - it could include its own specific syscalls, or
otherwise reference the linux C library which contains the linux specific
syscalls.

The binaries are recognized as linux binaries and the syscalls interpreted
as such.

> However I would like to link it to my own native NetBSD binary.

If it contains any syscalls itself, you can not do that.

A whole process is bound to a specific "emulation", which could be native
NetBSD, or native NetBSD 32bit binaries, or Linux, or whatever.

If it doesn't do any syscalls, you still need a glibc compatible C library
which would collide with the NetBSD native C library.

Easiest way out: compile your own code with a Linux toolchain, link against
the closed source .so and run the result under linux emulation.

Martin


Home | Main Index | Thread Index | Old Index