Re: problems in compiler

Mark Evenson <[email protected]> Fri, 29 Mar 2019 17:55:42 +0100
Newsgroups gmane.editors.j.devel
Message-ID <3E538799-7B3C-4088-B398-4DB80FFAD754__13622.2544287861$1553878623$gmane$org@panix.com>
> On Mar 15, 2019, at 09:13, Don Cohen <[email protected]> wrote:
> 
> --text follows this line--
> 
> The version of ap5 from 2009 supposedly was able to build in the abcl
> of that time.  I'm now trying to make a more recent ap5 (but not
> very much changed) build in current abcl.  I've put the current source
> at http://ap5.com/ under ap5-2019.zip so that others who are willing to
> help can reproduce the problem.  Unfortunately I don't have a small 
> example, only a large one.

It took a little while to approach the AP5 code, but I managed to hack together
the attached patch for ABCL which allows the AP5 build strategy to succeed.

I still don't fully understand the AP5 compilation procedure but somehow it
trips up a leaky abstraction in the ABCL compiler which computes 
SYSTEM::*FASL-UNINTERNED-SYMBOLS* as an alist as it finds uninterned symbols,
but then serializes it as a vector when finished.

The attached patch contains a provisional hack to the ABCL compiler which
computes the alist form from the vector form rather than signalling an error,
so in order to use ABCL with AP5, you will have to build ABCL from source.

To truly fix this one would have to understand the AP5 compilation strategy  better, and then probably adjust the compiler's use of specials.

I am unsure how this ever worked in the past, but 2009 was a long time ago,
even for ABCL.

Note that while I have filed [ticket 463][463] with regards to this issue, I am
not currently inclined to prioritize resolving this issue in the ABCL source without a distillation of a simple example outside the AP5 source. 

[463]: https://abcl.org/trac/ticket/463



-- 
"A screaming comes across the sky.  It has happened before but there is nothing 
to compare to it now."
compiler-ap5.diff (application/octet-stream, 1.2 KB)
# HG changeset patch
# Parent  2f6848814e69c82931e58a03bf04fbd212398893
AP5 compilation process has problems

<https://abcl.org/trac/ticket/463>


<https://mailman.common-lisp.net/pipermail/armedbear-devel/2019-March/003967.html>

diff -r 2f6848814e69 src/org/armedbear/lisp/dump-form.lisp
--- a/src/org/armedbear/lisp/dump-form.lisp	Fri Mar 29 15:09:05 2019 +0100
+++ b/src/org/armedbear/lisp/dump-form.lisp	Fri Mar 29 17:18:35 2019 +0100
@@ -169,13 +169,19 @@
 
 (declaim (ftype (function (symbol) integer) dump-uninterned-symbol-index))
 (defun dump-uninterned-symbol-index (symbol)
+  ;;; HACK Convert vector form to assoc list
+  (when (vectorp *fasl-uninterned-symbols*)
+    (setq *fasl-uninterned-symbols*
+          (loop
+             :for index :upfrom 0
+             :for symbol :across *fasl-uninterned-symbols*
+               :collecting (cons symbol index))))
   (let ((index (cdr (assoc symbol *fasl-uninterned-symbols*))))
     (unless index
       (setq index (1+ (or (cdar *fasl-uninterned-symbols*) -1)))
       (setq *fasl-uninterned-symbols*
             (acons symbol index *fasl-uninterned-symbols*)))
     index))
-
 (declaim (ftype (function (pathname stream) t) dump-pathname))
 (defun dump-pathname (pathname stream)
   (write-string "#P(" stream)