[LLVMbugs] [Bug 6499] New: clang can't produce jit code with glibc

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Mar 4 14:32:42 PST 2010


http://llvm.org/bugs/show_bug.cgi?id=6499

           Summary: clang can't produce jit code with glibc
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: minor
          Priority: P5
         Component: Driver
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: castet.matthieu at free.fr
                CC: llvmbugs at cs.uiuc.edu


clang identify as gcc, but in new glibc header if gcc is detected some function
in header are optimized as inline asm.

For example select.h contains [1]. This make llvm bytecode not runnable with
lli jit :

LLVM ERROR: JIT does not support inline asm!



[1]
#if defined __GNUC__ && __GNUC__ >= 2

# if __WORDSIZE == 64
#  define __FD_ZERO_STOS "stosq"
#  define __FD_SET_BTS "btsq"
#  define __FD_CLR_BTR "btrq"
#  define __FD_ISSET_BT "btq"
# else
#  define __FD_ZERO_STOS "stosl"
#  define __FD_SET_BTS "btsl"
#  define __FD_CLR_BTR "btrl"
#  define __FD_ISSET_BT "btl"
# endif
# define __FD_ZERO(fdsp) \
  do {                                                                        \
    int __d0, __d1;                                                           \
    __asm__ __volatile__ ("cld; rep; " __FD_ZERO_STOS                         \
                          : "=c" (__d0), "=D" (__d1)                          \
                          : "a" (0), "0" (sizeof (fd_set)                     \
                                          / sizeof (__fd_mask)),              \
                            "1" (&__FDS_BITS (fdsp)[0])                       \
                          : "memory");                                        \
  } while (0)

#else
# define __FD_ZERO(set)  \
  do {                                                                        \
    unsigned int __i;                                                         \
    fd_set *__arr = (set);                                                    \
    for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i)          \
      __FDS_BITS (__arr)[__i] = 0;                                            \
  } while (0)
#endif

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list