To run a dynamically-linked mksh, ld needs to be found at /compat/linux/lib/ld-linux.so.2. Maybe it is possible to create a full set of (sym)links inside /compat/linux/ to suit the paths used by multiarch?
Sounds ugly. We already have proper, non-colliding locations for i386 & amd64 ld-linux.so under /lib/$(DEB_HOST_MULTIARCH)/ it should be possible to use those. I don't want to re-create multiarch libraries in /compat/, instead a Debian system should correctly load libraries from multi-arch locations.
Only ld.so symlink should be needed. See also https://wiki.debian.org/Debian_GNU/kFreeBSD_FAQ#Q:_Is_it_possible_to_run_Linux_binaries_under_Debian_GNU.2FkFreeBSD_kernel.3FThe kernel tries to detect whether it is a Linux binary and sometime rewrites interpretter location to /compat/...
But the ld which ships with squeeze and wheezy fails with "FATAL: kernel too old" (we are emulating 2.6.16 syscalls). Probably a special one is needed, perhaps from the FreeBSD linux_base port?Hm... =( no idea. Maybe we will need a recompile of ld for kfreebsd platforms =/
It would "just" mean whole (e)glibc, as currently eglibc in Debian have for linux "MIN_KERNEL_SUPPORTED := 2.6.32".
Petr