A rust implementation of libsysy, the static link library with i/o and timer of SysY, a subset of c language for cscc compiler competition.
To build the library, run cargo build -r
and the artifact is at target/release/libsysy.a
. To link with c or assambly code, run gcc -static -o <binary> <c source/assembly code> libsysy.a
and get a static-linked executable binary.
There is an example, enter example
directory and execute ./run.sh
to run the example.
- Fully compatible with the official libsysy in C
libc
api calls in rust- Data transfer between rust and c via raw pointer and
unsafe
- Module constructor and destructor in rust with
ctor
crate