[erlang-bugs] R15B02 HiPE can't compile modules with on_load attribute
Mon Nov 26 15:35:14 CET 2012
On 11/25/2012 08:16 PM, José Valim wrote:
> HiPE can't compile a module with on_load attribute. This sample module
> %% Exporting the function doesn't affect the outcome
> %% -exports([do_nothing/0]).
> do_nothing() -> ok.
> When compiled via command line or via compile:forms.
> A snippet of the error message is:
> =ERROR REPORT==== 25-Nov-2012::18:48:29 ===
> Error in process <0.88.0> with exit value:
I can easily provide a patch that makes the HiPE compiler not crash when
it finds an "on_load" BEAM instruction, but the real fix involves
changing the HiPE loader to trigger execution of functions specified as
part of the on_load attribute declaration.
Perhaps somebody at OTP who is more familiar with the magic that the
BEAM loader does when it finds BEAM code with on_load instructions can
do this -- or at least help here.
More information about the erlang-bugs