[LLVMbugs] [Bug 14925] New: DepFiles path separator on Windows (cause problems with automake w/ MinGW/MSYS)

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jan 11 11:28:13 PST 2013


http://llvm.org/bugs/show_bug.cgi?id=14925

             Bug #: 14925
           Summary: DepFiles path separator on Windows (cause problems
                    with automake w/ MinGW/MSYS)
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: virgile.bello at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Noticed that in some project with automake/autoconf under MingW/MSYS, it would
recompile lot of files even when they were not modified.

After investigation, this is due to how depfiles are generated.
It seems that the default behavior of using \ instead of / cause problems under
windows for relative path.

As an example:
# clang -M mono-sha1.c -I../../eglib/src
mono-sha1.o: mono-sha1.c /mingw/include\stdio.h /mingw/include\_mingw.h \
  C:/MinGW/msys/1.0/local/bin/../lib/clang/3.3/include\stddef.h \
  C:/MinGW/msys/1.0/local/bin/../lib/clang/3.3/include\stdarg.h \
  /mingw/include\sys/types.h /mingw/include\string.h \
  ../../eglib/src\glib.h /mingw/include\stdlib.h /mingw/include\ctype.h \
  C:/MinGW/msys/1.0/local/bin/../lib/clang/3.3/include\limits.h \
  /mingw/include\limits.h \
  C:/MinGW/msys/1.0/local/bin/../lib/clang/3.3/include\stdint.h \
  /mingw/include\stdint.h ../../eglib/src\eglib-config.h \
  ../../eglib/src\eglib-remap.h /mingw/include\malloc.h mono-digest.h

Those make prerequesite fails (but changing the \ into a / before the filename
fixes it):
 Prerequisite `../../eglib/src\glib.h' of target `mono-sha1.lo' does not exist.
 Prerequisite `../../eglib/src\eglib-config.h' of target `mono-sha1.lo' does
not
 exist.
 Prerequisite `../../eglib/src\eglib-remap.h' of target `mono-sha1.lo' does not

I patched DependencyFile.cpp to force replace \ with / and automake worked.
Note that GCC outputs the proper form (i.e. ../../eglib/src/glib.h).
I could give the patch (almost nothing) but was wondering if this is something
that might also needs changes in more places -- maybe there is some other
places where path could be output on command line? And maybe it should be
configurable through a command line option? (with default behavior gcc
compatible -- since depfiles are used mostly through automake)

As a side note, MinGW/MSYS seems to behave weirdly with backslash, as they are
allowed in full path but not in relative paths:
ls /bin\\test works (if file exists)
ls ../bin\\test does not work (if file exists)

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list