Description of problem: I am attempting the build the libnessus (one of three nessus packages) on my Opteron system. These are the 2.0.9 version of nessus. I can make the package(s) available (via ftp) if you need them. These packages build, install and run properly on i386. When I attempt to build libnessus (nessus-libraries) on x86_64, the gcc compiler hangs compiling network.c. In an attempt to narrow the problem, I ran things manually after doing rpmbuild -bp -- run ./configure and make with the same operands as in the spec file. I have narrows the problem to compiling with "-O2" -- without this, the compile is OK ... with it, the compiler hangs. If I use gcc32 to compile network.c, the compile does not hang although I get some warning messages about "cast from pointer to integer of different size" so I am not sure just how good the result is anyway ... mmm, I get the same warnings if I compile using gcc 3.3.2 but without -O2 (just no hang). Version-Release number of selected component (if applicable): Fedora Core 1 x86_64 preview gcc 3.3.2-2 How reproducible: every time NOTE: I tried to assign to 64bit_fedora but bugzilla would not accept that.
Please attach preprocessed network.i (add -save-temps option to gcc when compiling network.c) and write what exact other compiler flags you've used to make it hang.
The only parameter difference is -O2. Here are the two command line entries: with -O2: gcc -pipe -I../ -DHAVE_CONFIG_H -DNESSUS_ON_SSL -I. -I/usr/kerberos/include -DHAVE_SSL -I/usr/include/openssl -I/home/genec/devel/redhat/BUILD/nessus-libraries/include -I/home/genec/devel/redhat/BUILD/nessus-libraries/libpcap-nessus -g -O2 -save-temps -pipe -c network.c -fPIC -DPIC -o .libs/network.lo without -O2: gcc -pipe -I../ -DHAVE_CONFIG_H -DNESSUS_ON_SSL -I. -I/usr/kerberos/include -DHAVE_SSL -I/usr/include/openssl -I/home/genec/devel/redhat/BUILD/nessus-libraries/include -I/home/genec/devel/redhat/BUILD/nessus-libraries/libpcap-nessus -g -save-temps -pipe -c network.c -fPIC -DPIC -o .libs/network.lo Since the network.i output is different for the -O2 and non-O2 cases, I am attaching both.
Created attachment 96708 [details] network.i without the -O2 parameter
Created attachment 96709 [details] network.i when -O2 specified and gcc hangs
I ran some additional tests. Using the general form of "gcc -c -o xxx" and either of the attached files .. With nothing or -O1 specified, it takes about 1 second to compile. With -O2, -O3, or -Os, the compile hangs.
The compile (-O2) also works OK when these files are compiled on a dual Athlon for the network.i generated by -O2 on the Opteron x86_64 system.
Simplified to: extern int f1 (int, void *); extern int *f2 (void) __attribute__ ((__const__)); extern int f3 (int, void *); int test (int x, char *y, int z) { int b = 0; if (x < 1024) { y[0] = '\0'; do { switch (f1 (x, y + b)) { case -1: if (b == 0) return -1; else return b; default: b++; } } while (y[b - 1] != '\0' && y[b - 1] != '\n' && b < z); } else { do { switch (f3 (x, y + b)) { case -1: if ((*f2 ()) == 4) continue; if (b == 0) return -1; else return b; default: b++; } } while (y[b - 1] != '\0' && y[b - 1] != '\n' && b < z); } return b; }
http://gcc.gnu.org/PR13521
http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02314.html
1. patch works! I took the 3.3.2-5 version of src.rpm, applied the patch (after some fiddling but no real changes), rebuilt all of gcc and installed. Then I ran the rpmbuild for libnessus which had hung and it not compiles just fine. 2. I would appreciate it if this patch could be installed into a "development" version of gcc since that will make it easier to incorporate into the x86_64 version of FC1 (as an update if not in the base). Thanks Jakub! Now I need to play with the nessus rpms to get it to properly handle being on a x86_64 system (/usr/lib64, etc).
not => now
Was this patch added to the current release or testing release?
I applied the above patch to gcc-3-3-2-5 and rebuild ... it fixed the problem. This fix has been incorporated into gcc-3.3.2-6 (last seen in development). I have since rebuilt gcc-3.3.2-6 (src.rpm from development) for the x86_64 and installed it ... it also fixes the loop problem. I see that development currently has gcc-3.3.2-8 (which probably works but I have not tried it). The binaries I did are on ftp://czarc.net/pub/x86_64 ... if you need the 3.3.2-6 src.rpm, I can upload it. When I get a change, I will rebuild to gcc-3.3.2-8. BTW, you need glibc-devel for the i386(!!) to build gcc. Since that is true, it probably should be part of the distribution.