Bad interaction between gcc and glibc's handling of GNU <error.h> extension [GCC PR 115724]
Alejandro Colomar
alx@kernel.org
Tue Jul 9 23:52:55 GMT 2024
Hi Mark,
David Malcolm <dmalcolm@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/>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20240710/03a9fb12/attachment.sig>
More information about the Gcc
mailing list