summaryrefslogtreecommitdiff
path: root/tools/gccld
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-08-02 22:07:38 +0000
committerChris Lattner <sabre@nondot.org>2005-08-02 22:07:38 +0000
commit1d924f60708b0dcf60766c6e99b46274e495db9c (patch)
tree4ce4235bd8210c5800080f4cd0cb100609fef6a1 /tools/gccld
parente6ec587059eb142467cc8a5915946a3b308cb9b7 (diff)
downloadllvm-1d924f60708b0dcf60766c6e99b46274e495db9c.tar.gz
llvm-1d924f60708b0dcf60766c6e99b46274e495db9c.tar.bz2
llvm-1d924f60708b0dcf60766c6e99b46274e495db9c.tar.xz
Pass -export-dynamic to gcc when compiling with -native and the link is
performed with -export-dynamic (aka. -disable-internalize). Patch by Nicholas Riley! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22601 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/gccld')
-rw-r--r--tools/gccld/GenerateCode.cpp9
-rw-r--r--tools/gccld/gccld.cpp8
-rw-r--r--tools/gccld/gccld.h1
3 files changed, 10 insertions, 8 deletions
diff --git a/tools/gccld/GenerateCode.cpp b/tools/gccld/GenerateCode.cpp
index 56aaf7d5cf..fa4a8fd390 100644
--- a/tools/gccld/GenerateCode.cpp
+++ b/tools/gccld/GenerateCode.cpp
@@ -325,8 +325,7 @@ int llvm::GenerateAssembly(const std::string &OutputFilename,
return sys::Program::ExecuteAndWait(llc, &args[0]);
}
-/// GenerateAssembly - generates a native assembly language source file from the
-/// specified bytecode file.
+/// GenerateCFile - generates a C source file from the specified bytecode file.
int llvm::GenerateCFile(const std::string &OutputFile,
const std::string &InputFile,
const sys::Path &llc,
@@ -344,8 +343,8 @@ int llvm::GenerateCFile(const std::string &OutputFile,
return sys::Program::ExecuteAndWait(llc, &args[0]);
}
-/// GenerateNative - generates a native assembly language source file from the
-/// specified assembly source file.
+/// GenerateNative - generates a native executable file from the specified
+/// assembly source file.
///
/// Inputs:
/// InputFilename - The name of the output bytecode file.
@@ -365,6 +364,7 @@ int llvm::GenerateNative(const std::string &OutputFilename,
const std::vector<std::string> &Libraries,
const sys::Path &gcc, char ** const envp,
bool Shared,
+ bool ExportAllAsDynamic,
const std::string &RPath,
const std::string &SOName,
bool Verbose) {
@@ -400,6 +400,7 @@ int llvm::GenerateNative(const std::string &OutputFilename,
args.push_back(InputFilename.c_str());
if (Shared) args.push_back("-shared");
+ if (ExportAllAsDynamic) args.push_back("-export-dynamic");
if (!RPath.empty()) {
std::string rp = "-Wl,-rpath," + RPath;
args.push_back(rp.c_str());
diff --git a/tools/gccld/gccld.cpp b/tools/gccld/gccld.cpp
index 2ae13aa7d4..5c0fbb90d8 100644
--- a/tools/gccld/gccld.cpp
+++ b/tools/gccld/gccld.cpp
@@ -308,8 +308,8 @@ int main(int argc, char **argv, char **envp ) {
Verbose);
if (Verbose) std::cout << "Generating Native Code\n";
GenerateNative(OutputFilename, AssemblyFile.toString(),
- LibPaths, Libraries, gcc, envp, LinkAsLibrary, RPath,
- SOName, Verbose);
+ LibPaths, Libraries, gcc, envp, LinkAsLibrary,
+ NoInternalize, RPath, SOName, Verbose);
if (!SaveTemps) {
// Remove the assembly language file.
@@ -340,8 +340,8 @@ int main(int argc, char **argv, char **envp ) {
GenerateCFile(CFile.toString(), RealBytecodeOutput, llc, Verbose);
if (Verbose) std::cout << "Generating Native Code\n";
GenerateNative(OutputFilename, CFile.toString(),
- LibPaths, Libraries, gcc, envp, LinkAsLibrary, RPath,
- SOName, Verbose);
+ LibPaths, Libraries, gcc, envp, LinkAsLibrary,
+ NoInternalize, RPath, SOName, Verbose);
if (!SaveTemps) {
// Remove the assembly language file.
diff --git a/tools/gccld/gccld.h b/tools/gccld/gccld.h
index 5b7bdf1c47..b1649f0747 100644
--- a/tools/gccld/gccld.h
+++ b/tools/gccld/gccld.h
@@ -45,6 +45,7 @@ GenerateNative (const std::string &OutputFilename,
const sys::Path &gcc,
char ** const envp,
bool Shared,
+ bool ExportAllAsDynamic,
const std::string &RPath,
const std::string &SOName,
bool Verbose=false);