Skip to content
This repository was archived by the owner on Aug 13, 2025. It is now read-only.

Commit 3f78ddd

Browse files
whatever
PiperOrigin-RevId: 614416114
1 parent 5a9d9e7 commit 3f78ddd

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

elfconvert.sh

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,28 @@ case $SAR_ARGV0 in
1111
*) sbcl_subdir=k8
1212
esac
1313
sbcl=$RUNFILES/google3/third_party/lisp/sbcl/binary-distribution/$sbcl_subdir/bin/sbcl
14-
args=(--noinform --dynamic-space-size 512MB)
14+
args=(--noinform --dynamic-space-size 1GB)
1515
mode='(setq *evaluator-mode* :compile)'
1616
script=$RUNFILES/google3/third_party/lisp/sbcl/src/tools-for-build/elftool
1717

1818
action=$1
1919
input=$2
2020
output=$3
2121

22+
compactcore=/tmp/compact-$$.core
23+
tmpcore=/tmp/patched-$$.core
24+
DSS=16384
25+
2226
case $action in
2327
split)
24-
exec $sbcl ${args[@]} --eval "$mode" --load $script --eval \
25-
'(sb-editcore:split-core "'$input'" "'$output'")' --quit ;;
28+
exec $sbcl ${args[@]} --eval "$mode" --load $script \
29+
--eval '(sb-editcore:reorganize-core "'$input'" "'$compactcore'")' \
30+
--eval '(sb-editcore:move-dynamic-code-to-text-space "'$compactcore'" "'$tmpcore'")' \
31+
--eval '(delete-file "'$compactcore'")' \
32+
--eval '(sb-editcore:redirect-text-space-calls "'$tmpcore'")' \
33+
--eval '(sb-editcore:split-core "'$tmpcore'" "'$output'" :dynamic-space-size '$DSS')' \
34+
--eval '(delete-file "'$tmpcore'")' --quit ;;
35+
2636
copy)
2737
exec $sbcl ${args[@]} --eval "$mode" --load $script --eval \
2838
'(sb-editcore::copy-to-elf-obj "'$input'" "'$output'")' --quit ;;

0 commit comments

Comments
 (0)