add a hack that fixes:

llvm-gcc main.c -Wl,-native -o a.out -g

This is important because it used by many configure scripts.

John, please pull this onto the 1.6 branch.

llvm-svn: 24163
This commit is contained in:
Chris Lattner 2005-11-03 07:17:51 +00:00
parent 64209fd14b
commit b3140c3e8a
1 changed files with 4 additions and 1 deletions

View File

@ -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());