Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!hp4nl!fwi.uva.nl!adam!casper From: casper@fwi.uva.nl (Casper H.S. Dik) Newsgroups: comp.windows.x Subject: Re: Troubles with gcc 1.37.1 and mit/rgb Message-ID: <1141@carol.fwi.uva.nl> Date: 14 Jul 90 22:55:30 GMT References: <9007131856.AA06628@genmri.sane.COM> Sender: news@fwi.uva.nl Reply-To: casper@fwi.uva.nl (Casper H.S. Dik) Organization: Faculteit Wiskunde & Informatica, Universiteit van Amsterdam Lines: 37 In article <9007131856.AA06628@genmri.sane.COM> doug@genmri.UUCP (Doug Becker) writes: |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 |gcc -DNOSTDHDRS -fstrength-reduce -fpcc-struct-return -o showrgb showrgb.o -g | -ldbm ^^^^^ This is the tell tale sign. |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' There is a known incompatibility in the way functions returning structures are handled between native gcc, pcc (gcc -fpcc-struct-return) and Sun SPARC compilers. You try to combine CC compiled functions returning structures (dbm*) with gcc compiled invocations. This doesn't work. Use CC instead. In my experience, code generated by cc -O4 outperforms gcc by sometimes as much as 25% on the SPARC. -- Casper H.S. Dik VCP/HIP: +31205922022 University of Amsterdam | casper@fwi.uva.nl The Netherlands | casper%fwi.uva.nl@hp4nl.nluug.nl