[Ecls-list] Compiler problems

Rolf Wester wester at ilt.fraunhofer.de
Fri Dec 13 06:57:01 UTC 2002


Hi,

I have some problems when compiling/loading lisp code with ECLS 0.8:

I tried the following example code that I found in "ecldev.html".
This compiles but at load-time I get a segmentation fault.

(Clines "

       int tak(x, y, z)
       int x, y, z;
       {      if (y >= x) return(z);
               else return(tak(tak(x-1, y, z),
                               tak(y-1, z, x),
                               tak(z-1, x, y)));
       }
"
)

;;;  TAK calls the C function tak defined above.
(defentry tak (int int int) (int tak))


> (compile-file "c-test.lisp")
			  
;;; Loading "/home/wester/usr/ecls/lib/ecl/cmp.so"
;;; Compiling c-test.lisp.
;;; Compiling (DEFENTRY TAK ...).
;;; The variable TAK is undefined.
;;; The compiler will assume this variable is a global.
;;; The variable INT is undefined.
;;; The compiler will assume this variable is a global.
;;; End of Pass 1.  
;;; Calling the C compiler... 
"gcc -g -O2 -fstrict-aliasing -Dlinux  -O -I/home/wester/usr/ecls/lib/ecl//h -w -c c-test.c -o 
c-test.o" 
"gcc -shared -o c-test.so -L/home/wester/usr/ecls/lib/ecl/ c-test.o  " 
;;; OPTIMIZE levels: Safety=0 (No runtime error checking), Space=0, Speed=3
;;; Finished compiling c-test.lisp.
#P"c-test.so"
> (load "c-test")
;;; Loading "/home/wester/usr/local/cmucl18d/lib/cmucl/lib/mylibs/c-test.so"
Segmentation violation.
Wrong type argument to a compiled function.
Broken at LOAD.
>> 

----------------------------------------------------------------------------------------

The 2. problem is:

(defun get-package-symbols (package &key (describe nil))
  (let ((pack (find-package package)))
	(if (eql nil pack)
		(format "No package ~A~%" package) 
	    (loop for s being each external-symbol of (find-package package) do
		  (if describe
			  (progn (describe s) (terpri) (princ "------------------"))
			  (print s))))))


> (get-package-symbols 'si)
The function #:G119 is undefined.
Broken at GET-PACKAGE-SYMBOLS.

----------------------------------------------------------------------------------------

The 3. Problem occurs when I try to compile "ext.lisp" of the "port"-package 
in the CLOCC. It doesn't compile unless I change the line:

(declare (function f0 f1))

in the function definitions of compose-f and compose-all to:

#-ecl (declare (function f0 f1))

When trying to load "ext.so" I get:

;;; Loading "/home/wester/progs2/clocc/src/port/ext.so"
Segmentation violation.
Wrong type argument to a compiled function.
Broken at LOAD.
PORT>> 



Did I do anything wrong? I would be very appreciative for help.


Kind Regards

Rolf Wester
-------------------------------------
Dr. Rolf Wester
Grundlagen
Fraunhofer Institut fuer Lasertechnik
Steinbachstrasse 15
52074 Aachen
E-Mail: rolf.wester at ilt.fraunhofer.de
Tel.: + 49(0)241 8906 - 401
Fax : + 49(0)241 8906 - 121





More information about the ecl-devel mailing list