Correctly build shared objects on MacOS X for debugging code generators
authorMisha Brukman <brukman+llvm@gmail.com>
Fri, 16 Jul 2004 19:45:45 +0000 (19:45 +0000)
committerMisha Brukman <brukman+llvm@gmail.com>
Fri, 16 Jul 2004 19:45:45 +0000 (19:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14892 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/ToolRunner.cpp
tools/bugpoint/ToolRunner.cpp

index a28527a1c278843563669f05a854edbc8f1527de..73a0c314186ce705c6e92e8218503d4276ab609f 100644 (file)
@@ -403,7 +403,11 @@ int GCC::MakeSharedObject(const std::string &InputFile, FileType fileType,
     InputFile.c_str(),           // Specify the input filename...
 #if defined(sparc) || defined(__sparc__) || defined(__sparcv9)
     "-G",                        // Compile a shared library, `-G' for Sparc
-#else                             
+#elif (defined(__POWERPC__) || defined(__ppc__)) && defined(__APPLE__)
+    "-dynamiclib",               // `-dynamiclib' for MacOS X/PowerPC
+    "-fno-common",               // allow global vars w/o initializers to live
+                                 // in data segment, rather than generating blocks
+#else
     "-shared",                   // `-shared' for Linux/X86, maybe others
 #endif
     "-o", OutputFile.c_str(),    // Output to the right filename...
index a28527a1c278843563669f05a854edbc8f1527de..73a0c314186ce705c6e92e8218503d4276ab609f 100644 (file)
@@ -403,7 +403,11 @@ int GCC::MakeSharedObject(const std::string &InputFile, FileType fileType,
     InputFile.c_str(),           // Specify the input filename...
 #if defined(sparc) || defined(__sparc__) || defined(__sparcv9)
     "-G",                        // Compile a shared library, `-G' for Sparc
-#else                             
+#elif (defined(__POWERPC__) || defined(__ppc__)) && defined(__APPLE__)
+    "-dynamiclib",               // `-dynamiclib' for MacOS X/PowerPC
+    "-fno-common",               // allow global vars w/o initializers to live
+                                 // in data segment, rather than generating blocks
+#else
     "-shared",                   // `-shared' for Linux/X86, maybe others
 #endif
     "-o", OutputFile.c_str(),    // Output to the right filename...