gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gcl-devel] gcl-elf-loader 0.10


From: Michael Koehne
Subject: Re: [Gcl-devel] gcl-elf-loader 0.10
Date: Mon, 24 Nov 2003 23:48:55 +0100
User-agent: Mutt/1.3.28i

Moin Camm Maguire,

> >   - why is there no /clcs/ in the Debian /usr/lib/gcl-2.7.0/, but its
> >     required in my /usr/local/ configuration ?
> This is a bug.  Until we find a better way, I'm going to have to
> export these two files as well in the make install stage.  Thanks for
> pointing this out!  I've just committed a fix  (please test if you
> have a moment).
  
  just running `cvs update` now ;)

> Greetings, and thanks for this!  I haven't gone over the code yet, but
> I think you are amining at a persistent dlopen load, yes?  Can you
> elaborate on "have to be rewritten to use the dynamic elf bindings?"

  normal call of libm/cos would be :

(defCfun "double call_cos(double rad)" 0 " return ( cos(rad) ); " )
(defentry static-cos (double) (double call_cos))

  now those bindings need to change, if using the gcl-elf-loader, like :

(elf::use-lib 'libm "libm.so.6")

(defCfun "double call_d1d(int prt, double rad)" 0
  "double (*callptr)(double); callptr=prt; return ( (*callptr)(rad) );" )
(defentry call-d1d (int double) (double call_d1d))

(defun dyn-sin (rad) (call-d1d (elf::use-sym 'libm '|sin|) rad))
(defun dyn-cos (rad) (call-d1d (elf::use-sym 'libm '|cos|) rad))
(defun dyn-tan (rad) (call-d1d (elf::use-sym 'libm '|tan|) rad))
(defun dyn-asin (rad) (call-d1d (elf::use-sym 'libm '|asin|) rad))
(defun dyn-acos (rad) (call-d1d (elf::use-sym 'libm '|acos|) rad))
(defun dyn-atan (rad) (call-d1d (elf::use-sym 'libm '|atan|) rad))
  
  So the file could be compile and linked by the bfd loader, as it
  does'nt contain any external references, but only references back
  to the static linked elf::use-lib and elf::use-sym. This could be
  done since 2.6.0, when bfd loading on linux/i386/elf was improved.
  
  The libraries are not realy persistent, but the package provides
  its own elf::save-system, that is raising a flag, to re'dlopen the
  libraries. The other drawback is of course speed, as every call
  of (dyn-cos would run a lot of lisp to constrain state.

  <vapor:ware comming="rsn">
  The syntax of using the elf-loader will be improved by a macro.
  This macro will be able to produce both kind of bindings, to
  provide backward compatibility for linking a static gcl.
  </vapor:ware>

Bye Michael
-- 
  mailto:address@hidden             UNA:+.? 'CED+2+:::Linux:2.4.22'UNZ+1'
  http://www.xml-edifact.org/           CETERUM CENSEO WINDOWS ESSE DELENDAM




reply via email to

[Prev in Thread] Current Thread [Next in Thread]