From: Robert O. <ro...@be...> - 2005-08-17 14:02:29
|
Hi Jurjen, I have experienced the same problem with GCC 3.3.2 on AIX 5L 5.3, but managed to work around it by building a patched stable version of GCC 3.3.2, see below. Looking around at the internet for a solution I came across=20 http://sourceforge.net/mailarchive/forum.php?thread_id=3D2003536&forum_id= =3D 3648 that basically says that the following assumption in CPP migh be invalid on some systems. gcc-3.2.2/gcc/cppfiles.c:40 /* Use mmap if the file is big enough to be worth it (controlled by MMAP_THRESHOLD) and if we can safely count on there being at least one readable NUL byte after the end of the file's contents. This is true for all tested operating systems when the file size is not an exact multiple of the page size. */ Our solution was to patch cppfiles.c using the patch below and rebuild gcc-3.3.2 halfway (it was not possible to rebuild libstc++ due to link errors), and taking the core gcc files=20 gcc-3.3.2/objdir/gcc/cc1* and replacing the same files in=20 /opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.3.0.0/3.3.2/cc1* -------------------------------- diff -w -c=20 /localhome/robert/rpmbuild_relative/BUILD/gcc-3.3.2/gcc/cppfiles.c\~=20 /localhome/robert/rpmbuild_relative/BUILD/gcc-3.3.2/gcc/cppfiles.c *** /localhome/robert/rpmbuild_relative/BUILD/gcc-3.3.2/gcc/cppfiles.c~ Wed=20 Nov 20 20:49:53 2002 --- /localhome/robert/rpmbuild_relative/BUILD/gcc-3.3.2/gcc/cppfiles.c Thu=20 Aug 11 21:14:11 2005 *************** *** 34,39 **** --- 34,43 ---- #define VALGRIND_DISCARD(x) #endif + // R.O. patch, skip mmap() + #undef HAVE_MMAP_FILE + #undef MMAP_THRESHOLD +=20 #ifdef HAVE_MMAP_FILE # include <sys/mman.h> # ifndef MMAP_THRESHOLD ---------------------------------- Best Regards /Robert > -----Original Message----- > From: aix...@li...=20 > [mailto:aix...@li...] On=20 > Behalf Of Jurjen Oskam > Sent: Wednesday, August 17, 2005 8:50 AM > To: aix...@li... > Subject: [tbox-l] Weird GCC problem >=20 > Hi there, >=20 > I have a problem with gcc-3.3.2-5 on AIX 5.3. I'm using the AIX > 5.3 version of the package. >=20 > I'm trying to compile ucspi-tcp-0.88 (http://cr.yp.to/ucspi-tcp.html), > but there are weird errors, such as GCC complaining about an=20 > internal bug: >=20 > # make > ( cat warn-auto.sh; echo 'main=3D"$1"; shift'; echo=20 > exec "`head -1 > conf-ld`" '-o "$main" "$main".o ${1+"$@"}' ) > load > chmod 755 load > ( cat warn-auto.sh; echo exec "`head -1 conf-cc`"=20 > '-c ${1+"$@"}' > ) > compile > chmod 755 compile > cat warn-auto.sh choose.sh | sed s}HOME}"`head -1=20 > conf-home`"}g > > choose > chmod 755 choose > ./choose clr trypoll iopause.h1 iopause.h2 > iopause.h > ./choose clr tryulong64 uint64.h1 uint64.h2 > uint64.h > ./compile tcpserver.c > In file included from /usr/include/sys/param.h:43, > from tcpserver.c:2: > /usr/include/sys/machine.h:289:1: unterminated comment > /usr/include/sys/machine.h:300:1966: missing terminating ' character > In file included from /usr/include/sys/param.h:43, > from tcpserver.c:2: > /usr/include/sys/machine.h:-3103: internal compiler error:=20 > Segmentation > fault > Please submit a full bug report, > with preprocessed source if appropriate. > See <URL:http://gcc.gnu.org/bugs.html> for instructions. > make: The error code from the last command is 1. >=20 >=20 > Stop. >=20 >=20 > Were this an i386 system, I'd immediately suspect the hardware. This > happens on a p550 though, and the system doesn't log any=20 > hardware errors > and all other applications seem to work fine. Also, it happens in more > than one LPAR. But.... the symptoms are eerily similar to=20 > i386 hardware > problems: after the error above, immediately invoking make again will > compile some more of the program until it bombs out again.=20 > It's not always > an internal compiler error, but always "weird" in the sense=20 > that invoking > "make" resumes compiling as if the error didn't happen, and=20 > "weird" because > it complains about things as errors in system headers or=20 > syntax errors in > the program source which aren't there. >=20 > After typing "make" a few times, the program even compiles=20 > successfully. :-) >=20 > This behaviour also occurs with other programs, not just ucspi-tcp. >=20 > C for AIX (version 6, latest PTF) doesn't have this problem,=20 > not even on > the same machine/LPAR. The exact same program consistently=20 > compiles just fine, > in one pass, without errors.=20 >=20 > The system is at AIX 5.3 ML2, with critical fixes. Are the=20 > symptoms above > familiar to anybody here? >=20 > Thanks, > --=20 > Jurjen Oskam >=20 >=20 > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development=20 > Lifecycle Practices > Agile & Plan-Driven Development * Managing Projects & Teams *=20 > Testing & QA > Security * Process Improvement & Measurement *=20 > http://www.sqe.com/bsce5sf > _______________________________________________ > aixtoolbox-list mailing list > aix...@li... > https://lists.sourceforge.net/lists/listinfo/aixtoolbox-list >=20 |