community.borland.com

Article #25847: undefined symbol while running IBPerl script

Problem:
After installing IBPerl 0.7...

When running a perl script from the example directory the following error occurs:

Can't load
'/usr/lib/perl5/site_perl/5.005/i386-linux/auto/IBPerl/IBPerl.so'
for module IBPerl:
/usr/lib/perl5/site_perl/5.005/i386-linux/auto/IBPerl/IBPerl.so:
undefined symbol: _xstat at /usr/lib/perl5/5.00503/i386-linux/DynaLoader.pm
line 169.


Solution:
This problem is pervasive to any application on
Linux that tries to link a library compiled against glibc 2.0 with the
current glibc, 2.1.  That is, a library that was built on a machine with
glibc 2.0 has unresolved symbols that it expects to resolve at link
time.  If the current version of glibc doesn't have that symbol (_xstat
in this case), the dynamic linking at runtime fails.  The culprit in
this case is the InterBase client library, libgds.so.0.  It was built on
Red Hat Linux 5.1.

The folks who implemented glibc seem to have created a
non-backward-compatible change in their C runtime library.  Searching
www.deja.com shows that not only InterBase is affected, but other
products too.

There are three possible workarounds. Any one of the following solutions
will work to allow you to build IBPerl or other InterBase applications on
Linux.

1) Upgrade to InterBase V5.6 for Linux, which was built on Red Hat Linux 6,
and properly references _xstat and other symbols in the glibc 2.1 runtime
library.  Order InterBase V5.6 for Linux from your country's Inprise
distributor, or http://shop.borland.com/ in the US.

2) Compile applications such as IBPerl with InterBase V4.0 or V5.1.1 on Red
Hat Linux by using the additional linker flag:  "-lNoVersion-2.1.2".  Red
Hat Linux provides this library for compatiblity with pre-glibc 2.1
software.  Other distributions of Linux may or may not have this
compatibility library; look for the file /lib/libNoVersion-2.1.2.so on your
Linux system.

3) Download and build GNU glibc 2.0 from a Linux sources server.  For
example, ftp://prep.ai.mit.edu/gnu/glibc/glibc-2.0.6.tar.gz. Use this
library in place of the glibc library on your Linux host, when compiling
applications with InterBase V4.0 or V5.1.1.

Last Modified: 27-OCT-00