lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Jim Pryor wrote:
> [...] and adds -fPIC to the CFLAGS. This is needed to be able to build
> liblua.so on x86_64.

Looks like GCC treats references to assembler functions and static
C functions differently in PIC mode. Here's the fix:

Edit lcoco.c and replace the definition of coco_wrap_main plus the
assembler stuff immediately below it with this code:

static void coco_wrap_main(void)
{
  __asm__ __volatile__ ("\tmovq %r13, %rdi\n\tjmpq *%r12\n");
}

I'll release an update to Coco ASAP.

--Mike