old-www/HOWTO/Software-Building-HOWTO-6.html

75 lines
3.3 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
<TITLE>Building and Installing Software Packages for Linux: Backward Compatibility With a.out Binaries</TITLE>
<LINK HREF="Software-Building-HOWTO-7.html" REL=next>
<LINK HREF="Software-Building-HOWTO-5.html" REL=previous>
<LINK HREF="Software-Building-HOWTO.html#toc6" REL=contents>
</HEAD>
<BODY>
<A HREF="Software-Building-HOWTO-7.html">Next</A>
<A HREF="Software-Building-HOWTO-5.html">Previous</A>
<A HREF="Software-Building-HOWTO.html#toc6">Contents</A>
<HR>
<H2><A NAME="s6">6. Backward Compatibility With a.out Binaries</A></H2>
<P>
<P>In a very few cases, it is necessary to use a.out binaries, either because
the source code is not available or because it is not possible to build
new ELF binaries from the source for some reason.
<P>As it happens, ELF installations almost always have a complete set
of a.out libraries in the <CODE>/usr/i486-linuxaout/lib</CODE> directory.
The numbering scheme for a.out libraries differs from that of ELF ones,
cleverly avoiding conflicts that could cause confusion. The a.out
binaries should therefore be able to find the correct libraries at
runtime, but this might not always be the case.
<P>Note that the kernel needs to have a.out support built into it, either
directly or as a loadable module. It may be necessary to rebuild the
kernel to enable this. Moreover, some Linux distributions require
installation of a special compatibility package, such as Debian's
<CODE>xcompat</CODE> for executing a.out X applications.
<P>
<H2><A NAME="ss6.1">6.1 An Example</A>
</H2>
<P>
<P>Jerry Smith wrote a very handy <EM>rolodex</EM> program some years
back. It uses the Motif libraries, but fortunately is available
as a statically linked binary in a.out format. Unfortunately, the
source requires numerous tweaks to rebuild using the <EM>lesstif</EM>
libraries. Even more unfortunately, the a.out binary bombs on an ELF
system with the following error message.
<BLOCKQUOTE><CODE>
<PRE>
xrolodex: can't load library '//lib/libX11.so.3'
No such library
</PRE>
</CODE></BLOCKQUOTE>
<P>As it happens, there is such a library, in
<CODE>/usr/i486-linuxaout/lib</CODE>, but xrolodex is unable to locate it
at run time. The simple solution is to provide a symbolic link in the
<CODE>/lib</CODE> directory:
<P><CODE>ln -s /usr/i486-linuxaout/lib/X11.so.3.1.0 libX11.so.3</CODE>
<P>
<P>It turns out to be necessary to provide similar links for the libXt.so.3
and libc.so.4 libraries. This needs to be done as root, of course. Note
that you should make absolutely certain you will not overwrite or cause
version number conflicts with pre-existing libraries. Fortunately, the
new ELF libraries have higher version numbers than the older a.out ones,
to anticipate and forestall just such problems.
<P>After creating the three links, <EM>xrolodex</EM> runs fine.
<P>The <EM>xrolodex</EM> package was originally posted on
<A HREF="http://www.spectro.com/">Spectro</A>, but seems to
vanished from there. It may currently be downloaded from
<A HREF="http://metalab.unc.edu/pub/Linux/apps/reminder/xrolodex.tar.z">Sunsite</A> as a <EM>tar.Z</EM> format source file [512k].
<P>
<P>
<P>
<HR>
<A HREF="Software-Building-HOWTO-7.html">Next</A>
<A HREF="Software-Building-HOWTO-5.html">Previous</A>
<A HREF="Software-Building-HOWTO.html#toc6">Contents</A>
</BODY>
</HTML>