[llvm-commits] CVS: llvm/tools/gccld/gccld.cpp

Brian Gaeke gaeke at cs.uiuc.edu
Fri May 7 16:47:02 PDT 2004


Changes in directory llvm/tools/gccld:

gccld.cpp updated: 1.70 -> 1.71

---
Log message:

Allow the user to set the LLVMINTERP environment variable as a workaround, for
when they have to run a gccld shell script without having lli in their path.
This is intended to address Bug 289: http://llvm.cs.uiuc.edu/PR289 .

Also, emit the traditional syntax ${1+"$@"} for passing all of a shell script's
args to a subprocess. If you have arguments that have spaces in them, $* will
not preserve the quoting (i.e., the quoted string "foo bar" as an argument will
end up as two arguments "foo" "bar" to lli.)


---
Diffs of the changes:  (+5 -2)

Index: llvm/tools/gccld/gccld.cpp
diff -u llvm/tools/gccld/gccld.cpp:1.70 llvm/tools/gccld/gccld.cpp:1.71
--- llvm/tools/gccld/gccld.cpp:1.70	Tue Apr  6 11:43:13 2004
+++ llvm/tools/gccld/gccld.cpp	Fri May  7 16:47:36 2004
@@ -309,7 +309,10 @@
       if (!Out2.good())
         return PrintAndReturn(argv[0], "error opening '" + OutputFilename +
                                        "' for writing!");
-      Out2 << "#!/bin/sh\nlli \\\n";
+      Out2 << "#!/bin/sh\n";
+      // Allow user to setenv LLVMINTERP if lli is not in their PATH.
+      Out2 << "lli=${LLVMINTERP-lli}\n";
+      Out2 << "exec $lli \\\n";
       // gcc accepts -l<lib> and implicitly searches /lib and /usr/lib.
       LibPaths.push_back("/lib");
       LibPaths.push_back("/usr/lib");
@@ -327,7 +330,7 @@
         if (!FullLibraryPath.empty() && IsSharedObject(FullLibraryPath))
           Out2 << "    -load=" << FullLibraryPath << " \\\n";
       }
-      Out2 << "    $0.bc $*\n";
+      Out2 << "    $0.bc ${1+\"$@\"}\n";
       Out2.close();
     }
   





More information about the llvm-commits mailing list