> Hi all,
> I was just wondering if there is an obvious reason why a program
> compiled on RH 4.1 (kernel 2.0.27) won't run on RH 5.0 (kernel 2.0.31).
> I have a work program that was developed on 4.1. When I try to run the
> program on 5.0 the program gets core dumped even before it has a chance
> to execute the first printf in main(). The program works fine on 4.1.
> Any ideas?
I had the same problem with the developmental debian app. At first I
would alter the LD_LIBRARY_PATH variable to point to the old versions of
the shared libraries (e.g.
LD_LIBRARY_PATH=/lib/libc5-compat:/usr/lib/libc5-compat) However, then I
found out that the linker is supposed to do this FOR you! It is
supposed to figure out if a program wants to be linked with libc5 or
libc6! The reason this wasn't working for me was that I has specified
"/usr/X11R6/lib" in my normal LD_LIBRARY_PATH.
However, with Debian (and presumably Red Hat) you don't need a massive
LD_LIBRARY_PATH variable, like
LD_LIBRARY_PATH=/lib:/usr/lib:/usr/X11R6/lib.
EVERY ONE of THOSE libraries is standard, and should be in your
/etc/ld.so.conf file. Mine looks like this:
/usr/local/lib
/usr/X11R6/lib
/usr/lib/libc5-compat
/lib/libc5-compat
Notice that it isn't necessary to specify /lib or /usr/lib... they are
automatically assumed.
You can tell which library your applications are linked with by running
'ldd' on it:
ldd netscape: (compiled with OLD libc5)
libXt.so.6 => /usr/lib/libc5-compat/libXt.so.6 (0x4000b000)
libSM.so.6 => /usr/lib/libc5-compat/libSM.so.6 (0x4004d000)
libICE.so.6 => /usr/lib/libc5-compat/libICE.so.6 (0x40056000)
libXmu.so.6 => /usr/lib/libc5-compat/libXmu.so.6 (0x4006b000)
libXpm.so.4 => /usr/lib/libc5-compat/libXpm.so.4 (0x4007d000)
libXext.so.6 => /usr/lib/libc5-compat/libXext.so.6 (0x4008b000)
libX11.so.6 => /usr/lib/libc5-compat/libX11.so.6 (0x40096000)
libdl.so.1 => /lib/libdl.so.1 (0x40134000)
libc.so.5 => /lib/libc.so.5 (0x40137000)
libm.so.5 => /lib/libm.so.5 (0x401f3000)
ldd xterm: (from Debian, so compiled with libc6)
libXaw.so.6 => /usr/X11R6/lib/Xaw95/libXaw.so.6 (0x4000f000)
libXmu.so.6 => /usr/X11R6/lib/libXmu.so.6 (0x40064000)
libXt.so.6 => /usr/X11R6/lib/libXt.so.6 (0x40076000)
libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x400be000)
libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x400c7000)
libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x400dc000)
libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x400e8000)
libncurses.so.3.4 => /lib/libncurses.so.3.4 (0x4018d000)
libc.so.6 => /lib/libc.so.6 (0x401d2000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
Basically, programs that were compiled with old libraries should get
libc.so.5 and some libc5-compat stuff, which newer programs should get
/lib/ld-linux.so.2 and libc.so.6
Quote:> When I try to recompile the apps, it finally loads and runs, but it
> eventually dies in a fprintf() call. What's going on?
I'm not quite sure. This might be a separate problem :) Do you have
the above problem?
Regards,
-BenRI