[techtalk] Upwards compatibility problem

Almut Behrens almut_behrens at yahoo.com
Tue Jul 31 23:30:43 EST 2001


On Tue, Jul 31, 2001 at 03:48:35PM -0400, Shirrell wrote:

> I have ported P-STAT our statistical package to Linux using Redhat 6.0
> with SUSE 5.2 as additional test site.  Since it is largely Fortran
> (g77) with C (gcc) for windowing (ncurses and X11) and I/O, I link it as a
> static link.  gcc and g77 are release 2.95.2, ncurses is release 5.0 and
> X11 is R6.  Using the static link so far has enabled us to run on
> our module on any linux that we have tried until now.  A German user
> reports that they have upgraded to SUSE 7.2 and the p-stat module cannot
> be found even when trying to run it from the directory where it is stored.
> 
> I have seen a similar problem when a RedHat 6.0 link was moved down to
> a SUSE 5.2 but not with a static link that was moved upwards. The link
> script is attached. Any suggestions would be appreciated.

Hi,

are you sure *everything* is linked in statically? What dependencies does

$ ldd p-statrh3

report (if any) -- assuming the executable is named p-statrh3 ?
Ideally, it should display just

        statically linked (ELF)

and not anything like

        libc.so.5 => /lib/libc.so.5 (0x4000b000)

You might want to compare the output of ldd when being run on the
various platforms.
I somehow feel that this has to do with some libc5 vs. glibc thing,
although you're linking statically. Not sure, though.  Newer Linux
distros typically require you to install some extra compatibility
package for libc5 support (at least I don't think that SuSE-7.2 does
install it by default) -- and even then it's tricky sometimes.

As to running p-stat from the directory where the binary is stored:
did the user try to start it with "./p-stat"? The current directory
"." might not be in his search path. What is the exact error message?

As a last resort, you might try running your application under strace
to see where it fails.

For a somewhat reduced output (file-related system calls only) try:

$ strace -f -e trace=file -o strace.log  <your app + args here>

For full tracing simply leave out the "-e trace=file" option.
Inspect the strace.log file near the end for errors like "not found"
etc.  This should give you some idea of what's going wrong...

Good luck,

- Almut



>  /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/collect2 -m elf_i386 \
> -dynamic-linker /lib/ld-linux.so.2 \
> -static \
> -o p-statrh3 \
> /usr/lib/crt1.o /usr/lib/crti.o \
> /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/crtbegin.o \
> -L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2 \
> -L/usr/local/lib \
> -L/usr/X11R6/lib \
> PSTAT.o psinfo.o pstat1.o pstat2.o wi*.o x11*.o \
> /home/psource/source/libps.a \
> -lncurses -lg2c -lm -lX11 -lgcc -lc -lgcc \
> /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/crtend.o /usr/lib/crtn.o




More information about the Techtalk mailing list