Building GNU EMACS 18.55 on Sparc Sunos4.1

Martin Leclerc SE Sun Montreal martin at verdelait.canada.sun.com
Fri Jul 20 04:09:23 AEST 1990


The problems you described have been documented in gnu.emacs.bug.  Here is
a summary posting from that group.

>From fmbutt at mrbt.sw.stratus.com Mon Jul  2 20:28:40 1990
>Subject: Re: emacs on SUN o/s 4.1 malloc bug
>
>In article <9006270051.AA01989 at design.caltech.edu> you write:
>We have found that emacs 18.55 won't run on a SUN Sparc machine,
>...
>please let me know when/if you figure out a good solution to the 
>malloc problem (i.e. get the GNU malloc to work). I also had to 
>#define SYSTEM_MALLOC to get gnuemacs to work....

I am including (below) a response that we previously got to our inquiry.
We have implemented this change on both SUN3 and SPARC systems running sun
o/s 4.1 (emacs 18.55) with success.  We NO LONGER define SYSTEM_MALLOC
(and hence use the gnu malloc).  I created a new s-sunos4.1.h (that I
include instead of s-sunos4.h in ./src/config.h):

----- Beginning of s-sunos4.1.h -----

#include "s-bsd4-2.h"

/* Say that the text segment of a.out includes the header;
   the header actually occupies the first few bytes of the text segment
   and is counted in hdr.a_text.  */

#define O_NDELAY        FNDELAY /* Non-blocking I/O (4.2 style) */
#define LD_SWITCH_SYSTEM -e __start -Bstatic

/* Include this definition for sun o/s 4.1  E.Antonsson, Caltech, 26-Jun-90 */
/* #define SYSTEM_MALLOC */
#define SUNOS_LOCALTIME_BUG
----- End of s-sunof4.1.h -----
See below:

-erik

----- Begin Included Message -----

X-Subject: emacs on SUN o/s 4.1 malloc bug

>    Is this the correct fix for the problem?

The correct fix for the problem is up to Sun; there is a SunOS library
function in localtime.o which requests eight bytes from malloc and writes
the ninth.  The enclosed patch is a workaround which allows you to use GNU
malloc instead of SunOS malloc.


*** malloc.c~	Fri Apr  7 22:12:10 1989
--- malloc.c	Tue May  8 07:07:22 1990
***************
*** 476,482 ****
--- 476,487 ----
       multiple of 8, then figure out which nestf[] area to use.
       Both the beginning of the header and the beginning of the
       block should be on an eight byte boundary.  */
+ #ifdef SUNOS_LOCALTIME_BUG
+   /* SunOS 4.1 localtime scribbles on the ninth byte.  */
+   nbytes = (n + ((sizeof *p + 15) & ~15) + EXTRA + 15) & ~15;
+ #else
    nbytes = (n + ((sizeof *p + 7) & ~7) + EXTRA + 7) & ~7;
+ #endif
    {
      register unsigned int   shiftr = (nbytes - 1) >> 2;

Martin Leclerc			Martin.Leclerc at Canada.sun.com 
System Engineer			(514) 744-9240
Sun Microsystems Canada



More information about the Comp.sys.sun mailing list