[erlang-questions] HIPE and on_load

Caragea Silviu <>
Mon Mar 6 15:57:34 CET 2017


Thanks,

I'll try to see if there is a way in mix file to specifiy what projects
should be built without HIPE. It's not so simple to take every single dep
and modify :)

Silviu

On Mon, Mar 6, 2017 at 4:51 PM, Kostis Sagonas <> wrote:

> On 03/06/17 16:45, Caragea Silviu wrote:
>
>> Hello,
>>
>> When I compile using HIPE: ERL_COMPILER_OPTIONS="[native,{hipe, [o3]}]"
>>
>> All dependencies using NIF's are failing to compile:
>>
>> <HiPE (v 3.15.3)> EXITED with reason {'trans_fun/2',on_load}
>> @hipe_beam_to_icode:1148
>>
>> Is this an expected behavior or anything I can do to bypass this ?
>>
>
> Yes, this is expected behaviour.
>
> The on_load attribute instructs the BEAM loader to do its magic when
> loading this module (typically containing NIFs).  Files containing NIFs
> typically only contain very minimal Erlang code so they do not benefit much
> from native code compilation anyway.  So simply do not compile them to
> native code.
>
> Perhaps adding an attribute
>
> -compile(no_native).
>
> on the source of the file will solve the problem?
>
> Kostis
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170306/80f2bf7f/attachment.html>


More information about the erlang-questions mailing list