diff options
Diffstat (limited to 'treeshake_ntranslate')
-rwxr-xr-x | treeshake_ntranslate | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/treeshake_ntranslate b/treeshake_ntranslate new file mode 100755 index 00000000..7a54e436 --- /dev/null +++ b/treeshake_ntranslate @@ -0,0 +1,40 @@ +#!/bin/sh +# Translate SubX by running the minified self-hosted translator natively on Linux. +# This script is a hack; see the other *translate scripts instead. + +set -e + +./build + +cat $* |apps/braces.treeshake.bin > a.braces + +cat a.braces |apps/calls.treeshake.bin > a.calls + +cat a.calls |apps/sigils.treeshake.bin > a.sigils + +cat a.sigils |apps/tests.treeshake.bin > a.tests + +cat a.tests |apps/assort.treeshake.bin > a.assort + +cat a.assort |apps/dquotes.treeshake.bin > a.dquotes + +# A little hack. We want ntranslate to always emit identical binaries to the +# C++ translator. The C++ translator assorts segments before it processes +# string literals, so we follow the same order above. +# +# However, dquotes currently emits a separate data segment for string literals. +# So we need to run assort a second time to clean up after it. +# +# Potential solutions: +# a) modify C++ translator to process string literals before assorting. +# b) clean up dquotes to assume assorted segments, and append to the +# existing data segment. +cat a.dquotes |apps/assort.treeshake.bin > a.assort2 + +cat a.assort2 |apps/pack.treeshake.bin > a.pack + +cat a.pack |apps/survey.treeshake.bin > a.survey + +cat a.survey |apps/hex.treeshake.bin > a.elf + +chmod +x a.elf |