Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cmucl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Carl Shapiro
cmucl
Commits
694b19ff
Commit
694b19ff
authored
20 years ago
by
pmai
Browse files
Options
Downloads
Patches
Plain Diff
Added example cross-compile scripts for x86 to ppc and ppc to ppc.
parent
2ff25623
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tools/cross-scripts/cross-ppc-ppc-darwin.lisp
+179
-0
179 additions, 0 deletions
tools/cross-scripts/cross-ppc-ppc-darwin.lisp
tools/cross-scripts/cross-x86-ppc-darwin.lisp
+179
-0
179 additions, 0 deletions
tools/cross-scripts/cross-x86-ppc-darwin.lisp
with
358 additions
and
0 deletions
tools/cross-scripts/cross-ppc-ppc-darwin.lisp
0 → 100644
+
179
−
0
View file @
694b19ff
(
in-package
:cl-user
)
;;; Rename the X86 package and backend so that new-backend does the
;;; right thing.
(
rename-package
"PPC"
"OLD-PPC"
)
(
setf
(
c:backend-name
c:*native-backend*
)
"OLD-PPC"
)
(
c::new-backend
"PPC"
;; Features to add here
'
(
:ppc
:conservative-float-type
:hash-new
:random-mt19937
:darwin
:bsd
:cmu
:cmu18
:cmu18e
)
;; Features to remove from current *features* here
'
(
:x86-bootstrap
:alpha
:osf1
:mips
:x86
:i486
:pentium
:ppro
:propagate-fun-type
:propagate-float-type
:constrain-float-type
:openbsd
:freebsd
:glibc2
:linux
:pentium
:linkage-table
:elf
:mp
:stack-checking
:heap-overflow-check
:gencgc
:cgc
:long-float
:new-random
:small
))
;;; Extern-alien-name for the new backend.
(
in-package
:vm
)
(
defun
extern-alien-name
(
name
)
(
declare
(
type
simple-string
name
))
(
concatenate
'string
"_"
name
))
(
export
'extern-alien-name
)
(
export
'fixup-code-object
)
(
export
'sanctify-for-execution
)
;;; Compile the new backend.
(
pushnew
:bootstrap
*features*
)
(
pushnew
:building-cross-compiler
*features*
)
(
load
"target:tools/comcom"
)
;;; Load the new backend.
(
setf
(
search-list
"c:"
)
'
(
"target:compiler/"
))
(
setf
(
search-list
"vm:"
)
'
(
"c:ppc/"
"c:generic/"
))
(
setf
(
search-list
"assem:"
)
'
(
"target:assembly/"
"target:assembly/ppc/"
))
;; Load the backend of the compiler.
(
in-package
"C"
)
(
load
"vm:vm-macs"
)
(
load
"vm:parms"
)
(
load
"vm:objdef"
)
(
load
"vm:interr"
)
(
load
"assem:support"
)
(
load
"target:compiler/srctran"
)
(
load
"vm:vm-typetran"
)
(
load
"target:compiler/float-tran"
)
(
load
"target:compiler/saptran"
)
(
load
"vm:macros"
)
(
load
"vm:utils"
)
(
load
"vm:vm"
)
(
load
"vm:insts"
)
(
load
"vm:primtype"
)
(
load
"vm:move"
)
(
load
"vm:sap"
)
(
load
"vm:system"
)
(
load
"vm:char"
)
(
load
"vm:float"
)
(
load
"vm:memory"
)
(
load
"vm:static-fn"
)
(
load
"vm:arith"
)
(
load
"vm:cell"
)
(
load
"vm:subprim"
)
(
load
"vm:debug"
)
(
load
"vm:c-call"
)
(
load
"vm:print"
)
(
load
"vm:alloc"
)
(
load
"vm:call"
)
(
load
"vm:nlx"
)
(
load
"vm:values"
)
(
load
"vm:array"
)
(
load
"vm:pred"
)
(
load
"vm:type-vops"
)
(
load
"assem:assem-rtns"
)
(
load
"assem:array"
)
(
load
"assem:arith"
)
(
load
"assem:alloc"
)
(
load
"c:pseudo-vops"
)
(
check-move-function-consistency
)
(
load
"vm:new-genesis"
)
;;; OK, the cross compiler backend is loaded.
(
setf
*features*
(
remove
:building-cross-compiler
*features*
))
;;; Info environment hacks.
(
macrolet
((
frob
(
&rest
syms
)
`
(
progn
,@
(
mapcar
#'
(
lambda
(
sym
)
`
(
defconstant
,
sym
(
symbol-value
(
find-symbol
,
(
symbol-name
sym
)
:vm
))))
syms
))))
(
frob
OLD-PPC:BYTE-BITS
OLD-PPC:WORD-BITS
#+
long-float
OLD-PPC:SIMPLE-ARRAY-LONG-FLOAT-TYPE
OLD-PPC:SIMPLE-ARRAY-DOUBLE-FLOAT-TYPE
OLD-PPC:SIMPLE-ARRAY-SINGLE-FLOAT-TYPE
#+
long-float
OLD-PPC:SIMPLE-ARRAY-COMPLEX-LONG-FLOAT-TYPE
OLD-PPC:SIMPLE-ARRAY-COMPLEX-DOUBLE-FLOAT-TYPE
OLD-PPC:SIMPLE-ARRAY-COMPLEX-SINGLE-FLOAT-TYPE
OLD-PPC:SIMPLE-ARRAY-UNSIGNED-BYTE-2-TYPE
OLD-PPC:SIMPLE-ARRAY-UNSIGNED-BYTE-4-TYPE
OLD-PPC:SIMPLE-ARRAY-UNSIGNED-BYTE-8-TYPE
OLD-PPC:SIMPLE-ARRAY-UNSIGNED-BYTE-16-TYPE
OLD-PPC:SIMPLE-ARRAY-UNSIGNED-BYTE-32-TYPE
OLD-PPC:SIMPLE-ARRAY-SIGNED-BYTE-8-TYPE
OLD-PPC:SIMPLE-ARRAY-SIGNED-BYTE-16-TYPE
OLD-PPC:SIMPLE-ARRAY-SIGNED-BYTE-30-TYPE
OLD-PPC:SIMPLE-ARRAY-SIGNED-BYTE-32-TYPE
OLD-PPC:SIMPLE-BIT-VECTOR-TYPE
OLD-PPC:SIMPLE-STRING-TYPE
OLD-PPC:SIMPLE-VECTOR-TYPE
OLD-PPC:SIMPLE-ARRAY-TYPE
OLD-PPC:VECTOR-DATA-OFFSET
))
(
let
((
function
(
symbol-function
'kernel:error-number-or-lose
)))
(
let
((
*info-environment*
(
c:backend-info-environment
c:*target-backend*
)))
(
setf
(
symbol-function
'kernel:error-number-or-lose
)
function
)
(
setf
(
info
function
kind
'kernel:error-number-or-lose
)
:function
)
(
setf
(
info
function
where-from
'kernel:error-number-or-lose
)
:defined
)))
(
defun
fix-class
(
name
)
(
let*
((
new-value
(
find-class
name
))
(
new-layout
(
kernel::%class-layout
new-value
))
(
new-cell
(
kernel::find-class-cell
name
))
(
*info-environment*
(
c:backend-info-environment
c:*target-backend*
)))
(
remhash
name
kernel::*forward-referenced-layouts*
)
(
kernel::%note-type-defined
name
)
(
setf
(
info
type
kind
name
)
:instance
)
(
setf
(
info
type
class
name
)
new-cell
)
(
setf
(
info
type
compiler-layout
name
)
new-layout
)
new-value
))
(
fix-class
'c::vop-parse
)
(
fix-class
'c::operand-parse
)
#+
random-mt19937
(
declaim
(
notinline
kernel:random-chunk
))
(
setf
c:*backend*
c:*target-backend*
)
;;; Extern-alien-name for the new backend.
(
in-package
:vm
)
(
defun
extern-alien-name
(
name
)
(
declare
(
type
simple-string
name
))
(
concatenate
'string
"_"
name
))
(
export
'extern-alien-name
)
(
export
'fixup-code-object
)
(
export
'sanctify-for-execution
)
(
in-package
:cl-user
)
;;; Don't load compiler parts from the target compilation
(
defparameter
*load-stuff*
nil
)
;; hack, hack, hack: Make old-x86::any-reg the same as
;; x86::any-reg as an SC. Do this by adding old-x86::any-reg
;; to the hash table with the same value as x86::any-reg.
(
let
((
ht
(
c::backend-sc-names
c::*target-backend*
)))
(
setf
(
gethash
'old-ppc::any-reg
ht
)
(
gethash
'ppc::any-reg
ht
)))
This diff is collapsed.
Click to expand it.
tools/cross-scripts/cross-x86-ppc-darwin.lisp
0 → 100644
+
179
−
0
View file @
694b19ff
(
in-package
:cl-user
)
;;; Rename the X86 package and backend so that new-backend does the
;;; right thing.
(
rename-package
"X86"
"OLD-X86"
)
(
setf
(
c:backend-name
c:*native-backend*
)
"OLD-X86"
)
(
c::new-backend
"PPC"
;; Features to add here
'
(
:ppc
:conservative-float-type
:hash-new
:random-mt19937
:darwin
:bsd
:cmu
:cmu18
:cmu18e
)
;; Features to remove from current *features* here
'
(
:x86-bootstrap
:alpha
:osf1
:mips
:x86
:i486
:pentium
:ppro
:propagate-fun-type
:propagate-float-type
:constrain-float-type
:openbsd
:freebsd
:glibc2
:linux
:pentium
:linkage-table
:elf
:mp
:stack-checking
:heap-overflow-check
:gencgc
:cgc
:long-float
:new-random
:small
))
;;; Extern-alien-name for the new backend.
(
in-package
:vm
)
(
defun
extern-alien-name
(
name
)
(
declare
(
type
simple-string
name
))
(
concatenate
'string
"_"
name
))
(
export
'extern-alien-name
)
(
export
'fixup-code-object
)
(
export
'sanctify-for-execution
)
;;; Compile the new backend.
(
pushnew
:bootstrap
*features*
)
(
pushnew
:building-cross-compiler
*features*
)
(
load
"target:tools/comcom"
)
;;; Load the new backend.
(
setf
(
search-list
"c:"
)
'
(
"target:compiler/"
))
(
setf
(
search-list
"vm:"
)
'
(
"c:ppc/"
"c:generic/"
))
(
setf
(
search-list
"assem:"
)
'
(
"target:assembly/"
"target:assembly/ppc/"
))
;; Load the backend of the compiler.
(
in-package
"C"
)
(
load
"vm:vm-macs"
)
(
load
"vm:parms"
)
(
load
"vm:objdef"
)
(
load
"vm:interr"
)
(
load
"assem:support"
)
(
load
"target:compiler/srctran"
)
(
load
"vm:vm-typetran"
)
(
load
"target:compiler/float-tran"
)
(
load
"target:compiler/saptran"
)
(
load
"vm:macros"
)
(
load
"vm:utils"
)
(
load
"vm:vm"
)
(
load
"vm:insts"
)
(
load
"vm:primtype"
)
(
load
"vm:move"
)
(
load
"vm:sap"
)
(
load
"vm:system"
)
(
load
"vm:char"
)
(
load
"vm:float"
)
(
load
"vm:memory"
)
(
load
"vm:static-fn"
)
(
load
"vm:arith"
)
(
load
"vm:cell"
)
(
load
"vm:subprim"
)
(
load
"vm:debug"
)
(
load
"vm:c-call"
)
(
load
"vm:print"
)
(
load
"vm:alloc"
)
(
load
"vm:call"
)
(
load
"vm:nlx"
)
(
load
"vm:values"
)
(
load
"vm:array"
)
(
load
"vm:pred"
)
(
load
"vm:type-vops"
)
(
load
"assem:assem-rtns"
)
(
load
"assem:array"
)
(
load
"assem:arith"
)
(
load
"assem:alloc"
)
(
load
"c:pseudo-vops"
)
(
check-move-function-consistency
)
(
load
"vm:new-genesis"
)
;;; OK, the cross compiler backend is loaded.
(
setf
*features*
(
remove
:building-cross-compiler
*features*
))
;;; Info environment hacks.
(
macrolet
((
frob
(
&rest
syms
)
`
(
progn
,@
(
mapcar
#'
(
lambda
(
sym
)
`
(
defconstant
,
sym
(
symbol-value
(
find-symbol
,
(
symbol-name
sym
)
:vm
))))
syms
))))
(
frob
OLD-X86:BYTE-BITS
OLD-X86:WORD-BITS
#+
long-float
OLD-X86:SIMPLE-ARRAY-LONG-FLOAT-TYPE
OLD-X86:SIMPLE-ARRAY-DOUBLE-FLOAT-TYPE
OLD-X86:SIMPLE-ARRAY-SINGLE-FLOAT-TYPE
#+
long-float
OLD-X86:SIMPLE-ARRAY-COMPLEX-LONG-FLOAT-TYPE
OLD-X86:SIMPLE-ARRAY-COMPLEX-DOUBLE-FLOAT-TYPE
OLD-X86:SIMPLE-ARRAY-COMPLEX-SINGLE-FLOAT-TYPE
OLD-X86:SIMPLE-ARRAY-UNSIGNED-BYTE-2-TYPE
OLD-X86:SIMPLE-ARRAY-UNSIGNED-BYTE-4-TYPE
OLD-X86:SIMPLE-ARRAY-UNSIGNED-BYTE-8-TYPE
OLD-X86:SIMPLE-ARRAY-UNSIGNED-BYTE-16-TYPE
OLD-X86:SIMPLE-ARRAY-UNSIGNED-BYTE-32-TYPE
OLD-X86:SIMPLE-ARRAY-SIGNED-BYTE-8-TYPE
OLD-X86:SIMPLE-ARRAY-SIGNED-BYTE-16-TYPE
OLD-X86:SIMPLE-ARRAY-SIGNED-BYTE-30-TYPE
OLD-X86:SIMPLE-ARRAY-SIGNED-BYTE-32-TYPE
OLD-X86:SIMPLE-BIT-VECTOR-TYPE
OLD-X86:SIMPLE-STRING-TYPE
OLD-X86:SIMPLE-VECTOR-TYPE
OLD-X86:SIMPLE-ARRAY-TYPE
OLD-X86:VECTOR-DATA-OFFSET
))
(
let
((
function
(
symbol-function
'kernel:error-number-or-lose
)))
(
let
((
*info-environment*
(
c:backend-info-environment
c:*target-backend*
)))
(
setf
(
symbol-function
'kernel:error-number-or-lose
)
function
)
(
setf
(
info
function
kind
'kernel:error-number-or-lose
)
:function
)
(
setf
(
info
function
where-from
'kernel:error-number-or-lose
)
:defined
)))
(
defun
fix-class
(
name
)
(
let*
((
new-value
(
find-class
name
))
(
new-layout
(
kernel::%class-layout
new-value
))
(
new-cell
(
kernel::find-class-cell
name
))
(
*info-environment*
(
c:backend-info-environment
c:*target-backend*
)))
(
remhash
name
kernel::*forward-referenced-layouts*
)
(
kernel::%note-type-defined
name
)
(
setf
(
info
type
kind
name
)
:instance
)
(
setf
(
info
type
class
name
)
new-cell
)
(
setf
(
info
type
compiler-layout
name
)
new-layout
)
new-value
))
(
fix-class
'c::vop-parse
)
(
fix-class
'c::operand-parse
)
#+
random-mt19937
(
declaim
(
notinline
kernel:random-chunk
))
(
setf
c:*backend*
c:*target-backend*
)
;;; Extern-alien-name for the new backend.
(
in-package
:vm
)
(
defun
extern-alien-name
(
name
)
(
declare
(
type
simple-string
name
))
(
concatenate
'string
"_"
name
))
(
export
'extern-alien-name
)
(
export
'fixup-code-object
)
(
export
'sanctify-for-execution
)
(
in-package
:cl-user
)
;;; Don't load compiler parts from the target compilation
(
defparameter
*load-stuff*
nil
)
;; hack, hack, hack: Make old-x86::any-reg the same as
;; x86::any-reg as an SC. Do this by adding old-x86::any-reg
;; to the hash table with the same value as x86::any-reg.
(
let
((
ht
(
c::backend-sc-names
c::*target-backend*
)))
(
setf
(
gethash
'old-x86::any-reg
ht
)
(
gethash
'ppc::any-reg
ht
)))
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment