From: Sandeep Koranne
Subject: FFI with Harleuquin LCL503 on HPUX
Date: 
Message-ID: <Fv4AA2.3Fs@natlab.research.philips.com>
Hello,
I am trying to write a CL interface for PVM on my Lisp system, Liquid Common
Lisp 5.0.3 on HP-UX 11.

Whenever I do :

> (load-foreign-files "libpvm3.a")
; Loading foreign modules from archive libpvm3.a :
;   lpvmgen.o, lpvmpack.o, pvmfrag.o, pvmumbuf.o, lpvm.o, pvmdabuf.o,
;   pvmcruft.o, lpvmcat.o
/usr/lib/dld.sl: Can't shl_load() a library containing Thread Local Storage:
/usr/lib/libc.2
/usr/lib/dld.sl: Exec format error
>>Error: Dynamic link problem - Exec format error

I have faced the same problem with loading the CAPI submodules also.


Does any one know how to fix this ??


TIA
Sandeep.

PS: I know about CL-PVM on GCL, AKCL. But I want to do some thing else.
From: Frank Goenninger
Subject: Re: FFI with Harleuquin LCL503 on HPUX
Date: 
Message-ID: <392EDE83.C1384532@hp.com>
Hi Sandeep ! !

Sandeep Koranne wrote:
> 
> Hello,
> I am trying to write a CL interface for PVM on my Lisp system, Liquid Common
> Lisp 5.0.3 on HP-UX 11.
> 
> Whenever I do :
> 
> > (load-foreign-files "libpvm3.a")
> ; Loading foreign modules from archive libpvm3.a :
> ;   lpvmgen.o, lpvmpack.o, pvmfrag.o, pvmumbuf.o, lpvm.o, pvmdabuf.o,
> ;   pvmcruft.o, lpvmcat.o
> /usr/lib/dld.sl: Can't shl_load() a library containing Thread Local Storage:
> /usr/lib/libc.2
> /usr/lib/dld.sl: Exec format error
> >>Error: Dynamic link problem - Exec format error

I tried to reproduce this with plain C (as I do not have LCL503) on an
HP-UX 10.20 machine.
The error message is thrown by the Dynamic Loader (dld) when attempting
to load a normal xxx.a library (an archive library file, normally ending
with .a). So what happens is that within the call to
(load-foreign-files "libpvm3.a")
someone (LCL503) makes a call to the shl_load function to try to load
the library libpvm3.a. This is not what you intended - obviously (the
dld never should get called for an archive type library file). The dld
expects to load a SHARED library (ending in .1 or .2 - depending on the
library version - so it may also be .3 or anything else).

Possible workarounds (I do not say _solution_ because it still is not
clear what the actual problem is - you having specified the wrong
name/type for the PVM library _OR_ a bug in LCL503):

1. I'd recommend to look for a shared library version of the PVM lib
(libpvm.1 ...).
2. I'd ask Harlequin to tell you more about the load-foreign-files
function. (Why not let them fiy this?)
3. Let's hope someone out there has a working solution ;-)

> 
> I have faced the same problem with loading the CAPI submodules also.
> 
> Does any one know how to fix this ??
> 
> TIA
> Sandeep.
> 
> PS: I know about CL-PVM on GCL, AKCL. But I want to do some thing else.

If you are interested (or anyone else) in the short C test program I can
email or post it.
Hope that helps although not being a real solution.

Regards.
 Frank