@@ -15,27 +15,53 @@ This target is cross-compiled. There are no special requirements for the host.
1515
1616Motor OS uses the ELF file format.
1717
18- ## Building the target  
18+ ## Building the target toolchain   
1919
20- The target can be built by enabling it for a ` rustc `  build, for example:
20+ Motor OS target toolchain can be
21+ [ built using ` x.py ` ] ( https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html ) :
22+ 
23+ The bootstrap file:
2124
2225``` toml 
26+ #  bootstrap.toml
27+ # 
28+ #  Place it in the root of rust-lang/rust repo.
29+ 
30+ change-id  = 146458 
31+ 
32+ profile  = " library" 
33+ 
2334[build ]
24- build-stage  = 2 
25- target  = [" x86_64-unknown-motor" 
35+ host  = [" x86_64-unknown-linux-gnu" 
36+ target  = [" x86_64-unknown-linux-gnu" " x86_64-unknown-motor" 
37+ 
38+ [rust ]
39+ deny-warnings  = false 
40+ incremental  = true 
41+ ``` 
42+ 
43+ The build command:
44+ 
45+ ``` sh 
46+ $ cd  $MOTORH /rust
47+ $ TARGET=x86_64-unknown-motor \
48+     CARGO_CFG_TARGET_ARCH=x86_64 \
49+     CARGO_CFG_TARGET_VENDOR=unknown \
50+     CARGO_CFG_TARGET_OS=motor \
51+     CARGO_CFG_TARGET_ENV=" " 
52+     ./x.py build --stage 2 clippy library
2653``` 
2754
2855## Building Rust programs  
2956
30- Rust standard library is fully supported/implemented, but is not yet part of
31- the official Rust repo, so an out-of-tree building process should be
32- followed, as described in the
33- [ build doc] ( https://github.com/moturus/motor-os/blob/main/docs/build.md ) .
57+ See the [ Hello Motor OS] ( https://github.com/moturus/motor-os/blob/main/docs/recipes/hello-motor-os.md ) 
58+ example.
3459
3560## Testing  
3661
3762Cross-compiled Rust binaries and test artifacts can be executed in Motor OS VMs,
38- as described in e.g.
63+ as described in the [ build doc] ( https://github.com/moturus/motor-os/blob/main/docs/build.md ) 
64+ and the
3965[ Hello Motor OS] ( https://github.com/moturus/motor-os/blob/main/docs/recipes/hello-motor-os.md ) 
4066example.
4167
0 commit comments