[llvm-bugs] [Bug 39020] New: 't' modifier does not work well with thin archives

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Sep 20 08:52:49 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=39020

            Bug ID: 39020
           Summary: 't' modifier does not work well with thin archives
           Product: tools
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: llvm-ar
          Assignee: unassignedbugs at nondot.org
          Reporter: jh7370.2008 at my.bristol.ac.uk
                CC: llvm-bugs at lists.llvm.org

I was doing some investigation work and discovered that thin archvies +
llvm-ar's 't' modifier do not behave correctly, at least on Windows, although I
believe that some of it won't work on Linux either. Here is the reproducible
and resultant behaviour:

===

C:\Work>touch bar.o
C:\Work>touch D:\test\bar.o
C:\Work>mkdir dir
C:\Work>llvm-ar qcT test.a bar.o
C:\Work>llvm-ar qT test.a C:\Work\bar.o
C:\Work>llvm-ar qT test.a .\bar.o
C:\Work>llvm-ar qT test.a .\..\Work\bar.o
C:\Work>llvm-ar qT test.a dir\..\bar.o
C:\Work>llvm-ar qT test.a \Work\bar.o
C:\Work>llvm-ar qT test.a D:\test\bar.o

C:\Work>llvm-ar t test.a
/bar.o
/C:\Work\bar.o
/./bar.o
/./../Work/bar.o
/dir/../bar.o
//Work/bar.o
/D:\test\bar.o

C:\Work>cd dir
C:\Work\dir>llvm-ar t ..\test.a
../bar.o
../C:\Work\bar.o
.././bar.o
.././../Work/bar.o
../dir/../bar.o
..//Work/bar.o
../D:\test\bar.o

C:\Work\dir>cd ..\..
C:\>llvm-ar t Work\test.a
Work/bar.o
Work/C:\Work\bar.o
Work/./bar.o
Work/./../Work/bar.o
Work/dir/../bar.o
Work/D:\test\bar.o
Work//Work/bar.o

C:\>d:
D:\>llvm-ar t C:\Work\test.a
C:\Work/bar.o
C:\Work/C:\Work\bar.o
C:\Work/./bar.o
C:\Work/./../Work/bar.o
C:\Work/dir/../bar.o
C:\Work/D:\test\bar.o
C:\Work//Work/bar.o

===

There are three related, but different issues:
1) llvm-ar should not prepend '/' to the front of paths on Windows, if the
archive is in the current working directory. At the very least, it should be
'./', but I think it should probably just not do anything in this case.
2) For absolute paths, starting either with a drive specifier, nothing should
ever be prepended. The paths are absolute, so the relative location of the
archive to the working directory is irrelevant.
3) Paths relative to the current drive (i.e. starting with '\') should not have
anything pre-prended, unless they are on a different drive to the current
directory, in which case, they should only have the drive letter + ':'
prepended.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180920/fef199a3/attachment.html>


More information about the llvm-bugs mailing list