8000 unix: Add a description of COPT in the README. · cuatrobits/micropython@e370999 · GitHub
[go: up one dir, main page]

Skip to content

Commit e370999

Browse files
projectgusdpgeorge
authored andcommitted
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>
1 parent d04974d commit e370999

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

ports/unix/README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,16 @@ By default, builds are stripped of symbols and debug information to save size.
142142
To build a debuggable version of the Unix port, there are two options:
143143

144144
1. Run `make [other arguments] DEBUG=1`. Note setting `DEBUG` also reduces the
145-
optimisation level, so it's not a good option for builds that also want the
146-
best performance.
145+
optimisation level and enables assertions, so it's not a good option for
146+
builds that also want the best performance.
147147
2. Run `make [other arguments] STRIP=`. Note that the value of `STRIP` is
148148
empty. This will skip the build step that strips symbols and debug
149149
information, but changes nothing else in the build configuration.
150+
151+
### Optimisation Level
152+
153+
The default compiler optimisation level is -Os, or -Og if `DEBUG=1` is set.
154+
155+
Setting the variable `COPT` will explicitly set the optimisation level. For
156+
example `make [other arguments] COPT=-O0 DEBUG=1` will build a binary with no
157+
optimisations, assertions enabled, and debug symbols.

0 commit comments

Comments
 (0)
0