help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gcc --coverage and copying Bison generated files


From: Sean Nakasone
Subject: Re: gcc --coverage and copying Bison generated files
Date: Thu, 27 Nov 2014 09:37:49 -1000

perhaps lookup VPATH

Sent from my iPhone

> On Nov 26, 2014, at 6:03 PM, Daiki Ueno <address@hidden> wrote:
> 
> 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
> 
> _______________________________________________
> address@hidden https://lists.gnu.org/mailman/listinfo/help-bison



reply via email to

[Prev in Thread] Current Thread [Next in Thread]