tags 328031 patch
thanks

Hi,

The bug is still present and is reproducible on an up-to-date sid system. After some investigation I was able to track it down to some strange sparc-specific tinkering with registers performed in erts/emulator/beam/beam_emu.c:

/*
 * On certain platforms, make sure the main variables really are placed
 * in registers.
 */

#if defined(__GNUC__) && defined(sparc) && !defined(DEBUG)
#  define REG_x0 asm("%l0")
#  define REG_xregs asm("%l1")
#  define REG_htop asm("%l2")
#  define REG_stop asm("%l3")
#  define REG_I asm("%l4")
#  define REG_fcalls asm("%l5")
#  define REG_tmp_arg1 asm("%l6")
#  define REG_tmp_arg2 asm("%l7")
#else
#  define REG_x0
#  define REG_xregs
#  define REG_htop
#  define REG_stop
#  define REG_I
#  define REG_fcalls
#  define REG_tmp_arg1
#  define REG_tmp_arg2
#endif

That sure does not work out well, since the bus error messages leading to build failure are happening in the process_main() function in the same file, where these defines are used for variable definitions. I can't really tell what is going wrong here, but removing the #if ... #endif in such a way that the REG_* defines always expand to nothing (the attached patch implements this change) allowed to build the package successfully. The patch and the complete build log may also be found at

http://www.wooyd.org/debian/erlang

I also have sparc binary debs, in case someone wants them.

Best regards,

Jurij Smakov                                        [EMAIL PROTECTED]
Key: http://www.wooyd.org/pgpkey/                   KeyID: C99E03CC
diff -aur a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c
--- a/erts/emulator/beam/beam_emu.c     2005-08-29 06:13:24.000000000 -0700
+++ b/erts/emulator/beam/beam_emu.c     2005-12-19 23:35:08.000000000 -0800
@@ -1013,16 +1013,6 @@
  * in registers.
  */
 
-#if defined(__GNUC__) && defined(sparc) && !defined(DEBUG)
-#  define REG_x0 asm("%l0")
-#  define REG_xregs asm("%l1")
-#  define REG_htop asm("%l2")
-#  define REG_stop asm("%l3")
-#  define REG_I asm("%l4")
-#  define REG_fcalls asm("%l5")
-#  define REG_tmp_arg1 asm("%l6")
-#  define REG_tmp_arg2 asm("%l7")
-#else
 #  define REG_x0
 #  define REG_xregs
 #  define REG_htop
@@ -1031,7 +1021,6 @@
 #  define REG_fcalls
 #  define REG_tmp_arg1
 #  define REG_tmp_arg2
-#endif
 
 /*
  * process_main() is called twice:

Reply via email to