🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #99644

Gcc compiled temacs (epoch 3.1) dies in alloc.c -- help

#99644
From: meissner
Date: Wed, 20 Jun 1990 19:48
65 lines
2766 bytes
Manavendra K. Thakur (thakur@ZERKALO.HARVARD.EDU) writes:

| I can't get a gcc-compiled temacs to work properly.  Here is the error
| I get during the make:
| 
| ./temacs -batch -l inc-vers
| *** Bus error
| make: Fatal error: Command failed for target `epoch'

	....

| Here is the section of the code that causes the problem:
| 
| 
| 
| #define NSTATICS 200
| 
| char staticvec1[NSTATICS * sizeof (Lisp_Object *)] = {0};
| 
| int staticidx = 0;
| 
| #define staticvec ((Lisp_Object **) staticvec1)
| 
| /* Put an entry in staticvec, pointing at the variable whose address
| is given */
| 
| void
| staticpro (varaddress)
|      Lisp_Object *varaddress;
| {
|   staticvec[staticidx++] = varaddress;
|   if (staticidx >= NSTATICS)
|     abort ();
| }

I believe I've seen this reported before.  Anyway GCC is not aligning
staticvec1 to a word boundary, and evidently the Sun C compiler is.
Since it is a char array, GCC is within it's rights not to align this.
To change this, you might try and change the declaration to:

#define NSTATICS 200
Lisp_Object *staticvec[NSTATICS] = {0};

and then GCC should align the array with no problem.  It also allows
slightly better debugging if you are debugging the pure_copy stuff in
building xemacs from temacs (kids don't try this at home :-).
 
| 
| Note that Lisp_Object is an int here.  I know about the incompatible
| calling conventions for structures and unions on the sparc, but as far
| as I can tell, this isn't relevant here since we're dealing with
| arrays and ints.  (Please correct me if I'm wrong.)
| 
| Anybody know of a fix for this?  (As mentioned above, a workaround for
| now is to compile alloc.c with Sun cc.)  I believe the alloc.c for
| Epoch 3.1 should be the same as the alloc.c for Emacs 18.55, so that
| should help in tracking down the bug.

Yes it's a bug in the 18.55 release as well.  Obviously few people on
Sparc's use GCC to compile emacs......
--
Michael Meissner	email: meissner@osf.org		phone: 617-621-8861
Open Software Foundation, 11 Cambridge Center, Cambridge, MA

Do apple growers tell their kids money doesn't grow on bushes?
Technical Details
Message-ID: <9006201948.AA00998@curley.osf.org>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!snorkelwacker!tut.cis.ohio-state.edu!osf.org!meissner

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,a281dcd450968584,start
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1990-06-20 12:48:00 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!snorkelwacker!tut.cis.ohio-state.edu!osf.org!meissner
From: meissner@osf.org
Newsgroups: gnu.emacs.bug
Subject: Gcc compiled temacs (epoch 3.1) dies in alloc.c -- help
Message-ID: <9006201948.AA00998@curley.osf.org>
Date: 20 Jun 90 19:48:00 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 65
Posted: Wed Jun 20 20:48:00 1990