Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!swrinde!ucsd!ucbvax!bloom-beacon!genmri.UUCP!doug From: doug@genmri.UUCP (Doug Becker) Newsgroups: comp.windows.x Subject: Troubles with gcc 1.37.1 and mit/rgb Message-ID: <9007131856.AA06628@genmri.sane.COM> Date: 13 Jul 90 18:57:20 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 69 I'm a novice at using gcc, and I'm having trouble with the rgb executable in the rgb subdirectory. BEFORE YOU TUNE OUT, I HAVE read the latest "most frequently asked questions." :-) I'm getting a segmentation violation from rgb/rgb when I compile with gcc 1.37.1 on a Sun 4/280 running SunOS 4.0.3c (fixincludes WAS run). I'm running X11R4 through patchlevel 12. Here is a sample (some newlines inserted by the selection mechanism): genmri# pwd /home/X11/mit/rgb genmri# make clean rm -f rgb rm -f showrgb rm -f rgb.pag rgb.dir rm -f *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut \#* genmri# make gcc -DNOSTDHDRS -fstrength-reduce -fpcc-struct-return -g -I../. -I../. -I.././ server/include -DNDBM -sun4 -c rgb.c rm -f rgb gcc -DNOSTDHDRS -fstrength-reduce -fpcc-struct-return -o rgb rgb.o -g -ldbm gcc -DNOSTDHDRS -fstrength-reduce -fpcc-struct-return -g -I../. -I../. -I.././ server/include -DNDBM -sun4 -c showrgb.c rm -f showrgb gcc -DNOSTDHDRS -fstrength-reduce -fpcc-struct-return -o showrgb showrgb.o -g -ldbm rm -f rgb.pag rgb.dir ./rgb rgb < rgb.txt sh: 5904 Memory fault - core dumped *** Error code 139 make: Fatal error: Command failed for target `rgb.dir' genmri# It seems to be dying in dbm_nextkey (in dbm_store): genmri# dbx rgb Reading symbolic information... Read 341 symbols (dbx) where dbm_nextkey() at 0x3e6c dbm_store() at 0x34fc main(argc = 2, argv = 0xf7fffb9c), line 124 in "rgb.c" (dbx) Recompiling with cc works fine. I made pains to ensure that the gcc binaries installed were those compiled by gcc (the stage3 binaries, actually), per the gcc documentation. Also, it appears that just modifying the default sun.cf to define HasGcc to YES causes numerous error messages to be generated during the build. It seems that the preprocessor is complaining that alloca is redefined, and in server/include/os.h, alloca looks to be defined twice: once for the default -DINCLUDE_ALLOCA_H present in sun.cf, and again because __GNUC__ is defined. I manually deleted -DINCLUDE_ALLOCA_H from server/Makefile (and I assume I could do the same in sun.cf), although I'm beginning to wonder if that was the right thing to do... (I haven't got the gcc-compiled server working yet -- it dies after two or three events are processed). Any ideas? -- Douglas H. Becker doug@nmri.GE.COM {somewhere}!crdgw1.GE.COM!sane!doug