[COFF] Stop lowercasing paths in messages
authorShoaib Meenai <smeenai@fb.com>
Thu, 7 Dec 2017 01:21:27 +0000 (01:21 +0000)
committerShoaib Meenai <smeenai@fb.com>
Thu, 7 Dec 2017 01:21:27 +0000 (01:21 +0000)
It's pretty annoying to have LLD lowercase paths in error messages when
cross-compiling from a case-sensitive filesystem, since e.g. if I want
to examine the problematic object file, I have to perform some manual
case correction instead of just being able to copy the path from the
error message.

Differential Revision: https://reviews.llvm.org/D40931

llvm-svn: 319996

lld/COFF/InputFiles.cpp
lld/test/COFF/filename-casing.s [new file with mode: 0644]

index 73fccdbd006b81cfcedd06aa2701ee9e421235f0..df20f0c61936febdd61b10033ad27e25326e5969 100644 (file)
@@ -497,10 +497,9 @@ std::string lld::toString(const coff::InputFile *File) {
   if (!File)
     return "<internal>";
   if (File->ParentName.empty())
-    return File->getName().lower();
+    return File->getName();
 
-  std::string Res =
-      (getBasename(File->ParentName) + "(" + getBasename(File->getName()) + ")")
-          .str();
-  return StringRef(Res).lower();
+  return (getBasename(File->ParentName) + "(" + getBasename(File->getName()) +
+          ")")
+      .str();
 }
diff --git a/lld/test/COFF/filename-casing.s b/lld/test/COFF/filename-casing.s
new file mode 100644 (file)
index 0000000..e210aea
--- /dev/null
@@ -0,0 +1,14 @@
+# REQUIRES: x86
+
+# RUN: llvm-mc -filetype=obj -triple=x86_64-windows-msvc -o %T/MixedCase.obj %s
+# RUN: not lld-link /entry:main %T/MixedCase.obj 2>&1 | FileCheck -check-prefix=OBJECT %s
+
+# RUN: llvm-lib /out:%T/MixedCase.lib %T/MixedCase.obj
+# RUN: not lld-link /machine:x64 /entry:main %T/MixedCase.lib 2>&1 | FileCheck -check-prefix=ARCHIVE %s
+
+# OBJECT: MixedCase.obj: undefined symbol: f
+# ARCHIVE: MixedCase.lib(MixedCase.obj): undefined symbol: f
+
+.globl main
+main:
+       callq   f