cli: add --emit-exe (+ --emit-exe-nyrt/--emit-exe-libs) to build native exe via ny-llvmc; docs updated

This commit is contained in:
Selfhosting Dev
2025-09-18 04:23:11 +09:00
parent 38f707727e
commit df66ea3ecb
5 changed files with 115 additions and 1 deletions

View File

@ -37,9 +37,12 @@ WiringRust 側)
2) `python3 tools/llvmlite_harness.py --in <mir.json> --out <obj.o>` を起動
3) 成功後は通常のリンク手順NyRT とリンク)
Tools統合フロー
Tools / CLI(統合フロー)
- crate 直結の EXE 出力: `NYASH_LLVM_COMPILER=crate NYASH_LLVM_EMIT=exe tools/build_llvm.sh apps/tests/ternary_basic.nyash -o app`
- 環境変数 `NYASH_LLVM_NYRT` で NyRT の場所を、`NYASH_LLVM_LIBS` で追加フラグを指定できる。
- CLI から直接 EXE 出力(新規):
- `./target/release/nyash --emit-exe tmp/app --backend mir apps/tests/ternary_basic.nyash`
- 追加オプション: `--emit-exe-nyrt <dir>` / `--emit-exe-libs "<flags>"`
ScopePhase 15
- 最小命令: Const/BinOp/Compare/Phi/Branch/Jump/Return

View File

@ -20,6 +20,7 @@ CI Workflows
2) EXE 生成: `./target/release/ny-llvmc --in tmp/app.json --emit exe --nyrt target/release --out tmp/app`
3) 実行: `./tmp/app`(戻り値が exit code
- ワンコマンドスモーク: `bash tools/crate_exe_smoke.sh apps/tests/ternary_basic.nyash`
- CLI で直接 EXE 出力: `./target/release/nyash --emit-exe tmp/app --backend mir apps/tests/ternary_basic.nyash`
- Installs LLVM 18 + llvmlite, then runs `tools/exe_first_smoke.sh`.
Useful Env Flags