Subject: "exec format error" with COMPAT_LINUX32 on amd64
To: None <>
From: Alex <>
List: current-users
Date: 06/28/2006 12:10:16
I upgraded to NetBSD-current yesterday (2006-06-27) and compiled my 
kernel with COMPAT_LINUX32 support:

options         COMPAT_NETBSD32
options         COMPAT_LINUX
options         COMPAT_LINUX32  # req. COMPAT_LINUX and COMPAT_NETBSD32
options         EXEC_ELF32

I was able to install SuSE 10.0 compatibility from 
/usr/pkgsrc/emulators/ by modifying the Makefiles to use i386 instead of 
the normal x86_64. If I chroot into /emul/linux, then the executables 
run fine. Otherwise, I receive "exec format errors".

% /emul/linux/bin/ls
zsh: exec format error: /emul/linux/bin/ls

% sudo chroot /emul/linux /bin/sh
sh-3.00# /bin/ls
bin  dev  etc  lib  proc  root    sbin  usr  var

Using chroot would be fine except for I need to access files outside of 
/emul/linux. Are there any ways to solve this?