[llvm-commits] CVS: llvm/tools/gccld/GenerateCode.cpp gccld.cpp gccld.h

Chris Lattner lattner at cs.uiuc.edu
Tue Aug 2 15:07:49 PDT 2005



Changes in directory llvm/tools/gccld:

GenerateCode.cpp updated: 1.50 -> 1.51
gccld.cpp updated: 1.102 -> 1.103
gccld.h updated: 1.16 -> 1.17
---
Log message:

Pass -export-dynamic to gcc when compiling with -native and the link is 
performed with -export-dynamic (aka. -disable-internalize).

Patch by Nicholas Riley!


---
Diffs of the changes:  (+10 -8)

 GenerateCode.cpp |    9 +++++----
 gccld.cpp        |    8 ++++----
 gccld.h          |    1 +
 3 files changed, 10 insertions(+), 8 deletions(-)


Index: llvm/tools/gccld/GenerateCode.cpp
diff -u llvm/tools/gccld/GenerateCode.cpp:1.50 llvm/tools/gccld/GenerateCode.cpp:1.51
--- llvm/tools/gccld/GenerateCode.cpp:1.50	Fri Jul  8 11:48:52 2005
+++ llvm/tools/gccld/GenerateCode.cpp	Tue Aug  2 17:07:38 2005
@@ -325,8 +325,7 @@
   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 @@
   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 @@
                          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 @@
   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());


Index: llvm/tools/gccld/gccld.cpp
diff -u llvm/tools/gccld/gccld.cpp:1.102 llvm/tools/gccld/gccld.cpp:1.103
--- llvm/tools/gccld/gccld.cpp:1.102	Thu Jul  7 22:08:58 2005
+++ llvm/tools/gccld/gccld.cpp	Tue Aug  2 17:07:38 2005
@@ -308,8 +308,8 @@
                        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 @@
       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.


Index: llvm/tools/gccld/gccld.h
diff -u llvm/tools/gccld/gccld.h:1.16 llvm/tools/gccld/gccld.h:1.17
--- llvm/tools/gccld/gccld.h:1.16	Thu Apr 21 18:59:28 2005
+++ llvm/tools/gccld/gccld.h	Tue Aug  2 17:07:38 2005
@@ -45,6 +45,7 @@
                 const sys::Path &gcc,
                 char ** const envp,
                 bool Shared,
+                bool ExportAllAsDynamic,
                 const std::string &RPath,
                 const std::string &SOName,
                 bool Verbose=false);






More information about the llvm-commits mailing list