This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch libgcov]: Fix libgcov for DOS paths and allow GCOV_PREFIX_STRIP without GCOV_PREFIX
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: Kai Tietz <ktietz70 at googlemail dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, nathan at codesourcery dot com
- Date: Fri, 15 Oct 2010 15:09:45 -0700
- Subject: Re: [patch libgcov]: Fix libgcov for DOS paths and allow GCOV_PREFIX_STRIP without GCOV_PREFIX
- References: <AANLkTi=Th0K71g2q9=ZOKyyaBSoFWbN=iZttf7g2ZgtG@mail.gmail.com> <4CB8BB49.1080808@redhat.com>
On Fri, Oct 15, 2010 at 1:36 PM, Richard Henderson <rth@redhat.com> wrote:
> On 10/15/2010 12:37 PM, Kai Tietz wrote:
>> ? ? ? ? * libgcov.c (create_file_directory): Enable it for win32 case.
>
> I think this part can go in immediately. ?Obvious and non-controversial.
>
>> ? ? ? ? (gcov_exit): De-couple GCOV_PREFIX and GCOV_PREFIX_STRIP.
>
>> + ?/* If no prefix was specified and a prefix stip, then we assume
>> + ? ? relative. ?*/
>> + ?if (gcov_prefix_strip != 0 && prefix_length == 0)
>> + ? ?{
>> + ? ? ?gcov_prefix = ".";
>> + ? ? ?prefix_length = 1;
>> + ? ?}
>
> I wonder if it would be better to generate "file" than "./file".
> This could be done instead by changing
>
>> ? if (prefix_length)
>> ? ? memcpy (gi_filename, gcov_prefix, prefix_length);
>
> to force a separator here instead.
>
> And of course if we're allowing relative paths via this method, it
> does seem odd that we'd reject them via GCOV_PREFIX. ?I see that
> Grigory argues against relative prefixes back in
>
> ?http://gcc.gnu.org/ml/gcc-patches/2005-05/msg00545.html
>
> The very specific (and common) use case we're looking at here is that
> of the testsuite, where we have a cygwin host and a mingw target. The
> host and target do not share a common view of the filesystem. ?Cygwin
> thinks the path from root is /home/user/.../gcc/testsuite/ and MinGW
> thinks the path from root is C:/cygwin/home/user/.../gcc/testsuite/.
>
> For the testsuite (and indeed, many cygwin/mingw cross situations),
> using relative paths enables this disparate vision to be ignored.
>
Relative GCOV_PREFIX is fine with me if it helps.
--
H.J.