[erlang-questions] NIF + HiPE - can it works together?

Paul Davis <>
Tue Jun 7 01:39:59 CEST 2011


I'm fairly certain that I saw somewhere that HiPE is incompatible with
NIF's but I'm unable to actually Google a reference so I could be
making that up based on that on_init error that I've seen before.

If so, I'd probably just shove the code you want HiPE compiled into a
lib module and have the nif stubs call out to that as necessary.

HTH,
Paul Davis

2011/6/6 Radosław Bułat <>:
> 2011/6/7 Radosław Bułat <>:
>> 2011/6/6 Mikael Pettersson <>:
>>> Please post a standalone and minimal test case.
>>>
>> Yeah, sure.
>>
>
> One more thing. When module is compiled with HiPE and try to use
> on_load attribute it ends with error:
>
> <HiPE (v 3.8)> EXITED with reason {'trans_fun/2',on_load}
> @hipe_beam_to_icode:1148
>
> =ERROR REPORT==== 7-Jun-2011::01:18:36 ===
> Error in process <0.50.0> with exit value:
> {{badmatch,{'EXIT',{{hipe_beam_to_icode,1148,{'trans_fun/2',on_load}},[{hipe_beam_to_icode,trans_fun,2},{hipe_beam_to_icode,trans_fun,2},{hipe_beam_to_icode,trans_mfa_code,5},{hipe_beam_to_icode,trans_beam_function_chunk...
>
> src/nif_with_hipe.erl:none: internal error in native_compile;
> crash reason: {{badmatch,
>                   {'EXIT',
>                       {{hipe_beam_to_icode,1148,{'trans_fun/2',on_load}},
>                        [{hipe_beam_to_icode,trans_fun,2},
>                         {hipe_beam_to_icode,trans_fun,2},
>                         {hipe_beam_to_icode,trans_mfa_code,5},
>                         {hipe_beam_to_icode,trans_beam_function_chunk,2},
>                         {hipe_beam_to_icode,'-module/2-lc$^1/1-1-',2},
>                         {hipe,get_beam_icode,4},
>                         {hipe,'-run_compiler_1/3-fun-0-',4}]}}},
>               [{hipe,get_beam_icode,4},{hipe,'-run_compiler_1/3-fun-0-',4}]}
>
> --
> Pozdrawiam
>
> Radosław Bułat
> http://radarek.jogger.pl - mój blog
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>



More information about the erlang-questions mailing list