Operating System - HP-UX
1833753 Members
2553 Online
110063 Solutions
New Discussion

Perl: XML::Parser linking against libexpat fails

 
SOLVED
Go to solution
Ralph Grothe
Honored Contributor

Perl: XML::Parser linking against libexpat fails

Hi Perlies,

I wish to experiment with XML-RPC and SOAP.
Because fussing about with all the XML(-Schema) stuff is too time consuming and distracting for me I would like to make use of some Perl toolkits.

Although my preferred choice of toolkit XMLRPC::Lite (as being a subclass of SOAP::Lite) works with a totally Perl-based parser it is advisable however to install the XML::Parser which builds on the Expat C library to speed things up a lot.

So I doonloaded Expat 1.95.6 and compiled it with the HP-UX ANSI C compiler through the Makefile the configure script created.
Thus the lib and header file got installed under the usual PREFIX=/usr/local.

When I now try to make the Perl XML::Parser module I get this erratic abortion:

# make
rm -f ../blib/arch/auto/XML/Parser/Expat/Expat.sl
LD_RUN_PATH="/usr/local/lib" /usr/bin/ld -b +vnocompatwarnings -L/usr/local/lib -L/lib/pa20_64 Expat.o -o ../blib/arch/auto/XML/Parser/Expat/Expat.sl -lexpat
ld: Mismatched ABI (not an ELF file) for -lexpat
Fatal error.
*** Error exit code 1

Stop.
*** Error exit code 1

Stop.


I'm not C-conversant, and thus don't know what the acronym ABI stands for (application binary interface, or what?)

The Expat libs built are marked as such:

# file /usr/local/lib/libexpat.*
/usr/local/lib/libexpat.a: archive file -PA-RISC2.0 relocatable library
/usr/local/lib/libexpat.la: ascii text
/usr/local/lib/libexpat.sl: PA-RISC2.0 shared library -not stripped
/usr/local/lib/libexpat.sl.4: PA-RISC2.0 shared library -not stripped
/usr/local/lib/libexpat.sl.4.0: PA-RISC2.0 shared library -not stripped
Madness, thy name is system administration
3 REPLIES 3
Steven Gillard_2
Honored Contributor
Solution

Re: Perl: XML::Parser linking against libexpat fails

It sounds like you could be trying to mix 32bit and 64bit object files - they use different binary formats.

Try adding +DD64 to the CFLAGS of the libexpat makefile to get a 64bit library version.

Regards,
Steve
ranganath ramachandra
Esteemed Contributor

Re: Perl: XML::Parser linking against libexpat fails

(i cant tell you anything about the makefile itself, so you can try to hack it based on my comments)

how about "file Expat.o" ? i suspect that it may be an ELF file, that is why the linker thinks its an ELF link and rejects the SOM (32-bit) libraries. also, why is there a "-L/lib/pa20_64" there (while you also have "-L/usr/local/lib" where you have all the 32-bit/SOM libraries) ? decide whether you want a 32-bit (SOM) or a 64-bit (ELF) target and specify the -L directories accordingly, consistently.

check your compile line, too - you should not have cc/aCC option "+DD64" (or the like) in it unless you want a 64-bit build. if you want a 64-bit build, you *must* specify "+DD64"
 
--
ranga
hp-ux 11i v3[i work for hpe]

Accept or Kudo

Ralph Grothe
Honored Contributor

Re: Perl: XML::Parser linking against libexpat fails

Hello Guys,

you are so right,
I should have taken car to compile the Expat library with the same compiler flags as I did compile Perl.

So I looked up again how Perl was compiled

# perl -V|grep cflags
cc='cc', ccflags =' -Ae -D_HPUX_SOURCE -Wl,+vnocompatwarnings +DD64 -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 ',


and consequently feeded Expat's configure script with the same CFLAGS


# ./configure CFLAGS="-Ae -Wl,+vnocompatwarnings +DD64"


With the thus installed libexpat the Perl XML::Parser installation passed all tests successfully:


# make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/astress.........ok
t/cdata...........ok
t/decl............ok
t/defaulted.......ok
t/encoding........ok
t/external_ent....ok
t/file............ok
t/finish..........ok
t/namespaces......ok
t/parament........ok
t/partial.........ok
t/skip............ok
t/stream..........ok
t/styles..........ok
All tests successful.
Files=14, Tests=130, 4 wallclock secs ( 3.28 cusr + 0.77 csys = 4.05 CPU)
Madness, thy name is system administration