g++ with -fprofile-dir flag has a bug (backslash instead of forward-slash issue)

John Selbie jselbie@gmail.com
Sun Apr 12 11:39:41 GMT 2020


I would file a bug, but that link you provided takes me to a sign-up page
that says, "Account creation restricted.  Please contact ... response
within 24 hours..."

A quick cursory glace of GCC sources would suggest the issue is in
\gcc\coverage.c. This is a snippit of a function that builds the mangled
path for the .gcda file.

          if (profile_data_prefix)
        {
#if HAVE_DOS_BASED_FILE_SYSTEM
     const char *separator = "\\";
    #else
     const char *separator = "/";
    #endif
     filename = concat (getpwd (), separator, filename, NULL);
     filename = mangle_path (filename);
     len = strlen (filename);
    }

I'm not an expert on building gcc.  I just suspect that somewhere in the
build chain  HAVE_DOS_BASED_FILE_SYSTEM is getting defined for or by cygwin.

Another cursory search of gcc sources suggest HAVE_DOS_BASED_FILE_SYSTEM is
defined by this preprocessor stuff:

#if defined(__MSDOS__) || defined(_WIN32) || defined(__OS2__) || defined
(__CYGWIN__)
#  ifndef HAVE_DOS_BASED_FILE_SYSTEM
#    define HAVE_DOS_BASED_FILE_SYSTEM 1
#  endif

Still a gcc bug?  I'm guessing so.




On Sun, Apr 12, 2020 at 4:26 AM JonY via Cygwin <cygwin@cygwin.com> wrote:

> On 4/12/20 10:59 AM, John Selbie via Cygwin wrote:
> > Sure, but this bug is unique to cygwin.  Why would that be there bug?
> >
>
> Because Cygwin does not modify gcc to use Windows paths.
>
> --
> Problem reports:      https://cygwin.com/problems.html
> FAQ:                  https://cygwin.com/faq/
> Documentation:        https://cygwin.com/docs.html
> Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple
>


More information about the Cygwin mailing list