Hello, As with posters on this list from 7/15/06, 10/25/06 and 2/10/07, I am having trouble with compat_freebsd and binaries that depend on shared libraries. Everyone seems to have given up so far but sincerely want to get it working.
In short, launching a FreeBSD binary that depends on shared libraries reports: # /emul/freebsd/usr/bin/ldd /usr/libexec/ld-elf.so.1: /usr/lib/libc.so.4: mmap of entire address space failed: Invalid argument ... even though they exist: # ldconfig-freebsd -r|grep libc.so.4 13:-lc.4 => /usr/lib/libc.so.4 # find / -name libc.so.4 -print /usr/local/emul/freebsd/usr/lib/libc.so.4 # ls -l /usr/local/emul/freebsd/usr/lib/libc.so* lrwxr-xr-x 1 root wheel 9 Aug 4 00:44 \ /usr/local/emul/freebsd/usr/lib/libc.so -> libc.so.4 -r--r--r-- 1 root wheel 582928 Jan 21 2005 \ /usr/local/emul/freebsd/usr/lib/libc.so.4 Environment: OpenBSD 4.1 x86, FreeBSD 4.11 binaries Now the checklist: Is the sysctl enabled? Check. sysctl -w kern.emul.freebsd=1 Off: ksh: /emul/freebsd/usr/bin/ldd: Operation no permitted On: The error above Did I copy in ldd-freebsd and ldconfig-freebsd as per the man page? Check. Is the symlink to /emul/freebsd in place? Check. ls -l /emul/ ...freebsd -> /usr/local/emul/freebsd Do I have a seemingly-good freebsd 4.11 bin installation? Check. mount the cd... cat /mnt/cdrom/bin.?? | tar zpxf - -C /usr/local/emul/freebsd Did I create the empty shared library hints files? Check. # touch /usr/local/emul/freebsd/var/run/ld-elf.so.hints # touch /usr/local/emul/freebsd/var/run/ld.so.hints Did I populate the cache with a safe set of paths that should work on both OpenBSD and FreeBSD? Check. Along with only /usr/lib just in case # ldconfig-freebsd /usr/lib /usr/local/lib /usr/X11R6/lib /usr/lib/compat Did it do something? Check. # ls -l /emul/freebsd/var/run ... 167 Aug 6 18:44 ld-elf.so.hints Do statically-build binaries run? Check. # ldconfig-freebsd -r /var/run/ld-elf.so.hints: search directories: /usr/lib:/usr/local/lib:... 0:-lcom_err.2 => /usr/lib/libcom_err.so.2 1... Did I try FreeBSD's ldd? Check. *Can't* It depends on shared libraries Did I try OpenBSD's for what it's worth? Check. # ldd `which ldd-freebsd` /usr/local/bin/ldd-freebsd libc.so.4 => not found (0x0) Did I try the LD_LIBRARY_PATH environment environment over relying on the shared library cache? Check. export LD_LIBRARY_PATH=/usr/lib:/usr/local/lib:/usr/X11R6/lib Did I compare the ldd output on a real FreeBSD 4.11 box? Check. ldd `which ldd` /usr/bin/ldd: libc.so.4 => /usr/lib/libc.so.4 (0x2806a000) Did I try a statically-built FreeBSD 4.11 world? Failed... may need a patch: http://lists.freebsd.org/pipermail/freebsd-questions/2004-November/065954.html make NOSHARED=yes buildworld Did I turn off compat_linux in case it conflicts for some reason? Check. Did I try variations on Linux's: /lib/ld-linux.so.2 --library-path PATH EXECUTABLE http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html Failed: convention does not appear to be supported. Did I try FreeBSD 5.5 binaries given that the man page referrs to 5.0? Check. Failed... they all seem to have dynamic library dependencies. Anything else I should try? Does anyone have compat_freebsd working? Many thanks, Michael.