[erlang-questions] State of the Union: FFI
Zvi
exta7@REDACTED
Wed Apr 15 19:25:39 CEST 2009
Hi Franco,
I got to the point where it's compiling.
For some reason the erl_ddll.erl didn't built by make clean (probably
prebuilt), so I did:
but FFI still doesn't work:
Erlang R13A (erts-5.7) [source] [rq:1] [async-threads:0] [hipe]
[kernel-poll:false]
Eshell V5.7 (abort with ^G)
1> ffi:sizeof(uint).
4
2> erl_ddll:load_library("/tmp", libc, [{preload, [{isupper,
{sint,sint}}]}]).
{error,{open_error,-12}}
3>
I tried to generate a diff against your zip, but it generates to many
changes b/c you included all the i386-apple-darwin9.6.0 stuff).
There is no ArithAlloc macro in R13A, so I changed it to HAlloc.
There is digit_t type in R13A so I defined it as ErtsHalfDigit (typedef
Uint16 digit_t;)
Fortunattely there not too much changes:
beam/erl_bif_ddll.c:833:
res = build_preloads_info(p, de->hndl);
CHANGED_TO:
res = build_preloads_info(p, drv->handle); /* ZVI */
beam/erl_bif_ddll.c:1790
erts_free(ERTS_ALC_T_DRV, q->drv->driver_name);
CHANGED_TO:
erts_free(ERTS_ALC_T_DRV, q->entry->driver_name); /* ZVI */
beam/erl_bif_ddll.c:1791
erts_free(ERTS_ALC_T_DRV, q->drv);
CHANGED_TO:
erts_free(ERTS_ALC_T_DRV, q->entry); /* ZVI */
beam/erl_bif_ffi_endianness.h:185
hp = ArithAlloc(p, 1 + 1);
CHANGED_TO:
hp = HAlloc(p, 1 + 1); /* ZVI */
beam/erl_bif_ffi_endianness.h:207
hp = ArithAlloc(p, 1 + words_count);
CHANGED_TO:
hp = HAlloc(p, 1 + words_count); /* ZVI */
beam/erl_bif_ffi_endianness.h:36
ADDED:
#define digit_t ErtsHalfDigit
Can you prepare a clean diff against R13A sources?
Maybe Alceste will help us.
BR,
Zvi
Zvi wrote:
>
> Hi Franco,
>
> did u run ./otp_build autoconf before ./configure ?
> You need to install autoconf to use it:
>
> apt-get install autoconf
>
> I did:
>
> ./otp_build autoconf
> ./configure
> make
>
> and got compilation errors in beam/erl_bif_ddll.c :
>
>
> beam/erl_bif_ddll.c: In function 'erl_ddll_info_2':
> beam/erl_bif_ddll.c:833: error: 'de' undeclared (first use in this
> function)
> beam/erl_bif_ddll.c:833: error: (Each undeclared identifier is reported
> only once
> beam/erl_bif_ddll.c:833: error: for each function it appears in.)
> beam/erl_bif_ddll.c: In function 'do_unload_driver_entry':
> beam/erl_bif_ddll.c:1790: error: 'erts_driver_t' has no member named 'drv'
> beam/erl_bif_ddll.c:1791: error: 'erts_driver_t' has no member named 'drv'
> make[3]: *** [obj/i686-pc-linux-gnu/opt/smp/erl_bif_ddll.o] Error 1
> make[3]: Leaving directory `/root/erlang/otp_src_R13A-ffi/erts/emulator'
> make[2]: *** [opt] Error 2
> make[2]: Leaving directory `/root/erlang/otp_src_R13A-ffi/erts/emulator'
> make[1]: *** [smp] Error 2
> make[1]: Leaving directory `/root/erlang/otp_src_R13A-ffi/erts'
> make: *** [emulator] Error 2
> [root@REDACTED otp_src_R13A-ffi]#
>
>
> Thanks,
> Zvi
>
>
>
>
> Franco Milicchio-4 wrote:
>>
>> I have started porting the patch to R13A, although I can't say if it
>> really works: it doesn't compile! Makefile error, not a C one :)
>>
>> You may find the source code at:
>> http://plm.dia.uniroma3.it/milicchio/public/otp_src_R13A-ffi.zip
>> (62 MB)
>>
>>
>> I have no time left today, but if we all start figuring out what's
>> wrong with it, we may end up having the FFI working on this new
>> release. I have marked the C code with comments (/* FFI START */ and /
>> * FFI END */) where I had doubts about applying Alceste's patch, so it
>> should be easy to spot them.
>>
>> By the way, no news about the reason FFI hasn't been taken into
>> account yet?
>>
>> Cheers!
>>
>> --
>> Franco Milicchio <fmilicchio@REDACTED>
>>
>> DIA - Dept. of Computer Science and Engineering
>> University Roma Tre
>> http://plm.dia.uniroma3.it/milicchio/
>>
>>
>>
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://www.erlang.org/mailman/listinfo/erlang-questions
>>
>
>
--
View this message in context: http://www.nabble.com/State-of-the-Union%3A-FFI-tp22824174p23063427.html
Sent from the Erlang Questions mailing list archive at Nabble.com.
More information about the erlang-questions
mailing list