Porting to IRIX

Ben 'The Con Man' Kahn <>
Thu Dec 10 16:53:15 CET 1998


	I seem to suddenly need erlang on IRIX and Linux.  Everything
works fine on Linux, of course.  But now I'm porting erlang to IRIX 6.5.
(64 bit)  I will post all my changes back to this list for people to use.
For the moment however, I'm not changing things in a cross-platform
manner.  I'm simply making changes so things work.  (Hack and slash
method.)  When I get a little better at autoconf I'll make fixes the
correct way.

	1) gcc doesn't work on IRIX above 5.3.  :^(
	2) SGI's cc doesn't support any -W options.  I had to remove them.
	3) SGI's cc doesn't support -fno-inline
	4) IRIX doesn't seem to support vfork.  (I havn't found it yet.)
	5) There are a number of compile problems with standard c 
	   shortcuts which seem not to compile.  I've added casts in
           a number of places to make things work.

	I've now compiled the package on the SGI.  However, it seg faults
on startup.  So here is the stack dump.  There seem to be two problems --
the first is a memory allocation failure.  The second is a seg fault in
the reporting of that error.  :^)

	Here is the stack trace:

Thread 0x10000
>  0 strlen(0x0, 0x1009f326, 0x0, 0x1, 0x1, 0x0, 0x0, 0x0)
["/xlv41/6.5.2m/work/irix/lib/libc/libc_n32_M4/strings/strlen.s":58, 0xfad4e60]
   1 sys_printf(where = 6, format = 0x1009f310 = "<Erlang crash dump>\n%s\n", ... = <void>)
["erlang-47.4.0/erts/system/emulator/sys.unix/sys.c":2298, 0x10059eb8]
   2 erl_crash_dump(fmt = 0x1009dd40 = "Got unusable memory block 0x%x, size %u\n", args = 0x7fff2c50 = "")
["erlang-47.4.0/erts-47.4.0/system/emulator/runtime/break.c":499, 0x1004c36c]
   3 erl_exit(n = 1, fmt = 0x1009dd40 = "Got unusable memory block 0x%x, size %u\n", ... = <void>)
["erlang-47.4.0/erts-47.4.0/system/emulator/jam/mips-sgi-irix6.5/config.c":125, 0x1006f438]
   4 safe_alloc(len = 65536)
["erlang-47.4.0/erts-47.4.0/system/emulator/runtime/utils.c":528, 0x1000c5b8]
   5 erl_init()
["erlang-47.4.0/erts-47.4.0/system/emulator/runtime/erl_init.c":175, 0x10053240]
   6 erl_start(argc = 1, argv = 0x7fff2f04)
["erlang-47.4.0/erts-47.4.0/system/emulator/runtime/erl_init.c":469, 0x10054154]
   7 main(argc = 1, argv = 0x7fff2f04)
["erlang-47.4.0/erts/system/emulator/sys.unix/sys.c":254, 0x10054428]
   8 __start()
["/xlv55/kudzu-apr12/work/irix/lib/libc/libc_n32_M4/csu/crt1text.s":177, 0x10009d68]

	As you can see, it had a problem allocating memory.  (This machine
has HUGE ammounts of memory, but I haven't looked at how much has been  
allocated.)  This may be a problem with allocating more memory than is
available under IRIX.  (Linux will allocate more memory than is available,
which can lead to problems later.)  

	I would love any comments or suggestions...  If anyone wants the
patch files now (before things are working and before they are integrated
with the configure system) let me know.
	
						-Ben

------------------------------------ |\      _,,,--,,_  ,) ----------
Benjamin Kahn                        /,`.-'`'   -,  ;-;;'
(212) 924 - 2220                    |,4-  ) )-,_ ) /\
 --------------- '---''(_/--' (_/-' ---------------
    If you say it in CAPS, it means you spent the extra energy 
         hitting the SHIFT key to show you really MEAN it.






More information about the erlang-questions mailing list