Hi Mark,

David Malcolm <dmalc...@redhat.com> wrote:
> On Tue, 2024-07-02 at 22:39 +0200, Mark Wielaard wrote:
> > Is there an "optimal" optimization level for -fanalyzer (like having
> > -Og for debugging)?
>
> There isn't, sorry.

What I do is compile several times in a loop, with all optimization
levels, to maximize diagnostics.

$(_REALNAME): %.so.$(DISTVERSION): $(TU_h) $(TU_c) $(MK) $(LIB_pc) | $$(@D)/
        $(info  $(INFO_)LD              $@)
        for opt in g 0 1 2 s 3 fast; do \
        $(LD) $(LDFLAGS) -O$$opt -o $*.O$$opt.so.$(DISTVERSION) $(TU_c) 
$(LDLIBS); \
        done
        $(LD) $(LDFLAGS)         -o $@                          $(TU_c) 
$(LDLIBS)

<https://git.kernel.org/pub/scm/libs/liba2i/liba2i.git/tree/share/mk/build/lib/shared.mk?h=main#n24>

The shell is

        SHELL       := bash
        .SHELLFLAGS := -Eeuo pipefail -c

so it aborts at the first error, and I don't see repeated errors.  It
slows down compilation (since I compile x8 times), but I don't care too
much about it.

Cheers,
Alex

-- 
<https://www.alejandro-colomar.es/>

Attachment: signature.asc
Description: PGP signature

Reply via email to