summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-06-07 23:03:13 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-06-07 23:03:13 +0000
commitaf303d53e6013417d189621c75179df6c7cbdcde (patch)
tree9b2ef2802a9e40a4a2ec2a63fb981d987e49d55f /tools
parent3bdac5171bd7d661dd54cc30d9cbc55a3039c6c0 (diff)
downloadexternal_llvm-af303d53e6013417d189621c75179df6c7cbdcde.zip
external_llvm-af303d53e6013417d189621c75179df6c7cbdcde.tar.gz
external_llvm-af303d53e6013417d189621c75179df6c7cbdcde.tar.bz2
For PR780:
1. Add #includes to LinkAllVMCore.h to get Mangler.o and InlineAsm.o 2. Make Mangler.h and InlineAsm.h use the macros to ensure linkage 3. Make each of the tools with --load options include LinkAllVMCore.h This should be the last set of changes for this bug and 800. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28719 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/analyze/analyze.cpp1
-rw-r--r--tools/llc/llc.cpp1
-rw-r--r--tools/llvm-db/llvm-db.cpp1
-rw-r--r--tools/llvm-ld/llvm-ld.cpp20
-rw-r--r--tools/opt/opt.cpp1
5 files changed, 23 insertions, 1 deletions
diff --git a/tools/analyze/analyze.cpp b/tools/analyze/analyze.cpp
index 71ae657..c3411ab 100644
--- a/tools/analyze/analyze.cpp
+++ b/tools/analyze/analyze.cpp
@@ -27,6 +27,7 @@
#include "llvm/System/Signals.h"
#include "llvm/Support/PluginLoader.h"
#include "llvm/Support/Timer.h"
+#include "llvm/LinkAllVMCore.h"
#include <algorithm>
using namespace llvm;
diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp
index 6a66e52..f57f3e1 100644
--- a/tools/llc/llc.cpp
+++ b/tools/llc/llc.cpp
@@ -28,6 +28,7 @@
#include "llvm/Analysis/Verifier.h"
#include "llvm/System/Signals.h"
#include "llvm/Config/config.h"
+#include "llvm/LinkAllVMCore.h"
#include <fstream>
#include <iostream>
#include <memory>
diff --git a/tools/llvm-db/llvm-db.cpp b/tools/llvm-db/llvm-db.cpp
index a46aa08..b270535 100644
--- a/tools/llvm-db/llvm-db.cpp
+++ b/tools/llvm-db/llvm-db.cpp
@@ -16,6 +16,7 @@
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/PluginLoader.h"
#include "llvm/System/Signals.h"
+#include "llvm/LinkAllVMCore.h"
#include <iostream>
using namespace llvm;
diff --git a/tools/llvm-ld/llvm-ld.cpp b/tools/llvm-ld/llvm-ld.cpp
index 1900cc9..b93d511 100644
--- a/tools/llvm-ld/llvm-ld.cpp
+++ b/tools/llvm-ld/llvm-ld.cpp
@@ -20,6 +20,7 @@
//
//===----------------------------------------------------------------------===//
+#include "llvm/LinkAllVMCore.h"
#include "llvm/Linker.h"
#include "llvm/System/Program.h"
#include "llvm/Module.h"
@@ -77,9 +78,12 @@ static cl::opt<bool>DisableCompression("disable-compression",cl::init(false),
cl::desc("Disable writing of compressed bytecode files"));
static cl::list<std::string> PostLinkOpts("post-link-opts",
- cl::value_desc("path to post-link optimization programs"),
+ cl::value_desc("path"),
cl::desc("Run one or more optimization programs after linking"));
+static cl::list<std::string> XLinker("Xlinker", cl::value_desc("option"),
+ cl::desc("Pass options to the system linker"));
+
// Compatibility options that are ignored but supported by LD
static cl::opt<std::string> CO3("soname", cl::Hidden,
cl::desc("Compatibility option: ignored"));
@@ -93,6 +97,7 @@ static cl::opt<bool> CO5("eh-frame-hdr", cl::Hidden,
static cl::opt<std::string> CO6("h", cl::Hidden,
cl::desc("Compatibility option: ignored"));
+
/// This is just for convenience so it doesn't have to be passed around
/// everywhere.
static std::string progname;
@@ -303,12 +308,25 @@ static int GenerateNative(const std::string &OutputFilename,
args.push_back(OutputFilename.c_str());
args.push_back(InputFilename.c_str());
+ // Add in the library paths
+ for (unsigned index = 0; index < LibPaths.size(); index++) {
+ args.push_back("-L");
+ args.push_back(LibPaths[index].c_str());
+ }
+
+ // Add the requested options
+ for (unsigned index = 0; index < XLinker.size(); index++) {
+ args.push_back(XLinker[index].c_str());
+ args.push_back(Libraries[index].c_str());
+ }
+
// Add in the libraries to link.
for (unsigned index = 0; index < Libraries.size(); index++)
if (Libraries[index] != "crtend") {
args.push_back("-l");
args.push_back(Libraries[index].c_str());
}
+
args.push_back(0);
// Run the compiler to assembly and link together the program.
diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp
index b6ededd..9fddd94 100644
--- a/tools/opt/opt.cpp
+++ b/tools/opt/opt.cpp
@@ -25,6 +25,7 @@
#include "llvm/Support/PluginLoader.h"
#include "llvm/Support/SystemUtils.h"
#include "llvm/Transforms/LinkAllPasses.h"
+#include "llvm/LinkAllVMCore.h"
#include <fstream>
#include <memory>
#include <algorithm>