Subject: Building emacs on Solaris
To: None <tech-pkg@netbsd.org>
From: Peter Schuller <peter.schuller@infidyne.com>
List: tech-pkg
Date: 12/25/2006 17:16:34
Hello,

install emacs with GCC 3.4.5 on Solaris Express nvb54 fails with:

gmake[1]: Entering directory 
`/usr/pkgsrc/editors/emacs/work/emacs-21.4/lib-src'
../src/emacs -batch -l /usr/pkgsrc/editors/emacs/work/emacs-21.4/lib-src/../lisp/mail/blessmail.el
Wrote /usr/pkgsrc/editors/emacs/work/emacs-21.4/lib-src/blessmail
Fatal error (11).gmake[1]: *** [blessmail] Segmentation Fault (core dumped)
gmake[1]: *** Deleting file `blessmail'
gmake[1]: Leaving directory 
`/usr/pkgsrc/editors/emacs/work/emacs-21.4/lib-src'
gmake: *** [blessmail] Error 2
*** Error code 2

The problem is caused by the resulting emacs binary coredumping on exit. The 
above symptome, aswell as the core dump generated by emacs (crashing in #6  
0x0808c2c5 in __do_global_dtors_aux ()), all seem to indicate that this is 
the problem discussed here:

   http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11386

And in some other places.

However, emacs *IS* being compiled with -fno-initialized-in-bss, as per 
Makefile.common:

.include "../../mk/compiler.mk"
.if !empty(CC_VERSION:Mgcc-3.*)
CFLAGS+=        -fno-zero-initialized-in-bss
.endif

I have also verified through "bmake show-var" and through inspecting the build 
log with PKG_DEBUG_LEVEL=2 that -fno-zero-initialized-in-bss is indeed being 
used during the build.

Compiling a sample file:

int test = 0;

int
main(void)
{
   return 0;
}

with and without -fno-zero-initialized-in-bss does yield the expected 4 byte 
difference in the size of the resulting binary, which I take as an indication 
that the option has not somehow been disabled in GCC.

Can anyone shed some light on this?

-- 
/ Peter Schuller, InfiDyne Technologies HB

PGP userID: 0xE9758B7D or 'Peter Schuller <peter.schuller@infidyne.com>'
Key retrieval: Send an E-Mail to getpgpkey@scode.org
E-Mail: peter.schuller@infidyne.com Web: http://www.scode.org