[Openmcl-devel] cross-compiling for ia32

Gary Byers gb at clozure.com
Thu Nov 8 22:43:10 PST 2007


I don't know what Matt's init file looks like, but ...

[~] gb at clozure> cat openmcl-init.lisp
(ccl:set-development-environment)
[~] gb at clozure>

I'm not sure how much of the build process expects this, but some of
the errors that you got suggest that some parts expect/assume that
you're in the CCL package with redefinition warnings/cerrors disabled.

On Fri, 9 Nov 2007, Greg Pfeil wrote:

> On 8 Nov 2007, at 21:53, R. Matthew Emerson wrote:
>
>> On Nov 8, 2007, at 7:30 PM, Greg Pfeil wrote:
>> 
>>> I figured I’d poke around with the ia32 branch of CCL, and started trying 
>>> to get a cross-compiler going, using the docs here: 
>>> http://trac.clozure.com/openmcl/wiki/PortToIA-32#Bootstrappingnotes
>>> 
>>> It took me way too long to realize that the problem I’m having is not 
>>> because the docs are wrong, but because they assume I’m building on an 
>>> x86-64 machine. I only have PPC and x86-32 on hand.
>>> 
>>> So, is there any way for me to go about building a cross-compiler for 
>>> x86-32 on PPC, or do I need to buy a new laptop in order to port CCL to my 
>>> old laptop?
>> 
>> 
>> Well, that's a good question.  In principle, it should be possible, but 
>> I've never put together all the steps needed to make it work.  I've only 
>> ever used an x86-64 host, as you surmised.  That's partly because my nicest 
>> hardware is an x86-64 system, but also because I figured that it might make 
>> things a little easier to host on a similar architecture.
>
> Yeah, it was the assumption of the "X86" package, etc. already existing that 
> finally clued me in. Having that additional shared code between the 
> architectures must help to some extent. I wrangled an account on a friend’s 
> x86-64, got svn installed, and managed to get a bit farther in the process.
>
> Here's a play-by-play of the issues I ran into. I know how hard it can be to 
> explain stuff when things are in transition and I’m not asking you to 
> dedicate any time to dealing with my issues on this not-even-experimental-yet 
> branch, but thought you might see some obviously-wrong things I’m doing here.
>
> I hit my first problem in the bootstrapping stage:
>
> ? (compile-file "compiler/X86/x862.lisp")
> ;Compiler warnings for 
> "/Users/greg/Documents/sources/ClozureCL/ia32/compiler/X86/x862.lisp" :
> ;   Undeclared free variable X86::*X8632-REGISTER-ENTRIES*, in 
> X86-EMIT-INSTRUCTION-FROM-VINSN.
> ;   Undeclared free variable X86::*X86-OPCODE-TEMPLATES*, in EXPAND-INSN-FORM 
> inside X862-EXPAND-VINSN.
>> Error: The function DEFX862 is predefined in OpenMCL.
>> While executing: REDEFINE-KERNEL-FUNCTION, in process listener(1).
>> Type :GO to continue, :POP to abort, :R for a list of available restarts.
>> If continued: Replace the definition of DEFX862.
>> Type :? for other options.
> 1 >
>
> Should I replace the definition? I end up with a bunch of "predefined in 
> OpenMCL" errors through the load statements as well. x86-lap and x8664 in 
> particular. If I replace all of the dozens of definitions, I get to:
>
> ? (compile-ccl t)
> ...
> ;Compiling 
> "/Users/greg/Documents/sources/ClozureCL/ia32/compiler/X86/X8664/x8664-arch.lisp"...
>> Error: Constant SAVE3.W is already defined with a different value (42)
>> While executing: CCL::DEFINE-CONSTANT, in process listener(1).
>> Type :GO to continue, :POP to abort, :R for a list of available restarts.
>> If continued: Redefine SAVE3.W to have new value 43
>> Type :? for other options.
> 1 >
>
> If I then redefine that (and another similar constant), compilation finishes 
> and I have a bootstrap image.
>
> After making the new full image with (ccl::save-application "dx86.image") and 
> running with that, I get a bunch more of the "predefined in OpenMCL" errors 
> in the LOADs for cross-compiling. Then:
>
> ? (let ((*target-backend* *x8632-backend*))
> (load "ccl:compiler;X86;X8632;x8632-vinsns.lisp"))
> ;Compiler warnings :
> ;   Undeclared free variable *X8632-BACKEND*, in an anonymous lambda form.
> ;   Unused lexical variable *TARGET-BACKEND*, in an anonymous lambda form.
>> Error: Unbound variable: *X8632-BACKEND*
>> While executing: #<Anonymous Function #x30004100F38F>, in process 
>> listener(1).
>> Type :GO to continue, :POP to abort, :R for a list of available restarts.
>> If continued: Retry getting the value of *X8632-BACKEND*.
>> Type :? for other options.
> 1 >
>
> There I just used the value of ccl::*x8632-backend*, but then I ended up at 
> another:
>
> 1 > :c 3
> Invoking restart: Use the value of CCL::*X8632-BACKEND* this time.
>> Error: Unknown DARWINX8632 instruction in (PUSHL (:@ 
>> X8632::MISC-DATA-OFFSET # #))
>> While executing: SIMPLIFY-FORM, in process listener(1).
>> Type :POP to abort, :R for a list of available restarts.
>> Type :? for other options.
> 1 >
>
> Which is as far as I’m getting tonight. Thanks for any insight.
>


More information about the Openmcl-devel mailing list