Subject: Re: How to run Linux binaries on NetBSD/i386-1.2
To: C Kane <ckane@best.com>
From: Rick Byers <rickb@iaw.on.ca>
List: port-i386
Date: 03/24/1997 17:10:27
Hi Chuck,

It looks like you need an "options EXEC_ELF32" option in your kernel. 
But, from what I've seen, you can't have both COMPAT_SVR4 and
COMPAT_LINUX.  They both use ELF binaries, and NetBSD can't tell a LINUX
ELF from a SVR4 ELF.  Try turning off COMPAT_SVR4, rebuild (from scratch)
your kernel, see if that works (it should).

I don't think it's possible to do BOTH SVR4 and LINUX, so you'll probably
have to make a decision (or keep two kernels - arrgg) about which one is
more important.  I use COMPAT_LINUX and it works fine for me...

Hope this helps,
	Rick

 On Mon, 24 Mar 1997, C Kane wrote:

> Hi.
> 
> I have a
> 
> NetBSD ics22 1.2 NetBSD 1.2 (ICS22) #0: Tue Mar 11 04:30:29 PST 1997  root@ics22:/usr/src/sys/arch/i386/compile/ICS22 i386
> 
> system where I want to run Linux (and SVR4) binaries.  The conf file contains
> 
> options         COMPAT_SVR4     # binary compatibility with SVR4
> options         COMPAT_IBCS2    # binary compatibility with SCO and ISC
> options         COMPAT_LINUX    # binary compatibility with Linux
> options         COMPAT_FREEBSD  # binary compatibility with FreeBSD
> 
> but when I try to run a linux program, I get:
> 
> ls: 1: Syntax error: "(" unexpected
> 
> 
> `file ls` reports
> 
> ls: ELF 32-bit LSB executable, Intel 80386, version 1
> 
> 
> 
> /emul is a link to /opt/emul:
> 
> lrwxr-xr-x  1 root  wheel  9 Mar 17 15:12 /emul -> /opt/emul
> 
> The rest of the /emul directory tree looks like:
> 
> total 2
> drwxr-xr-x  7 root  wheel  512 Mar 24 13:00 linux
> 
> /emul/linux:
> total 10
> drwxr-xr-x  2 root  wheel  512 Mar 24 13:00 bin
> drwxr-xr-x  2 root  wheel  512 Mar 24 13:00 etc
> drwxr-xr-x  2 root  wheel  512 Mar 24 13:00 lib
> drwxr-xr-x  2 root  wheel  512 Mar 24 13:00 sbin
> drwxr-xr-x  3 root  wheel  512 Mar 24 13:00 usr
> 
> /emul/linux/bin:
> total 72
> -rwxr-xr-x  1 root  wheel  36860 Mar 24 13:00 ls
> 
> /emul/linux/etc:
> total 2
> -rw-r--r--  1 root  wheel  5 Mar 24 13:00 ld.so.conf
> 
> /emul/linux/lib:
> total 2482
> -rwxr-xr-x  1 root  wheel   24580 Mar 24 13:00 ld.so
> lrwxr-xr-x  1 root  wheel      13 Mar 24 13:00 libc.so.4 -> libc.so.4.7.6
> -rwxr-xr-x  1 root  wheel  634880 Mar 24 13:00 libc.so.4.7.6
> lrwxr-xr-x  1 root  wheel      14 Mar 24 13:00 libc.so.5 -> libc.so.5.3.12
> -rwxr-xr-x  1 root  wheel  583795 Mar 24 13:00 libc.so.5.3.12
> 
> /emul/linux/sbin:
> total 172
> -rwxr-xr-x  1 root  wheel  87465 Mar 24 13:00 ldconfig
> 
> /emul/linux/usr:
> total 2
> drwxr-xr-x  2 root  wheel  512 Mar 24 13:00 bin
> 
> /emul/linux/usr/bin:
> total 156
> -rwxr-xr-x  1 root  wheel  79605 Mar 24 13:00 ldd
> 
> 
> I think I have followed all the directions mentioned in the section
> about setting up Linux binaries.
> 
> Any help you can give me is appreciated.
> 
> -- Chuck
> 

=========================================================================
Rick Byers                                      Internet Access Worldwide
rickb@iaw.on.ca                                      System Administrator
Welland, Ontario, Canada                                    (905)714-1400
http://www.iaw.on.ca/rickb/                         http://www.iaw.on.ca/