diff options
author | Andrew Clayton <a.clayton@nginx.com> | 2024-03-02 03:45:00 +0000 |
---|---|---|
committer | Andrew Clayton <a.clayton@nginx.com> | 2024-03-09 01:40:18 +0000 |
commit | 15072fbde9b7d451aa4fde815d59a7454604036c (patch) | |
tree | be0fa59e91e2c8da70ae743be0cdb8dbee701a55 /auto/cc | |
parent | b763ba7eccf9abbd2bc7a52050c051c4842e8f9e (diff) | |
download | unit-15072fbde9b7d451aa4fde815d59a7454604036c.tar.gz unit-15072fbde9b7d451aa4fde815d59a7454604036c.tar.bz2 |
Enable optional 'debuggable' builds
One issue you have when trying to debug Unit under say GDB is that at
the default optimisation level we use of -O (-O1) the compiler will
often optimise things out which means they are not available for
inspection in the debugger.
This patch allows you to pass 'D=1' to make, e.g
$ make D=1 ...
Which will set -O0 overriding the previously set -O, basically disabling
optimisations, we could use -Og, but the clang(1) man page says this is
best and it seems to not cause any issues when debugging GCC generated
code.
Co-developed-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
Diffstat (limited to 'auto/cc')
-rw-r--r-- | auto/cc/test | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/auto/cc/test b/auto/cc/test index 5bd94d2f..4d6d5a43 100644 --- a/auto/cc/test +++ b/auto/cc/test @@ -71,7 +71,6 @@ case $NXT_CC_NAME in #NXT_CFLAGS="$NXT_CFLAGS -std=gnu99" NXT_CFLAGS="$NXT_CFLAGS -O" - #NXT_CFLAGS="$NXT_CFLAGS -O0" NXT_CFLAGS="$NXT_CFLAGS -Wall -Wextra" #NXT_CFLAGS="$NXT_CFLAGS -Wunused-result" @@ -112,7 +111,6 @@ case $NXT_CC_NAME in NXT_CFLAGS="$NXT_CFLAGS -fno-strict-overflow" NXT_CFLAGS="$NXT_CFLAGS -O" - #NXT_CFLAGS="$NXT_CFLAGS -O0" NXT_CFLAGS="$NXT_CFLAGS -Wall -Wextra" #NXT_CFLAGS="$NXT_CFLAGS -Wunused-result" |