aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Criswell <criswell@uiuc.edu>2005-11-03 15:42:27 +0000
committerJohn Criswell <criswell@uiuc.edu>2005-11-03 15:42:27 +0000
commitda071bff9d4f2eebf79d07fa975131db560b442c (patch)
treeeb00bfd92a03221bc521c9b7b1d312b1494ae630
parent41b236ec4507a0909bc8a39b93e6429d948dee5f (diff)
Merge in hack from Chris that discards libg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_16@24166 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--tools/gccld/GenerateCode.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/gccld/GenerateCode.cpp b/tools/gccld/GenerateCode.cpp
index 0d94549370..3b5d2b2b05 100644
--- a/tools/gccld/GenerateCode.cpp
+++ b/tools/gccld/GenerateCode.cpp
@@ -423,7 +423,10 @@ int llvm::GenerateNative(const std::string &OutputFilename,
// Add in the libraries to link.
for (unsigned index = 0; index < Libraries.size(); index++)
- if (Libraries[index] != "crtend") {
+ // HACK: If this is libg, discard it. This gets added by the compiler
+ // driver when doing: 'llvm-gcc main.c -Wl,-native -o a.out -g'. Note that
+ // this should really be fixed by changing the llvm-gcc compiler driver.
+ if (Libraries[index] != "crtend" && Libraries[index] != "g") {
std::string Tmp = "-l"+Libraries[index];
StringsToDelete.push_back(strdup(Tmp.c_str()));
args.push_back(StringsToDelete.back());