-fPIC is required on x86-64 when building shared objects.

llvm-svn: 49274
This commit is contained in:
Torok Edwin 2008-04-06 12:42:29 +00:00
parent 784903e4c1
commit 538160b7ff
2 changed files with 2 additions and 2 deletions

View 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";

View 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__