Fixing the dreaded "wrong ELF class: ELFCLASS64" error with DBD::Oracle on Solaris



(Solaris 9, Perl 5.8.5, DBD::Oracle 1.19, Oracle 10g)

Anybody else experience this problem? If so, this may work for you!

I was able to download, build and install the DBD::Oracle module, as
long as my LD_LIBRARY_PATH specifically called out the lib32 library.
However, whenever a user needed to use the module, even if they had
their environment setup correctly, they got this error:

install_driver(Oracle) failed: Can't load
'/lba_system/usr/local/perl5.8.5/lib/site_perl/5.8.5/sun4-solaris/auto/DBD/Oracle/Oracle.so'
for module DBD::Oracle: ld.so.1: perl5.8.5: fatal:
/lba_ora1/app/oracle/10g_102/lib/libclntsh.so.10.1: wrong ELF class:
ELFCLASS64 at
/lba_system/usr/local/perl5.8.5/lib/5.8.5/sun4-solaris/DynaLoader.pm
line 230.
at (eval 3) line 3
Compilation failed in require at (eval 3) line 3.
Perhaps a required shared library or dll isn't installed where expected
at ./INT_build_changes.p line 25

The problem stems from having a 32-bit version of Perl, and Oracle
using 64-bit libraries in the .../lib path. I googled for the
solution, getting undesirable recommendations such as rebuilding Perl,
manually changing the Oracle directory names, etc.

Finally, I hit upon a nifty fix: pass the Oracle 32-bit build rules to
the module! Here's how (requires manual build rather than default CPAN
make):
perl Makefile.PL -m
/lba_ora1/app/oracle/10g_102/rdbms/demo/demo_rdbms32.mk

That's it! No need to even modify the Makefile.PL. Check the output
of the command, you'll see the LDFLAGS are now setup correctly. Then
just do the normal make, test, install. To use, you still must have
the .../lib32 directory in your LD_LIBRARY_PATH, but at least it works
now.

Just giving back to the community...

jeff

.



Relevant Pages

  • Re: attempt to build 64 bit on Solaris fails
    ... > libraries needed to link with a 64-bit Tk. ... We were running a 32-bit version of Perl ... > Each section below is a summary of the commands used to install it. ...
    (comp.lang.perl.tk)
  • Re: attempt to build 64 bit on Solaris fails
    ... libraries needed to link with a 64-bit Tk. ... We were running a 32-bit version of Perl ... Each section below is a summary of the commands used to install it. ...
    (comp.lang.perl.tk)
  • DBD::Oracle install - make test errors
    ... I'm trying to install the Perl DBD::Oracle module on ... I have read all the relevant DBD-Oracle README files. ... This is the info on Perl: ... Linker and Libraries: ...
    (perl.dbi.users)
  • Re: DBD::Oracle Install Mystery
    ... getting trying to install DBD::Oracle: ... Looking at your compile line above I'm guessing you are using Oracle 8.1.6 and that OCI_FETCH_CURRENT was not available in 8.1.6)or at least not defined). ... get a recent instant client and instant client sdk and compile DBD::Oracle against that. ... Perl 5.10 recently installed with gcc, ...
    (perl.dbi.users)
  • RE: Trying to make DBI work for me
    ... I did "perl -V"; ... say "Oracle client", do you mean DBD-Oracle.ppd? ... Install 'DBD-Oracle' version 1.15 in ActivePerl 5.6.1.633. ... I don't know about the perl error, but as for the Oracle error, it ...
    (perl.dbi.users)