[ktap] Re: FFI Question

  • From: Nick H <nickkvm@xxxxxxxxx>
  • To: ktap@xxxxxxxxxxxxx
  • Date: Sat, 13 Sep 2014 14:23:54 -0700

Hello Azat,

Thanks for your response, comments inline:

On Fri, Sep 12, 2014 at 11:27 PM, Azat Khuzhin <a3at.mail@xxxxxxxxx> wrote:

> On Fri, Sep 12, 2014 at 03:38:08PM -0700, Nick H wrote:
> > Hello
> >
> > While trying to build ktap with FFI support I am facing the following
> > error. What am I missing here ? Suggestions appreciated.
>
> Hi, you could try $ git co b75e8b563c1d342e8577f97f8d610f9459705593^
> commit:
> $ make FFI=1 --silent
>     CHK libelf
>     CHK libelf
>     CHK libelf
>
>

After trying your suggestion, still getting compilation failures.That
commit is mentioning that FFI will not work...So should I simply wait for a
fix to arrive ? ..

nk@ir:~/work/projects/ktap$ git checkout
b75e8b563c1d342e8577f97f8d610f9459705593
HEAD is now at b75e8b5... Rebased on luajit and big refactor

nk@ir:~/work/projects/ktap$ make FFI=1 --silent
    CHK libelf
    CHK libelf
