[LLVMbugs] [Bug 16256] New: MCJIT on ARM does not link correctly external functions with double-typed arguments

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jun 7 01:40:20 PDT 2013


            Bug ID: 16256
           Summary: MCJIT on ARM does not link correctly external
                    functions with double-typed arguments
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Generic Execution Engine Support
          Assignee: unassignedbugs at nondot.org
          Reporter: dmitri.rubinstein at googlemail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

When external function accepts double-typed arguments MCJIT does not correctly
link it.

Following command sequence produces different results on x86_64 and ARM
(RaspberryPi VM with hard-float ABI, see below for details):

cat > printd.c <<EOF
#include <stdio.h>

double printd(double X)
   printf("printd: %f\n", X);
   return 0;

cat > print.c <<EOF
#include <stdio.h>

extern double printd(double X);

int main(int argc, char **argv)
   return 0;

gcc printd.c -fPIC -shared -o printd.so
clang -Wall -c -emit-llvm -O3 print.c -o print.bc
lli -use-mcjit -load=./printd.so print.bc

Correct output on x86_64:
printd: 123.000000
printd: 4.000000

Wrong output on ARM:
printd: 1.000000
printd: 0.000000

When printd definition is added into print.c everything works as expected.

ARM configuration is QEMU with RaspberryPi Raspbian “wheezy” kernel, 
hard float support:

cat /proc/cpuinfo 
Processor       : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS        : 602.11
Features        : swp half thumb fastmult vfp edsp java tls 
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xb76
CPU revision    : 7

Hardware        : ARM-Versatile PB
Revision        : 0000
Serial          : 0000000000000000

LLVM datalayout and triple produced by clang are:

target datalayout = 
target triple = "armv4t-unknown-linux-gnueabihf"

LLVM was cloned from git repository, branch release_33, latest commit:
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_33@182492

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130607/e50cfbad/attachment.html>

More information about the llvm-bugs mailing list