diff options
author | George Liakopoulos <giwrgosliak_1998@hotmail.com> | 2021-03-15 17:34:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-15 15:34:08 +0000 |
commit | fbe9e08d952187cb70e71d284ce1e4cd50a302fe (patch) | |
tree | 6668e3118201b82a8c40c2a1b931bfbea73262a1 | |
parent | 73c0f6ab2ba2c1181aa757e2478bdeedc85a7269 (diff) | |
download | gcc-fbe9e08d952187cb70e71d284ce1e4cd50a302fe.zip gcc-fbe9e08d952187cb70e71d284ce1e4cd50a302fe.tar.gz gcc-fbe9e08d952187cb70e71d284ce1e4cd50a302fe.tar.bz2 |
Add more examples for compiler usage via Docker
Add examples to create an executable, emit assembly and emit the internal debug outputs from the compiler.
Fixes #279
-rw-r--r-- | README.md | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -88,11 +88,37 @@ Or you can build your own image: ```bash $ docker build . -t gccrs-dev +``` +If you want to build an object file: + +```bash $ docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp \ gccrs-dev:latest gccrs -g -O2 -c \ gcc/testsuite/rust.test/compilable/type_infer1.rs -o type_infer1.o ``` +If you want to build an executable file: +```bash +$ docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp \ + gccrs-dev:latest gccrs -g -O2 \ + gcc/testsuite/rust.test/compilable/type_infer1.rs -o type_infer1 +``` + +To emit assembly : +```bash +$ docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp \ + gccrs-dev:latest gccrs -g -O2 \ + gcc/testsuite/rust.test/compilable/type_infer1.rs -S -o type_infer1.s +``` + +To emit the debug outputs you can add the option -frust-dump-all : +```bash +$ docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp \ + gccrs-dev:latest gccrs -g -O2 \ + gcc/testsuite/rust.test/compilable/type_infer1.rs -o type_infer1 -frust-dump-all +``` + + ## Contributing Please be aware this project is designed to be pushed upstream to GCC when we reach some milestones, and this means we require |