[erlang-questions] HiPE code from i386 linux portable to amd64 linux?

Kostis Sagonas kostis@REDACTED
Sat Nov 1 15:05:55 CET 2008


Mikael Pettersson wrote:
>  >  Is there any way to tell if a given beam contains
>  > native code that is incompatible.on a given erlang?
> 
> Not in any easy-to-use way no. You currently have to load the
> module and observe any warnings, and observe if it executes
> in native or interpreted mode. The latter you can do by calling
> hipe_bifs:in_native/0 and checking its boolean return value.

It's indeed a bit unfortunate that one has to load the file to see 
whether it contains native code for the given architecture or not, but 
there is a better way to see whether a file contains native code or not.

1> code:is_module_native(foo).
undefined
2> c(foo).
{ok,foo}
3> code:is_module_native(foo).
false
4> c(foo, [native]).
{ok,foo}
5> code:is_module_native(foo).
true


Kostis



More information about the erlang-questions mailing list