Skip to content

Commit

Permalink
whatever
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 614392351
  • Loading branch information
common-lisp-dev-copybara authored and copybara-github committed Mar 21, 2024
1 parent 0b45052 commit ba07b6f
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions elfconvert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,28 @@ case $SAR_ARGV0 in
*) sbcl_subdir=k8
esac
sbcl=$RUNFILES/google3/third_party/lisp/sbcl/binary-distribution/$sbcl_subdir/bin/sbcl
args=(--noinform --dynamic-space-size 512MB)
args=(--noinform --dynamic-space-size 1GB)
mode='(setq *evaluator-mode* :compile)'
script=$RUNFILES/google3/third_party/lisp/sbcl/src/tools-for-build/elftool

action=$1
input=$2
output=$3

compactcore=/tmp/compact-$$.core
tmpcore=/tmp/patched-$$.core
DSS=16384

case $action in
split)
exec $sbcl ${args[@]} --eval "$mode" --load $script --eval \
'(sb-editcore:split-core "'$input'" "'$output'")' --quit ;;
exec $sbcl ${args[@]} --eval "$mode" --load $script \
--eval '(sb-editcore:reorganize-core "'$input'" "'$compactcore'")' \
--eval '(sb-editcore:move-dynamic-code-to-text-space "'$compactcore'" "'$tmpcore'")' \
--eval '(delete-file "'$compactcore'")' \
--eval '(sb-editcore:redirect-text-space-calls "'$tmpcore'")' \
--eval '(sb-editcore:split-core "'$tmpcore'" "'$output'" :dynamic-space-size '$DSS')' \
--eval '(delete-file "'$tmpcore'")' --quit ;;

copy)
exec $sbcl ${args[@]} --eval "$mode" --load $script --eval \
'(sb-editcore::copy-to-elf-obj "'$input'" "'$output'")' --quit ;;
Expand Down

0 comments on commit ba07b6f

Please sign in to comment.