]> granicus.if.org Git - clang/commitdiff
[WebAssembly] Remove invliad lld arguments
authorSam Clegg <sbc@chromium.org>
Thu, 14 Sep 2017 21:29:25 +0000 (21:29 +0000)
committerSam Clegg <sbc@chromium.org>
Thu, 14 Sep 2017 21:29:25 +0000 (21:29 +0000)
These arguments don't (not yet at least) make sense for
the wasm lld port.

Subscribers: jfb, dschuff, jgravelle-google, aheejin

Differential Revision: https://reviews.llvm.org/D36595

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313299 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/ToolChains/WebAssembly.cpp

index 88a3f1b5745c0e4db077d30df8021e110af0135a..354f77fd66a5a54f878ed65206c78dd3b60ef97b 100644 (file)
@@ -43,36 +43,12 @@ void wasm::Linker::ConstructJob(Compilation &C, const JobAction &JA,
   CmdArgs.push_back("-flavor");
   CmdArgs.push_back("wasm");
 
-  // Enable garbage collection of unused input sections by default, since code
-  // size is of particular importance. This is significantly facilitated by
-  // the enabling of -ffunction-sections and -fdata-sections in
-  // Clang::ConstructJob.
-  if (areOptimizationsEnabled(Args))
-    CmdArgs.push_back("--gc-sections");
-
-  if (Args.hasArg(options::OPT_rdynamic))
-    CmdArgs.push_back("-export-dynamic");
   if (Args.hasArg(options::OPT_s))
     CmdArgs.push_back("--strip-all");
-  if (Args.hasArg(options::OPT_shared))
-    CmdArgs.push_back("-shared");
-  if (Args.hasArg(options::OPT_static))
-    CmdArgs.push_back("-Bstatic");
 
   Args.AddAllArgs(CmdArgs, options::OPT_L);
   ToolChain.AddFilePathLibArgs(Args, CmdArgs);
 
-  if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) {
-    if (Args.hasArg(options::OPT_shared))
-      CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("rcrt1.o")));
-    else if (Args.hasArg(options::OPT_pie))
-      CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("Scrt1.o")));
-    else
-      CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crt1.o")));
-
-    CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crti.o")));
-  }
-
   AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA);
 
   if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) {
@@ -88,9 +64,6 @@ void wasm::Linker::ConstructJob(Compilation &C, const JobAction &JA,
     CmdArgs.push_back("-lcompiler_rt");
   }
 
-  if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles))
-    CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crtn.o")));
-
   CmdArgs.push_back("-o");
   CmdArgs.push_back(Output.getFilename());