diff options
| author | Angus Gratton <angus@redyak.com.au> | 2024-08-28 15:39:38 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2024-09-06 17:07:48 +1000 |
| commit | e370999e378bf5040ef6348e2a0720bc3ec4f773 (patch) | |
| tree | 15da0e8974e47288e32d7f53cf16ea9e1734812c | |
| parent | d04974d8d0531f2f868c2d698ec8c44016a0c115 (diff) | |
unix: Add a description of COPT in the README.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
| -rw-r--r-- | ports/unix/README.md | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ports/unix/README.md b/ports/unix/README.md index 648152263..953c83ef7 100644 --- a/ports/unix/README.md +++ b/ports/unix/README.md @@ -142,8 +142,16 @@ By default, builds are stripped of symbols and debug information to save size. To build a debuggable version of the Unix port, there are two options: 1. Run `make [other arguments] DEBUG=1`. Note setting `DEBUG` also reduces the - optimisation level, so it's not a good option for builds that also want the - best performance. + optimisation level and enables assertions, so it's not a good option for + builds that also want the best performance. 2. Run `make [other arguments] STRIP=`. Note that the value of `STRIP` is empty. This will skip the build step that strips symbols and debug information, but changes nothing else in the build configuration. + +### Optimisation Level + +The default compiler optimisation level is -Os, or -Og if `DEBUG=1` is set. + +Setting the variable `COPT` will explicitly set the optimisation level. For +example `make [other arguments] COPT=-O0 DEBUG=1` will build a binary with no +optimisations, assertions enabled, and debug symbols. |
