Deploy tool can now strip out libc debugging

release
Slava Pestov 2007-11-03 15:42:30 -04:00
parent 83190f4680
commit 8584e7e95d
3 changed files with 23 additions and 4 deletions

View File

@ -37,8 +37,8 @@ IN: tools.deploy
"" ""
deploy-math? get " math" ?append deploy-math? get " math" ?append
deploy-compiler? get " compiler" ?append deploy-compiler? get " compiler" ?append
native-io? " io" ?append
deploy-ui? get " ui" ?append deploy-ui? get " ui" ?append
native-io? " io" ?append
] bind ; ] bind ;
: deploy-command-line ( vm image vocab config -- vm flags ) : deploy-command-line ( vm image vocab config -- vm flags )
@ -49,7 +49,7 @@ IN: tools.deploy
"\"-output-image=" swap "\"" 3append , "\"-output-image=" swap "\"" 3append ,
"-no-stack-traces" , ! "-no-stack-traces" ,
"-no-user-init" , "-no-user-init" ,
] { } make ; ] { } make ;

View File

@ -5,7 +5,7 @@ assocs kernel vocabs words sequences memory io system arrays
continuations math definitions mirrors splitting parser classes continuations math definitions mirrors splitting parser classes
inspector layouts vocabs.loader prettyprint.config prettyprint inspector layouts vocabs.loader prettyprint.config prettyprint
debugger io.streams.c io.streams.duplex io.files io.backend debugger io.streams.c io.streams.duplex io.files io.backend
quotations words.private tools.deploy.config ; quotations words.private tools.deploy.config compiler ;
IN: tools.deploy.shaker IN: tools.deploy.shaker
: show ( msg -- ) : show ( msg -- )
@ -23,6 +23,15 @@ IN: tools.deploy.shaker
"Stripping debugger" show "Stripping debugger" show
"resource:extra/tools/deploy/shaker/strip-debugger.factor" "resource:extra/tools/deploy/shaker/strip-debugger.factor"
run-file run-file
recompile
] when ;
: strip-libc ( -- )
"libc" vocab [
"Stripping manual memory management debug code" show
"resource:extra/tools/deploy/shaker/strip-libc.factor"
run-file
recompile
] when ; ] when ;
: strip-cocoa ( -- ) : strip-cocoa ( -- )
@ -30,6 +39,7 @@ IN: tools.deploy.shaker
"Stripping unused Cocoa methods" show "Stripping unused Cocoa methods" show
"resource:extra/tools/deploy/shaker/strip-cocoa.factor" "resource:extra/tools/deploy/shaker/strip-cocoa.factor"
run-file run-file
recompile
] when ; ] when ;
: strip-assoc ( retained-keys assoc -- newassoc ) : strip-assoc ( retained-keys assoc -- newassoc )
@ -126,7 +136,7 @@ SYMBOL: deploy-vocab
} % } %
] unless ] unless
deploy-c-types? get deploy-ui? get or [ deploy-c-types? get [
"c-types" "alien.c-types" lookup , "c-types" "alien.c-types" lookup ,
] when ] when
@ -141,6 +151,7 @@ SYMBOL: deploy-vocab
] { } make dup . ; ] { } make dup . ;
: strip ( -- ) : strip ( -- )
strip-libc
strip-cocoa strip-cocoa
strip-debugger strip-debugger
strip-init-hooks strip-init-hooks

View File

@ -0,0 +1,8 @@
USING: libc.private ;
IN: libc
: malloc (malloc) ;
: free (free) ;
: realloc (realloc) ;