[llvm-branch-commits] [llvm-branch] r81691 - /llvm/branches/release_26/lib/Target/X86/X86JITInfo.cpp

Julien Lerouge jlerouge at apple.com
Thu Sep 17 13:50:22 PDT 2009


This seems to break the 2.6 build on MingW for me, I am getting the
following:

make[1]: Leaving directory
`/c/cygwin/home/jlerouge/buildbot/llvm-test-fixed-HEAD/llvm-build/tools'
c:/cygwin/home/jlerouge/buildbot/llvm-test-fixed-HEAD/llvm-build/Release/lib/libLLVMX86CodeGen.a(X86JITInfo.o):X86JITInfo.cpp:(.text+0x14):
undefined reference to `_X86CompilationCallback2'
c:/cygwin/home/jlerouge/buildbot/llvm-test-fixed-HEAD/llvm-build/Release/lib/libLLVMX86CodeGen.a(X86JITInfo.o):X86JITInfo.cpp:(.text+0x55):
undefined reference to `_X86CompilationCallback2'
collect2: ld returned 1 exit status
make[2]: ***
[/c/cygwin/home/jlerouge/buildbot/llvm-test-fixed-HEAD/llvm-build/Release/bin/llc.exe]
Error 1
make[1]: *** [llc/.makeall] Error 2
make: *** [all] Error 1

Should X86CompilationCallback2 be kept around ?

Thanks,
Julien

On Sun, Sep 13, 2009 at 06:54:32PM +0000, Tanya Lattner wrote:
> Author: tbrethou
> Date: Sun Sep 13 13:54:32 2009
> New Revision: 81691
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=81691&view=rev
> Log:
> Merge 81132 from mainline.
> Do not create calls via PLT in compilation callback - this is higly platform
> dependent. Hopefully, this will fix PR3801.
> 
> Modified:
>     llvm/branches/release_26/lib/Target/X86/X86JITInfo.cpp
> 
> Modified: llvm/branches/release_26/lib/Target/X86/X86JITInfo.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_26/lib/Target/X86/X86JITInfo.cpp?rev=81691&r1=81690&r2=81691&view=diff
> 
> ==============================================================================
> --- llvm/branches/release_26/lib/Target/X86/X86JITInfo.cpp (original)
> +++ llvm/branches/release_26/lib/Target/X86/X86JITInfo.cpp Sun Sep 13 13:54:32 2009
> @@ -52,13 +52,6 @@
>  #define GETASMPREFIX(X) GETASMPREFIX2(X)
>  #define ASMPREFIX GETASMPREFIX(__USER_LABEL_PREFIX__)
>  
> -// Check if building with -fPIC
> -#if defined(__PIC__) && __PIC__ && defined(__linux__)
> -#define ASMCALLSUFFIX "@PLT"
> -#else
> -#define ASMCALLSUFFIX
> -#endif
> -
>  // For ELF targets, use a .size and .type directive, to let tools
>  // know the extent of functions defined in assembler.
>  #if defined(__ELF__)
> @@ -131,7 +124,7 @@
>      // JIT callee
>      "movq    %rbp, %rdi\n"    // Pass prev frame and return address
>      "movq    8(%rbp), %rsi\n"
> -    "call    " ASMPREFIX "X86CompilationCallback2" ASMCALLSUFFIX "\n"
> +    "call    " ASMPREFIX "X86CompilationCallback2\n"
>      // Restore all XMM arg registers
>      "movaps  112(%rsp), %xmm7\n"
>      "movaps  96(%rsp), %xmm6\n"
> @@ -207,7 +200,7 @@
>      "movl    4(%ebp), %eax\n" // Pass prev frame and return address
>      "movl    %eax, 4(%esp)\n"
>      "movl    %ebp, (%esp)\n"
> -    "call    " ASMPREFIX "X86CompilationCallback2" ASMCALLSUFFIX "\n"
> +    "call    " ASMPREFIX "X86CompilationCallback2\n"
>      "movl    %ebp, %esp\n"    // Restore ESP
>      CFI(".cfi_def_cfa_register %esp\n")
>      "subl    $12, %esp\n"
> @@ -263,7 +256,7 @@
>      "movl    4(%ebp), %eax\n" // Pass prev frame and return address
>      "movl    %eax, 4(%esp)\n"
>      "movl    %ebp, (%esp)\n"
> -    "call    " ASMPREFIX "X86CompilationCallback2" ASMCALLSUFFIX "\n"
> +    "call    " ASMPREFIX "X86CompilationCallback2\n"
>      "addl    $16, %esp\n"
>      "movaps  48(%esp), %xmm3\n"
>      CFI(".cfi_restore %xmm3\n")
> @@ -331,7 +324,14 @@
>  /// function stub when we did not know the real target of a call.  This function
>  /// must locate the start of the stub or call site and pass it into the JIT
>  /// compiler function.
> -extern "C" void ATTRIBUTE_USED
> +extern "C" {
> +#if !(defined (X86_64_JIT) && defined(_MSC_VER))
> + // the following function is called only from this translation unit,
> + // unless we are under 64bit Windows with MSC, where there is 
> + // no support for inline assembly
> +static
> +#endif
> +void ATTRIBUTE_USED
>  X86CompilationCallback2(intptr_t *StackPtr, intptr_t RetAddr) {
>    intptr_t *RetAddrLoc = &StackPtr[1];
>    assert(*RetAddrLoc == RetAddr &&
> @@ -403,6 +403,7 @@
>    *RetAddrLoc -= 5;
>  #endif
>  }
> +}
>  
>  TargetJITInfo::LazyResolverFn
>  X86JITInfo::getLazyResolverFunction(JITCompilerFn F) {
> 
> 
> _______________________________________________
> llvm-branch-commits mailing list
> llvm-branch-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-branch-commits
-- 
Julien Lerouge
PGP Key Id: 0xB1964A62
PGP Fingerprint: 392D 4BAD DB8B CE7F 4E5F FA3C 62DB 4AA7 B196 4A62
PGP Public Key from: keyserver.pgp.com



More information about the llvm-branch-commits mailing list