[erlang-questions] 64bit compiled beams not running on 32 bit machines

Mikael Pettersson <>
Fri Aug 15 23:11:37 CEST 2008


Anders Nygren writes:
 > On Fri, Aug 15, 2008 at 2:16 PM, Mikael Pettersson <> wrote:
 > > Logan, Martin writes:
 > >  > In working on Erlware we have run into cases where apps containing only
 > >  > beam object code get published from 64 bit machines and are subsequently
 > >  > installed and run on 32 bit machines (the code is "generic" after all)
 > >  > and so the installer makes no distinction in cases of pure beam code.
 > >  > Well, as it turns out we have seen problems.
 > >
 > > What problems?
 > 
 > The problem that I remember was that hipe itself does not work on a 32 bit
 > system when it has been compiled on a 64 bit system.
 > I.e. I once got from Erlware a hipe that was compiled for 64 bits and I have 32
 > bit machine. When I tried to compile another module with +native the
 > compilation failed.
 > 
 > As far as I understand the hipe application is pure erlang, but there
 > is a .hrl file
 > in hipe that defines the sizes of various object, and these sizes depends on the
 > word size of the machine. I think it was lib/hipe/rtl/hipe_literals.hrl.

Yes, that .hrl file is how most of the runtime system properties
are communicated to the HiPE compiler right now. It unfortunately
breaks the "move .beam files to another machine" use case, and
should be considered a bug.

Thanks for the reminder. I'll see if we can find a way to eliminate
this too-early binding mechanism, at least for properties that aren't
invariant for a given BEAM VM version.

/Mikael



More information about the erlang-questions mailing list