1. Use better error messages in LinkFiles().
authorBrian Gaeke <gaeke@uiuc.edu>
Tue, 30 Sep 2003 14:03:48 +0000 (14:03 +0000)
committerBrian Gaeke <gaeke@uiuc.edu>
Tue, 30 Sep 2003 14:03:48 +0000 (14:03 +0000)
2. I think the caller of LinkFiles() should not ignore a true return value.
   (If you have a good reason why it ought to, feel free to revert
   this. It's just something that's been bugging me for a while.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8760 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Linker/LinkArchives.cpp
tools/gccld/Linker.cpp
tools/gccld/gccld.cpp

index 0d0dc9fabaa2dc178096de7a085d8d02de5cff50..34fe2f124565dda39862b0c8561bb772051bb62e 100644 (file)
@@ -401,13 +401,13 @@ bool LinkFiles(const char *progname,
       Pathname = Files[i];
     } else {
       if (SearchPath == NULL) {
-        std::cerr << "Cannot find " << Files[i];
+        std::cerr << "Cannot find linker input file '" << Files[i] << "'";
         return true;
       }
 
       Pathname = std::string(SearchPath)+"/"+Files[i];
       if (!FileExists(Pathname)) {
-        std::cerr << "Cannot find " << Files[i];
+        std::cerr << "Cannot find linker input file '" << Files[i] << "'";
         return true;
       }
     }
index 0d0dc9fabaa2dc178096de7a085d8d02de5cff50..34fe2f124565dda39862b0c8561bb772051bb62e 100644 (file)
@@ -401,13 +401,13 @@ bool LinkFiles(const char *progname,
       Pathname = Files[i];
     } else {
       if (SearchPath == NULL) {
-        std::cerr << "Cannot find " << Files[i];
+        std::cerr << "Cannot find linker input file '" << Files[i] << "'";
         return true;
       }
 
       Pathname = std::string(SearchPath)+"/"+Files[i];
       if (!FileExists(Pathname)) {
-        std::cerr << "Cannot find " << Files[i];
+        std::cerr << "Cannot find linker input file '" << Files[i] << "'";
         return true;
       }
     }
index 8b9dfd1123aa56637d488f81c027a9c0ac6e96e9..b991cd57ea0b0364dbd2aac41c4ffa3714e89b22 100644 (file)
@@ -256,7 +256,8 @@ main(int argc, char **argv, char ** envp)
                   Libraries.end());
 
   // Link in all of the files
-  LinkFiles(argv[0], Composite.get(), InputFilenames, Verbose);
+  if (LinkFiles(argv[0], Composite.get(), InputFilenames, Verbose))
+    return 1; // Error already printed
   LinkLibraries(argv[0], Composite.get(), Libraries, LibPaths, Verbose, Native);
 
   // Link in all of the libraries next...