[erlang-questions] Erlang in Debian on m68k architecture

Sergei Golovan sgolovan@REDACTED
Thu Jan 25 12:12:17 CET 2007


As one can see, erlang Debian package (R11B-2 relese, 11.b.2 in Debian
versioning) fails to build on m68k now

After some research, we've found that erlang relies on the alignment
of some global variable. The following patch fixes it:
--- erlang-11.b.2.orig/erts/emulator/beam/binary.c
+++ erlang-11.b.2/erts/emulator/beam/binary.c
@@ -31,7 +31,7 @@
 #include "erl_bits.h"

 Uint erts_allocated_binaries;
-erts_mtx_t erts_bin_alloc_mtx;
+erts_mtx_t erts_bin_alloc_mtx __attribute__ ((aligned (4)));


So, the question is the following: Are global variables supposed to be
always aligned? Is this a bug in GCC that it doesn't align the
variable? Or is this a bug in erlang, and the fact that it works on
other architectures is a lucky coincidence?

Best wishes!
Sergei Golovan

More information about the erlang-questions mailing list