From: UnixOS2 Archive To: "UnixOS2 Archive" Date: Thu, 26 Sep 2002 04:37:14 EST-10EDT,10,-1,0,7200,3,-1,0,7200,3600 Subject: [UnixOS2_Archive] No. 329 ************************************************** Wednesday 25 September 2002 Number 329 ************************************************** Subjects for today 1 Re: gcc 3.0.3: compiler / linker crash : Pete Milne **= Email 1 ==========================** Date: Thu, 26 Sep 2002 11:41:11 +0100 From: Pete Milne Subject: Re: gcc 3.0.3: compiler / linker crash Thomas, your problem seems very similar to the crashes I'm getting with gcc 2.95 - ld inexplicably fails to resolve references or crashes with a segmentation fault. Conventional wisdom is that access violations within gcc indicate either a dodgy hard disk or simply a lack of disk space. Free space on the drive in my case is currently about 40-50 Mb, which may look quite a bit, but is small enough for the swapfile to overflow when running programs like Netscrape or StarOffice. Could your problem be of this sort? Pete Thomas Hoffmann wrote: > The "weak*" programs from emx's test directory are possibly of some > interest to the gcc 3.03 porters: I got gcc / ld crashes which should > not happen even with defective code, this is the story: > > Makefile: > ========= > gcc -g -Wall -c weak1.c > gcc -g -Wall -c weak2.s > gcc -g -Wall -o weak01.exe weak1.o weak2.o > gcc -g -Wall -o weak02.exe weak2.o weak1.o > gcc -g -Wall -c weak3.c > gcc -g -Wall -o weak11.exe weak1.o weak2.o weak3.o > gcc -g -Wall -o weak12.exe weak1.o weak3.o weak2.o > gcc -g -Wall -o weak13.exe weak2.o weak1.o weak3.o > gcc -g -Wall -o weak14.exe weak2.o weak3.o weak1.o > gcc -g -Wall -o weak15.exe weak3.o weak1.o weak2.o > gcc -g -Wall -o weak16.exe weak3.o weak2.o weak1.o > weak01 weak > weak02 weak > weak11 strong > weak12 strong > weak13 strong > weak14 strong > weak15 strong > weak16 strong > > Sources: > ======== > > weak1.c: > /* weak1.c (emx+gcc) */ > > #include > #include > > extern const char *weak (void); > > int main (int argc, char *argv[]) > { > const char *t; > > if (argc != 2) > { > puts ("Incorrect command line"); > return 1; > } > > t = weak (); > puts (t); > return strcmp (t, argv[1]) != 0 ? 1 : 0; > } > > weak2.s: > / weak2.s (emx+gcc) > > .weak _strong > .text > .global _weak > _weak: leal _strong, %eax > testl %eax, %eax > jnz _strong > lea L1, %eax > ret > L1: .ascii "weak" > .byte 0 > > weak3.c: > /* weak3.c (emx+gcc) */ > > const char *strong (void) > { > return "strong"; > } > > Results: > ======== > > gcc -g -Wall -c weak1.c > gcc -g -Wall -c weak2.s > gcc -g -Wall -o weak01.exe weak1.o weak2.o > weak2.o: Undefined symbol _strong referenced from text segment > weak2.o: Undefined symbol _strong referenced from text segment > make.exe: *** [weak01.exe] Fehler 1 > gcc -g -Wall -o weak02.exe weak2.o weak1.o > weak2.o: Undefined symbol _strong referenced from text segment > weak2.o: Undefined symbol _strong referenced from text segment > make.exe: *** [weak02.exe] Fehler 1 > gcc -g -Wall -c weak3.c > gcc -g -Wall -o weak11.exe weak1.o weak2.o weak3.o > gcc -g -Wall -o weak12.exe weak1.o weak3.o weak2.o > > Process terminated by SIGSEGV > gcc: Internal error: Segmentation fault (program ld) > Please submit a full bug report. > See for instructions. > make.exe: *** [weak12.exe] Fehler 1 > gcc -g -Wall -o weak13.exe weak2.o weak1.o weak3.o > gcc -g -Wall -o weak14.exe weak2.o weak3.o weak1.o > gcc -g -Wall -o weak15.exe weak3.o weak1.o weak2.o > > Process terminated by SIGSEGV > gcc: Internal error: Segmentation fault (program ld) > Please submit a full bug report. > See for instructions. > make.exe: *** [weak15.exe] Fehler 1 > gcc -g -Wall -o weak16.exe weak3.o weak2.o weak1.o > > Process terminated by SIGSEGV > gcc: Internal error: Segmentation fault (program ld) > Please submit a full bug report. > See for instructions. > make.exe: *** [weak16.exe] Fehler 1 > > -- > Thomas Hoffmann Telephone: > 49-351-4598831 > thoffman at zappa.sax.de Dresden, > Germany > > ..sig under construction ...