-fPIC is required on x86-64 when building shared objects.
authorTorok Edwin <edwintorok@gmail.com>
Sun, 6 Apr 2008 12:42:29 +0000 (12:42 +0000)
committerTorok Edwin <edwintorok@gmail.com>
Sun, 6 Apr 2008 12:42:29 +0000 (12:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49274 91177308-0d34-0410-b5e6-96231b3b80d8

tools/bugpoint/Miscompilation.cpp
tools/bugpoint/ToolRunner.cpp

index 9f4d2efc915c6c681ea8fc6ffe0564a1791515af..f2b1c724b6e351f4a7b27d4f3a254938a614342b 100644 (file)
@@ -907,7 +907,7 @@ bool BugDriver::debugCodeGenerator() {
 #if defined(sparc) || defined(__sparc__) || defined(__sparcv9)
             << " -G"            // Compile a shared library, `-G' for Sparc
 #else
-            << " -shared"       // `-shared' for Linux/X86, maybe others
+            << " -fPIC -shared"       // `-shared' for Linux/X86, maybe others
 #endif
             << " -fno-strict-aliasing\n";
 
index aa3caff0267a8bda368f705709885e03284e18b7..d1e058e3ceb95aec3fcee6dd1eb664b8c3f3bed9 100644 (file)
@@ -572,7 +572,7 @@ int GCC::MakeSharedObject(const std::string &InputFile, FileType fileType,
   GCCArgs.push_back("-shared");  // `-shared' for Linux/X86, maybe others
 #endif
 
-#if defined(__ia64__) || defined(__alpha__)
+#if defined(__ia64__) || defined(__alpha__) || defined(__amd64__)
   GCCArgs.push_back("-fPIC");   // Requires shared objs to contain PIC
 #endif
 #ifdef __sparc__