Skip to content

Commit

Permalink
Added TinyCC example readme
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDan64 committed Jan 15, 2019
1 parent 5aaa897 commit 89c2a12
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 2 deletions.
1 change: 0 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
[submodule "examples/tmux/repo"]
path = examples/tmux/repo
url = git@github.com:immunant/tmux-rs.git

[submodule "examples/tinycc/repo"]
path = examples/tinycc/repo
url = git@github.com:immunant/tinycc-rs.git
33 changes: 33 additions & 0 deletions examples/tinycc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# tinycc

## Checking out the tcc sources

In `path/to/examples/tinycc`, initialize the git submodule:

`git submodule update --init repo`

## Create a Makefile

in `tinycc/repo`:

`./configure`

## Create a compile_commands.json

in `tinycc/repo`:

`intercept-build make` or `bear make`

If your `compile_commands.json` enables optimizations(`-O2`, `-O3`, etc) you will need to remove them so that unsupported compiler_builtins are less likely to be generated and leave you in an uncompilable state.

Run `rm *.o` here to get rid of gcc generated staticlibs or else you may see `CRITICAL:root:error: some ELF objects were not compiled with clang:` in the next step

## Generate Rust Code

in `tinycc`:

`./translate.py` to translate all required c files into the `tinycc/repo/rust/src` directory.

## Run tinycc

Run `cargo run` to build and execute tinycc.
2 changes: 1 addition & 1 deletion examples/tinycc/repo
Submodule repo updated 2 files
+1 −1 libtcc.c
+1 −1 tcc.h

0 comments on commit 89c2a12

Please sign in to comment.