Subject: Re: compat_solaris
To: Michael <macallan18@earthlink.net>
From: None <sigsegv@rambler.ru>
List: port-sparc64
Date: 02/05/2005 20:22:14
Michael wrote:
> Hello,
> 
>>> I tried to run Opera for Solaris on NetBSD/sparc64 but all I got was
>>> 'unrecognized binary format' or something similar.  I enabled all the
>>> COMPAT_SVR4_32 stuff in the kernel, copied the necessary libs and so
>>> on from a Solaris 9 installation and other Solaris binaries just work
>>> ( tried things like xterm and so on ).  objdump and file both agree
>>> that the Opera binary is an ordinary, dynamically linked ELF32_SPARC
>>> binary, just like most things coming with Solaris.
>>> So I guess there's some voodoo going on in the kernel to pick the
>>> right emulation which for some reason fails with Opera - any idea
>>> where to look?  I read the stuff in sys/compat/svr4_32/svr4_exec*
>>> without seeing anything obvious.
>>
>>
>> ktrace(1) is Your Friend.
> 
> Doh! Should have thought of that - thanks for reminding me :)
> 
> Hmm, now I get...
> Syntax error: ")" unexpected
> Apparently ktrace thinks it's a script for some reason. Odd.
> 
I think I've had similar problem, it turned out absolute symlinks in 
/emul/* were messing things up. There are two solutions:

1) chroot under /emul/* and run your binary in a chrooted environment
2) fix absolute symlinks to be relative

I wrote a script that can do that automatically for 2) but I'm running 
Solaris 10 on my Ultra10 which acts as a router and right now I'm 
downloading NetBSD source tree. I can reboot into NetBSD after the 
download is complete and email my script.