Package: llvm
This patch is needed for llvm to be able to compile opengtl on amd64.
Also it needs to be compiled with -fPIC.
Patch by Cyrille Berger.
Jonathan
--- a/lib/Target/X86/X86JITInfo.cpp.orig2008-07-02 09:41:02.0
+0200
+++ b/lib/Target/X86/X86JITInfo.cpp 2008-07-02 09:41:51.0 +0200
@@ -25,8 +25,10 @@
// Determine the platform we're running on
#if defined (__x86_64__) || defined (_M_AMD64)
# define X86_64_JIT
+# define ASMSUFFIX "@PLT"
#elif defined(__i386__) || defined(i386) || defined(_M_IX86)
# define X86_32_JIT
+# define ASMSUFFIX
#endif
void X86JITInfo::replaceMachineCodeForFunction(void *Old, void *New) {
@@ -112,7 +114,7 @@
// JIT callee
"movq%rbp, %rdi\n"// Pass prev frame and return address
"movq8(%rbp), %rsi\n"
-"call" ASMPREFIX "X86CompilationCallback2\n"
+"call" ASMPREFIX "X86CompilationCallback2" ASMSUFFIX "\n"
// Restore all XMM arg registers
"movaps 112(%rsp), %xmm7\n"
"movaps 96(%rsp), %xmm6\n"
@@ -186,7 +188,7 @@
"movl4(%ebp), %eax\n" // Pass prev frame and return address
"movl%eax, 4(%esp)\n"
"movl%ebp, (%esp)\n"
-"call" ASMPREFIX "X86CompilationCallback2\n"
+"call" ASMPREFIX "X86CompilationCallback2" ASMSUFFIX "\n"
"movl%ebp, %esp\n"// Restore ESP
CFI(".cfi_def_cfa_register %esp\n")
"subl$12, %esp\n"
@@ -240,7 +242,7 @@
"movl4(%ebp), %eax\n" // Pass prev frame and return address
"movl%eax, 4(%esp)\n"
"movl%ebp, (%esp)\n"
-"call" ASMPREFIX "X86CompilationCallback2\n"
+"call" ASMPREFIX "X86CompilationCallback2" ASMSUFFIX "\n"
"addl$16, %esp\n"
"movaps 48(%esp), %xmm3\n"
CFI(".cfi_restore %xmm3\n")
--- debian/llvm-2.3/debian/rules2008-11-17 10:32:13.0 +
+++ llvm-2.3/debian/rules 2008-11-17 10:32:48.0 +
@@ -42,7 +42,7 @@
confargs_gcc:= $(confargs)
confargs_llvm += \
- --prefix=$(PF)
+ --prefix=$(PF) --enable-pic --with-pic
confargs_gcc += \
--prefix=$(PF)/gcc-$(gcc_version) \