You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve standard library linking and variable typing process, to make it fully adaptive to any function/variable and not hardcoded.
- Added a new `shim-metadata-gen` crate to automatically generate JSON metadata (added to Makefile) for shim methods in the compiled stdlib JAR, which is used through include_bytes! to allow the codegen backend to use it.
- Added types to OOMIR variables and modified lower1 to provide this info and lower2 to use this to actually use the appropriate instructions for different types and deal with variables in the correct way.
- Removed unsigned types from OOMIR and adjusted type mappings accordingly, as the JVM doesn't support them (this means we deal with u -> i coversion at the lower1 stage, which is more idiomatic to do this at then lower2).
* ✅ Calling other `static` functions within the same crate (including recursion).
39
39
* ✅ Basic variable assignment (`let x = y;`).
40
+
* ✅ Arrays and slices.
40
41
* ✅ Generating executable `.jar` files for binary crates.
41
42
42
43
### Next Milestone:
@@ -62,10 +63,6 @@ This backend currently supports a subset of Rust features:
62
63
```bash
63
64
# Using Make
64
65
make all
65
-
66
-
# OR Using the build script
67
-
chmod +x build.sh
68
-
./build.sh
69
66
```
70
67
* This will:
71
68
* Build the main `rustc_codegen_jvm` library (`target/debug/librustc_codegen_jvm.dylib`).
@@ -113,7 +110,7 @@ To compile *your own* Rust project using this backend:
113
110
114
111
This project includes integration tests managed by a Python script.
115
112
116
-
1. **Ensure Toolchain is Built:** Build the project using `make all` or `./build.sh`.
113
+
1. **Ensure Toolchain is Built:** Build the project using `make all`.
117
114
2. **Check Target JSON:** Make sure the `jvm-unknown-unknown.json` file in the *root* of this repository has the **relative paths** starting with `../../../`for the linker and backend, as the tester expects this structure when running tests from subdirectories. If you changed them to absolute paths for external use, change them back temporarily.
118
115
3. **Run the Tester:**
119
116
```bash
@@ -135,9 +132,11 @@ This project includes integration tests managed by a Python script.
135
132
*`tests/`: Integration tests.
136
133
*`binary/`: Tests for compiling executable Rust crates.
137
134
*`library/`: Source code for a minimal Kotlin-based implementation of the Rust core library. This serves as a temporary substitute to bootstrap the project until the backend can fully compile the Rust core library itself.
135
+
*`shim-metadata-gen`: A tool forgenerating metadata for the Kotlin core library, called at compiletime to provide nessecary info (descriptors) to the codegen backend. It's generated metadata is embeddedin the generated library, so not needed at runtime.
136
+
*`core.json`: Metadata for the core library, generated by this tool.
138
137
*`jvm-unknown-unknown.json`: The Rust target specification file.
139
138
*`Tester.py`: Python script for running integration tests.
140
-
*`Makefile`, `build.sh`: Scripts for building the entire toolchain.
139
+
*`Makefile` Scripts for building the entire toolchain.
141
140
*`setup.sh`: Script to install Rust components.
142
141
*`Cargo.toml`, `Cargo.lock`: Rust package definition and dependencies for the backend.
0 commit comments