In file included from /home/nk/work/projects/ktap/runtime/amalg.c:39:0:
/home/nk/work/projects/ktap/runtime/ffi/ffi_call.c: In function
‘ffi_get_arg_csym’:
/home/nk/work/projects/ktap/runtime/ffi/ffi_call.c:59:2: error: implicit
declaration of function ‘ttypenv’ [-Werror=implicit-function-declaration]
/home/nk/work/projects/ktap/runtime/ffi/ffi_call.c:60:7: error:
‘KTAP_TYPE_LIGHTUSERDATA’ undeclared (first use in this function)
/home/nk/work/projects/ktap/runtime/ffi/ffi_call.c:60:7: note: each
undeclared identifier is reported only once for each function it appears in
/home/nk/work/projects/ktap/runtime/ffi/ffi_call.c:61:7: error:
‘KTAP_TYPE_BOOLEAN’ undeclared (first use in this function)
/home/nk/work/projects/ktap/runtime/ffi/ffi_call.c:62:7: error:
‘KTAP_TYPE_NUMBER’ undeclared (first use in this function)
/home/nk/work/projects/ktap/runtime/ffi/ffi_call.c:63:7: error:
‘KTAP_TYPE_STRING’ undeclared (first use in this function)
/home/nk/work/projects/ktap/runtime/ffi/ffi_call.c:65:7: error:
‘KTAP_TYPE_CDATA’ undeclared (first use in this function)
/home/nk/work/projects/ktap/runtime/ffi/ffi_call.c: In function
‘ffi_set_return’:
/home/nk/work/projects/ktap/runtime/ffi/ffi_call.c:293:3: warning:
assignment from incompatible pointer type [enabled by default]
/home/nk/work/projects/ktap/runtime/ffi/ffi_call.c:298:3: warning:
assignment from incompatible pointer type [enabled by default]
/home/nk/work/projects/ktap/runtime/ffi/ffi_call.c: In function ‘ffi_call’:
/home/nk/work/projects/ktap/runtime/ffi/ffi_call.c:322:2: error: unknown
type name ‘ktap_closure_t’
/home/nk/work/projects/ktap/runtime/ffi/ffi_call.c:341:5: warning:
assignment from incompatible pointer type [enabled by default]
In file included from /home/nk/work/projects/ktap/runtime/amalg.c:41:0:
/home/nk/work/projects/ktap/runtime/ffi/ffi_symbol.c: In function
‘setup_ffi_ctable’:
/home/nk/work/projects/ktap/runtime/ffi/ffi_symbol.c:63:2: error: too few
arguments to function ‘kp_tab_getint’
/home/nk/work/projects/ktap/runtime/kp_tab.c:297:6: note: declared here
/home/nk/work/projects/ktap/runtime/ffi/ffi_symbol.c:70:2: error: too few
arguments to function ‘kp_str_new’
/home/nk/work/projects/ktap/runtime/kp_str.c:132:14: note: declared here
/home/nk/work/projects/ktap/runtime/ffi/ffi_symbol.c:72:2: error: too few
arguments to function ‘kp_tab_get’
/home/nk/work/projects/ktap/runtime/kp_tab.c:364:6: note: declared here
/home/nk/work/projects/ktap/runtime/ffi/ffi_symbol.c:75:2: error: too few
arguments to function ‘kp_str_new’
/home/nk/work/projects/ktap/runtime/kp_str.c:132:14: note: declared here
/home/nk/work/projects/ktap/runtime/ffi/ffi_symbol.c:77:2: error: implicit
declaration of function ‘kp_tab_setvalue’
[-Werror=implicit-function-declaration]
/home/nk/work/projects/ktap/runtime/ffi/ffi_symbol.c: In function
‘add_ffi_func_to_ctable’:
/home/nk/work/projects/ktap/runtime/ffi/ffi_symbol.c:108:2: error: implicit
declaration of function ‘kp_obj_newobject’
[-Werror=implicit-function-declaration]
/home/nk/work/projects/ktap/runtime/ffi/ffi_symbol.c:108:2: error:
‘KTAP_TYPE_CDATA’ undeclared (first use in this function)
/home/nk/work/projects/ktap/runtime/ffi/ffi_symbol.c:114:2: error: too few
arguments to function ‘kp_str_new’
/home/nk/work/projects/ktap/runtime/kp_str.c:132:14: note: declared here
In file included from /home/nk/work/projects/ktap/runtime/amalg.c:42:0:
/home/nk/work/projects/ktap/runtime/ffi/cdata.c: In function ‘kp_cdata_new’:
/home/nk/work/projects/ktap/runtime/ffi/cdata.c:31:29: error:
‘KTAP_TYPE_CDATA’ undeclared (first use in this function)
/home/nk/work/projects/ktap/runtime/ffi/cdata.c: In function
‘kp_cdata_new_ptr’:
/home/nk/work/projects/ktap/runtime/ffi/cdata.c:62:3: error: implicit
declaration of function ‘kp_rawobj_alloc’
[-Werror=implicit-function-declaration]
/home/nk/work/projects/ktap/runtime/ffi/cdata.c:62:14: warning: assignment
makes pointer from integer without a cast [enabled by default]
/home/nk/work/projects/ktap/runtime/ffi/cdata.c: In function
‘kp_cdata_new_record’:
/home/nk/work/projects/ktap/runtime/ffi/cdata.c:82:17: warning: assignment
makes pointer from integer without a cast [enabled by default]
/home/nk/work/projects/ktap/runtime/ffi/cdata.c: In function
‘kp_cdata_type_match’:
/home/nk/work/projects/ktap/runtime/ffi/cdata.c:161:7: error:
‘KTAP_TYPE_LIGHTUSERDATA’ undeclared (first use in this function)
/home/nk/work/projects/ktap/runtime/ffi/cdata.c:164:7: error:
‘KTAP_TYPE_BOOLEAN’ undeclared (first use in this function)
/home/nk/work/projects/ktap/runtime/ffi/cdata.c:165:7: error:
‘KTAP_TYPE_NUMBER’ undeclared (first use in this function)
/home/nk/work/projects/ktap/runtime/ffi/cdata.c:172:7: error:
‘KTAP_TYPE_STRING’ undeclared (first use in this function)
/home/nk/work/projects/ktap/runtime/ffi/cdata.c:176:7: error:
‘KTAP_TYPE_CDATA’ undeclared (first use in this function)
/home/nk/work/projects/ktap/runtime/ffi/cdata.c: In function
‘kp_cdata_value’:
/home/nk/work/projects/ktap/runtime/ffi/cdata.c:197:7: error:
‘KTAP_TYPE_BOOLEAN’ undeclared (first use in this function)
/home/nk/work/projects/ktap/runtime/ffi/cdata.c:198:3: error: implicit
declaration of function ‘bvalue’ [-Werror=implicit-function-declaration]
/home/nk/work/projects/ktap/runtime/ffi/cdata.c:198:15: error: lvalue
required as unary ‘&’ operand
/home/nk/work/projects/ktap/runtime/ffi/cdata.c:201:7: error:
‘KTAP_TYPE_LIGHTUSERDATA’ undeclared (first use in this function)
/home/nk/work/projects/ktap/runtime/ffi/cdata.c:205:7: error:
‘KTAP_TYPE_NUMBER’ undeclared (first use in this function)
/home/nk/work/projects/ktap/runtime/ffi/cdata.c:209:7: error:
‘KTAP_TYPE_STRING’ undeclared (first use in this function)
/home/nk/work/projects/ktap/runtime/ffi/cdata.c: In function
‘kp_cdata_init’:
/home/nk/work/projects/ktap/runtime/ffi/cdata.c:283:3: warning: assignment
from incompatible pointer type [enabled by default]
/home/nk/work/projects/ktap/runtime/ffi/cdata.c:287:3: warning: assignment
from incompatible pointer type [enabled by default]
/home/nk/work/projects/ktap/runtime/ffi/cdata.c:301:3: warning: assignment
from incompatible pointer type [enabled by default]
/home/nk/work/projects/ktap/runtime/ffi/cdata.c: In function
‘kp_cdata_record_set’:
/home/nk/work/projects/ktap/runtime/ffi/cdata.c:375:2: error: implicit
declaration of function ‘is_shrstring’
[-Werror=implicit-function-declaration]
In file included from /home/nk/work/projects/ktap/runtime/amalg.c:44:0:
/home/nk/work/projects/ktap/runtime/lib_ffi.c: In function ‘kplib_ffi_new’:
/home/nk/work/projects/ktap/runtime/lib_ffi.c:54:2: warning: assignment
from incompatible pointer type [enabled by default]
/home/nk/work/projects/ktap/runtime/lib_ffi.c: In function ‘kplib_ffi_cast’:
/home/nk/work/projects/ktap/runtime/lib_ffi.c:79:2: warning: assignment
from incompatible pointer type [enabled by default]
cc1: some warnings being treated as errors
make[2]: *** [/home/nk/work/projects/ktap/runtime/amalg.o] Error 1
make[1]: *** [_module_/home/nk/work/projects/ktap] Error 2
make: *** [mod] Error 2

Thanks and Regards
N






> commit b75e8b563c1d342e8577f97f8d610f9459705593
> Author: Jovi Zhangwei <jovi.zhangwei@xxxxxxxxx>
> Date:   Thu Mar 27 21:29:14 2014 -0800
>
>     Rebased on luajit and big refactor
>     ...
>     Note: FFI is not working at this commit, fix it soon.
>
>     Signed-off-by: Jovi Zhangwei <jovi.zhangwei@xxxxxxxxx>
>
> Cheers,
> Azat.
>
>

Other related posts: