[cfe-commits] r120528 - /cfe/trunk/lib/Driver/Tools.cpp
Rafael Espindola
rafael.espindola at gmail.com
Tue Nov 30 17:52:43 PST 2010
Author: rafael
Date: Tue Nov 30 19:52:43 2010
New Revision: 120528
URL: http://llvm.org/viewvc/llvm-project?rev=120528&view=rev
Log:
Handle -nostartfiles.
Modified:
cfe/trunk/lib/Driver/Tools.cpp
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=120528&r1=120527&r2=120528&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Tue Nov 30 19:52:43 2010
@@ -3298,7 +3298,8 @@
CmdArgs.push_back("-o");
CmdArgs.push_back(Output.getFilename());
- if (!Args.hasArg(options::OPT_nostdlib)) {
+ if (!Args.hasArg(options::OPT_nostdlib) &&
+ !Args.hasArg(options::OPT_nostartfiles)) {
const char *crt1 = NULL;
if (!Args.hasArg(options::OPT_shared)){
if (Args.hasArg(options::OPT_pie))
@@ -3384,15 +3385,17 @@
CmdArgs.push_back("-lgcc");
}
- const char *crtend;
- if (Args.hasArg(options::OPT_shared) || Args.hasArg(options::OPT_pie))
- crtend = "crtendS.o";
- else
- crtend = "crtend.o";
- CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crtend)));
+ if (!Args.hasArg(options::OPT_nostartfiles)) {
+ const char *crtend;
+ if (Args.hasArg(options::OPT_shared) || Args.hasArg(options::OPT_pie))
+ crtend = "crtendS.o";
+ else
+ crtend = "crtend.o";
- CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crtn.o")));
+ CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crtend)));
+ CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crtn.o")));
+ }
}
if (Args.hasArg(options::OPT_use_gold_plugin)) {
More information about the cfe-commits
mailing list