From: William H. N. <wil...@ai...> - 2001-02-22 13:39:06
|
On Thu, Feb 22, 2001 at 01:23:19PM +0100, Rudolf Schlatte wrote: > I have sketched some code, but nothing compilable yet. In march, I > will have some more time to work on it. Could this C runtime, as soon > as it's written, read a SBCL core file generated on Linux, assuming > the correct lisp.h was linked in? It depends on what you mean. If you mean could you take the core file you're running now and use it on Windows, the answer is almost certainly "no": 1. SBCL needs to know the sbcl.nm link map at GENESIS time, because it implements calls to runtime functions by jumping to the address read from the nm file at this time. In order to make the core work, you'd need to arrange for every C address which the core references directly to be in the exact same location in Windows as it was at GENESIS time on Linux. This would be much, much more trouble than it's worth. 2. SBCL also needs to know the overall memory map at build time, because things like the location of NIL and the boundaries of the GCable spaces get hardwired into the code. It is unlikely that the memory map on Windows can be made identical to the memory map on Linux. 3. Various things, e.g. (SIN X), get inlined into native calls into the C library. You'd need the exact same functions, with the exact same calling convention. 4. Several OS-interface files, especially unix.lisp, work by hand-copying constants and structure layouts from system header files. It is unlikely that these are the same on Windows. If you want to use Linux to generate a core file specifically for Windows, it's less hopeless, though still unlikely. Problem #1 disappears if you take the nm file generated by Windows for the new Windows runtime, copy it to Linux, use it as input for GENESIS, and copy the resulting core file back to Windows. Problem #2 disappears if you tell GENESIS about the Windows memory map. With problems #1 and #2 gone, there's some small chance that the core file might work, at least a little bit. But I expect you'd still need to do some work, and probably a significant amount of work, to address problems #3 and #4. -- William Harold Newman <wil...@ai...> software consultant PGP key fingerprint 85 CE 1C BA 79 8D 51 8C B9 25 FB EE E0 C3 E5 7C |