summaryrefslogtreecommitdiff
path: root/tools/gccld/gccld.cpp
diff options
context:
space:
mode:
authorBrian Gaeke <gaeke@uiuc.edu>2004-05-07 21:47:36 +0000
committerBrian Gaeke <gaeke@uiuc.edu>2004-05-07 21:47:36 +0000
commit7532e34537de56cc42512085abb77ad84c8a42a6 (patch)
tree18d4f8d3157719d1b29f344761f34eb37093b820 /tools/gccld/gccld.cpp
parente302a7eb433b43434e021b90c477fdd281c2ccd5 (diff)
downloadllvm-7532e34537de56cc42512085abb77ad84c8a42a6.tar.gz
llvm-7532e34537de56cc42512085abb77ad84c8a42a6.tar.bz2
llvm-7532e34537de56cc42512085abb77ad84c8a42a6.tar.xz
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. 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.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13414 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/gccld/gccld.cpp')
-rw-r--r--tools/gccld/gccld.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/gccld/gccld.cpp b/tools/gccld/gccld.cpp
index 389a6b13da..eee34dbe68 100644
--- a/tools/gccld/gccld.cpp
+++ b/tools/gccld/gccld.cpp
@@ -309,7 +309,10 @@ int main(int argc, char **argv, char **envp) {
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 @@ int main(int argc, char **argv, char **envp) {
if (!FullLibraryPath.empty() && IsSharedObject(FullLibraryPath))
Out2 << " -load=" << FullLibraryPath << " \\\n";
}
- Out2 << " $0.bc $*\n";
+ Out2 << " $0.bc ${1+\"$@\"}\n";
Out2.close();
}