From 1d943da0cf9154e7ce78ce867cdbb91531c5d78e Mon Sep 17 00:00:00 2001 From: Matthew Sotoudeh Date: Tue, 25 Jul 2023 14:58:33 -0700 Subject: initial dietc commit --- docs/DIETCC.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 docs/DIETCC.txt (limited to 'docs/DIETCC.txt') diff --git a/docs/DIETCC.txt b/docs/DIETCC.txt new file mode 100644 index 0000000..2b3762f --- /dev/null +++ b/docs/DIETCC.txt @@ -0,0 +1,19 @@ +The basic idea is to replace + + gcc ... file.c ... + +with + + gcc -E ... file.c ... -o preproc.c + dietc preproc.c > diet.c + pass1 diet.c > diet.c + pass2 diet.c > diet.c + ... + gcc ... diet.c ... + +To assist with this, we provide `scripts/dietcc`, which provides a drop-in +replacement for `gcc` that can run your patches. In your build scripts, simply +replace `gcc` with the path of `dietcc`. + +You can insert your own compilation pass into dietcc; read its Python source +for examples. -- cgit v1.2.3