Compiling LO for lcov/gcov code coverage fails (gb_GCOV=YES)

Maarten Hoes hoes.maarten at gmail.com
Fri May 13 14:42:43 UTC 2022


On Fri, May 13, 2022 at 3:06 PM Stephan Bergmann <sbergman at redhat.com>
wrote:

> Just performance, I think.  Luboš should know the details.
>

Ok. Then for my use case, it would not really be that much of an issue to
compile with gcc instead.


Maybe your solution for now is --disable-skia?
>

Perhaps, or at least a workaround for the moment. The basic idea was to see
if I could revive the automated lcov reports, and to let them run again on
a regular basis. I have no idea if there is enough interest for something
like that, but if not I at least may have had some pleasure in (attempting
to) making it work again.

And I certainly am no expert on the matter, but it appears to me that when
clang is not installed, skia is built with gcc anyway (at least on Linux).
Without clang installed, I ended up with 'ENABLE_SKIA='TRUE'' in
config.log, and a './instdir/program/libskialo.so'. This may not be what
was intended, but it works for me. :) . I tried deciphering configure.ac,
but couldn't really make sense of it. Judging by the comments, it looks
like clang for skia is only enforced on Windows and Mac (comment : '#Skia
is the default on Windows and Mac, so hard-require Clang.', around line
12177 in configure.ac).

So to sum it up, with only gcc installed, the gcov build works if I modify :

external/expat/ExternalProject_expat.mk
external/liborcus/ExternalProject_liborcus.mk

and add :

CFLAGS += -fprofile-arcs -ftest-coverage
CXXFLAGS += -fprofile-arcs -ftest-coverage
LDFLAGS += -fprofile-arcs -lgcov

to the top of them. Of course, that does not seem to be a proper permanent
solution to the issue: the question remains why these *FLAGS don't end up
in these 2 files when you specify 'gb_GCOV=YES make'. Pointers to where I
should start looking in the build system in an attempt to troubleshoot
things are appreciated. I found the point where the flags are supposed to
be set conditionally in lines 112-117 in
'solenv/gbuild/platform/com_GCC_defs.mk' , but don't really know how to
proceed from there. Perhaps the variables
"gb_CFLAGS_COMMON/gb_CXXFLAGS_COMMON/gb_LinkTarget_LDFLAGS" are not used in
the right places, or overwritten with something else ?


- Maarten
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice/attachments/20220513/7ec0b722/attachment.htm>


More information about the LibreOffice mailing list