[erlang-questions] Erlang in Debian on m68k architecture

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


Hi!

As one can see, erlang Debian package (R11B-2 relese, 11.b.2 in Debian
versioning) fails to build on m68k now
(http://buildd.debian.org/fetch.cgi?&pkg=erlang&ver=1%3A11.b.2-4&arch=m68k&stamp=1167824208&file=log).

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)));

 void
 erts_init_binary(void)
------------------------------------------------------------------

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