Skip to content

Commit 1ea1e7a

Browse files
author
John Criswell
committed
Merge in hack from Chris that discards libg.
llvm-svn: 24166
1 parent 398d2e2 commit 1ea1e7a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

llvm/tools/gccld/GenerateCode.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,10 @@ int llvm::GenerateNative(const std::string &OutputFilename,
423423

424424
// Add in the libraries to link.
425425
for (unsigned index = 0; index < Libraries.size(); index++)
426-
if (Libraries[index] != "crtend") {
426+
// HACK: If this is libg, discard it. This gets added by the compiler
427+
// driver when doing: 'llvm-gcc main.c -Wl,-native -o a.out -g'. Note that
428+
// this should really be fixed by changing the llvm-gcc compiler driver.
429+
if (Libraries[index] != "crtend" && Libraries[index] != "g") {
427430
std::string Tmp = "-l"+Libraries[index];
428431
StringsToDelete.push_back(strdup(Tmp.c_str()));
429432
args.push_back(StringsToDelete.back());

0 commit comments

Comments
 (0)