[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

documentation/1855: compat_freebsd manpage doesn't mention ELF runtime linker




>Number:         1855
>Category:       documentation
>Synopsis:       compat_freebsd manpage doesn't mention ELF runtime linker
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bugs
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jun  7 06:40:01 MDT 2001
>Last-Modified:
>Originator:     Dimitry Andric
>Organization:
net
>Release:        2.9-current (as of 2001-06-06 17:50:15)
>Environment:
	System      : OpenBSD 2.9
	Architecture: OpenBSD.i386
	Machine     : i386
>Description:
The compat_freebsd(8) manpage explains quite thoroughly how to
install FreeBSD files to /emul/freebsd to get FreeBSD executables to
run. Specifically, in the section "Setting up shared libraries" it
says (under point [1]):

  Finally, you must make sure that you have the FreeBSD runtime
  linker and its config files on your system. You should copy these
  files from the FreeBSD system to their appropriate place on your
  OpenBSD system (in the /emul/freebsd tree):

  usr/libexec/ld.so
  var/run/ld.so.hints

However, this is only the old a.out linker, from the FreeBSD 2.x
compatibility files. Newer FreeBSD executables are almost always in
ELF format, just as with OpenBSD, and need the ELF version of the
linker and its hints file:

  usr/libexec/ld-elf.so.1
  var/run/ld-elf.so.hints

This causes a lot of recent FreeBSD executables to fail to run.

>How-To-Repeat:
man compat_freebsd

Then try to run a fairly recent FreeBSD executable (in ELF format).
These mostly die instantaneously with:

Abort trap

or something like that, due to the missing ELF linker.
>Fix:
Add the ld-elf.so.1 and ld-elf.so.hints files to /emul/freebsd and
add a comment in the manpage. Here's a rough patch (since I'm not
very familiar with [gnt]roff syntax).

--- /usr/src/share/man/man8/compat_freebsd.8	Fri Jul  9 15:35:36 1999
+++ compat_freebsd.8	Thu Jun  7 14:25:39 2001
@@ -132,13 +132,15 @@
 /emul/freebsd/usr/lib/libc.so.2.1
 .fi
 .Pp
-Finally, you must make sure that you have the FreeBSD runtime linker
-and its config files on your system. You should copy these
+Finally, you must make sure that you have the FreeBSD runtime linkers
+and their config files on your system. You should copy these
 files from the FreeBSD system to their appropriate place on your
 OpenBSD system (in the /emul/freebsd tree):
 .Pp
 .nf
+usr/libexec/ld-elf.so.1
 usr/libexec/ld.so
+var/run/ld-elf.so.hints
 var/run/ld.so.hints
 .fi
 .Pp
@@ -156,6 +158,7 @@
 sbin/ldconfig
 usr/bin/ldd
 usr/lib/libc.so.x.y.z
+usr/libexec/ld-elf.so.1
 usr/libexec/ld.so
 .fi
 .Pp
@@ -171,6 +174,7 @@
 .Pp
 .Bl -tag -width 123 -compact -offset indent
 .It me@openbsd% mkdir -p /emul/freebsd/var/run
+.It me@openbsd% touch /emul/freebsd/var/run/ld-elf.so.hints
 .It me@openbsd% touch /emul/freebsd/var/run/ld.so.hints
 .It me@openbsd% ldconfig-freebsd /usr/X11R6/lib /usr/local/lib
 .El

>Audit-Trail:
>Unformatted: