[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gcc --coverage and copying Bison generated files
From: |
Daiki Ueno |
Subject: |
gcc --coverage and copying Bison generated files |
Date: |
Thu, 27 Nov 2014 13:03:07 +0900 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Hello,
Sorry for that this is not really related to Bison (but GCC or LCOV),
but perhaps a common question that anyone might know the solution.
In gettext we have the following directory structure:
gettext-runtime/
intl/
Makefile
plural.y
plural.c # <-- generated from plural.y
...
gettext-tools/
intl/
Makefile
In order for gettext-runtime and gettext-tools to be built separately,
gettext-tools/intl/Makefile refers to the source code in
gettext-runtime/intl/ instead of copying the object files.
So gettext-tools/intl/Makefile looks like:
srcdir = ../../gettext-runtime/intl
plural.lo: $(srcdir)/plural.c
$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile \
$(COMPILE) $(srcdir)/plural.c
This works for normal compilation. However, when compiling with the
--coverage option of GCC, the generated .gcno file embeds relative file
name annotated with #line directive in plural.c. That confuses LCOV:
genhtml: ERROR: cannot read /tmp/...snip.../gettext-tools/intl/plural.c
http://hydra.nixos.org/build/17564911/log/tail-reload
Is there any easy way to tell GCC the correct source file location? Or
should we copy all the source files?
Thanks in advance,
--
Daiki Ueno
- gcc --coverage and copying Bison generated files,
Daiki Ueno <=