Although procmail-3.22-r6.ebuild tries to work around the strstr() bug by adding -O2 to the end of $CFLAGS, the build still gets stuck at strstr() benchmarking with this $CFLAGS: CFLAGS="-march=athlon -O2 -mmmx -m3dnow -pipe -fomit-frame-pointer -finline-functions -funroll-loops" In the build output I do see the -O2 tacked on to the end of CFLAGS, but it doesn't work. It seems that filter-flags "-finline-functions -funroll-loops" should be added to the ebuild. After adding filter-flags to my copy of the ebuild, I was able to emerge procmail without having to edit make.conf just for that one ebuild.
The work around for -O3 optimisations is slightly more than is needed and in addition anyone specifying -finline-functions in their CFLAGS will still have the ebuild flag. I have used flag-o-matic eutils to filter out the troublesome -finline-functions flag and to replace -O3 with -O2 -frename-registers. Which is basically O3, without the -finline-functions. I have also changed the sed line to remove the previous dropdown to -O2, but left in the workaround for bypassing the lockingtest stuff. Puggy
Created attachment 15374 [details] Work around for -finline-functions bug See Comment #1 by me. Puggy
Created attachment 15376 [details] Work around for -finline-functions bug Workround for -O3 optimisations is slightly more than is needed and in addition anyone specifying -finline-functions explicitly in their CFLAGS will still have the problem. I have used flag-o-matic eutils to filter out the troublesome -finline-functions flag and to replace -O3 with -O2 -frename-registers. Which is basically O3, without the -finline-functions. I have also changed the sed line to remove the previous dropdown to -O2, but left in the workaround for bypassing the lockingtest stuff. Puggy
Please test this ebuild. :)
New ebuild works fine here,
ebuild works fine with CFLAGS="athlon-xp -O3 -pipe"
Maybe I'm reading the output wrong, but it looks like now the ebuild is taking my CFLAGS of "-march=athlon -O2 -mmmx -m3dnow -pipe -fomit-frame-pointer -finline-functions -funroll-loops" and reducing it to just "-O " So it's currently filtering a wee bit more than just -finline-functions right now. Output of ebuild in attachment 2003 [details]-08-02 12:13 EST: =================== >>> Source unpacked. patching file src/authenticate.c /bin/sh ./initmake /bin/sh "/bin/sh" "/bin/rm -f" "mv -f" "ln" \ "-lm -ldir -lx -lsocket -lnet -linet -lnsl_s -lnsl_i -lnsl -lsun -lgen -lsockdns -ldl" \ "/lib /usr/lib /usr/local/lib" \ /dev/null "make" o \ "gcc" "-O " "-s " "procmail lockfile formail mailstat" \ "procmail formail lockfile" \ "procmailrc procmailsc procmailex" "src man" \ "/usr/bin" \ "strip" [goes on to get past strstr()] ------------------- Output of procmail-3.22-r6.ebuild in portage: =================== >>> Source unpacked. patching file src/authenticate.c /bin/sh ./initmake /bin/sh "/bin/sh" "/bin/rm -f" "mv -f" "ln" \ "-lm -ldir -lx -lsocket -lnet -linet -lnsl_s -lnsl_i -lnsl -lsun -lgen -lsockdns -ldl" \ "/lib /usr/lib /usr/local/lib" \ /dev/null "make" o \ "gcc" "-march=athlon -O2 -mmmx -m3dnow -pipe -fomit-frame-pointer -finline-functions -funroll-loops -O2 " "-s " "procmail lockfile formail mailstat" \ "procmail formail lockfile" \ "procmailrc procmailsc procmailex" "src man" \ "/usr/bin" \ "strip" gcc seems to work fine, using that as the C-compiler ...scanning for 13 libraries... ...scanning for 12 libraries... ...scanning for 11 libraries... ...scanning for 10 libraries... ...scanning for 9 libraries... ...scanning for 8 libraries... ...scanning for 7 libraries... ...scanning for 6 libraries... ...scanning for 5 libraries... ...scanning for 4 libraries... Added LDFLAGS= -lm -lnsl -ldl -lc cd src; make ../autoconf.h echo Housekeeping file >config.check make[1]: Entering directory `/var/tmp/portage/procmail-3.22-r6/work/procmail-3.22/src' /bin/sh ./autoconf /bin/sh "/bin/rm -f" "mv -f" /dev/null \ "grep -F" "make" o "/tmp . " \ "/usr/bin" ../autoconf.h Using the following directories for the LOCKINGTESTs: /tmp . Initiating fcntl()/kernel-locking-support tests Proceeding with kernel-locking-support tests in the background Testing for const Testing for volatile Testing for prototypes Testing for enum Checking for POSIX and ANSI/ISO system include files Checking for network/comsat/biff support Testing for void*, size_t, off_t, pid_t, time_t, mode_t, uid_t & gid_t Checking realloc implementation Testing for WIFEXITED(), WIFSTOPPED(), WEXITSTATUS() & WSIGTERM() Testing for various struct passwd members Testing for memmove, strchr, strpbrk, strcspn, strtol, strstr, rename, setrgid, setegid, pow, opendir, mkdir, waitpid, fsync, ftruncate, strtod, strncasecmp, strerror, strlcat, memset, bzero, and _exit Determining the maximum number of 16 byte arguments execv() takes Benchmarking your system's strstr() implementation [Gets stuck here]
I'm looking into #7. Puggy
#7 is totally accurate. The new ebuild fixes that. My bad. :-D Also I've added a new ebuild for -r5 which suffers from the same problem. Puggy
Created attachment 15442 [details] Updated procmail-3.22-r6 ebuild Bug fixed in previous ebuild which was stripping all optimisations. Puggy
Created attachment 15443 [details] Updated procmail-3.22-r5 ebuild -r5 suffers from the same -finline-functions bug so uploading a fixed ebuild for that also.
For some reason, if I download the updated r6 attachment (tried with both firebird and wget), the ebuild fails with emerge complaining about needing more than 0 values to unpack. But if I add your changes manually to the ebuild in my portage tree, it works just fine (-finline-functions is removed while rest of my CFLAGS are intact).
Can anyone verify #12, I haven't been able to duplicate this problem. Puggy
gcc -march=i686 -O2 -frename-registers -pipe -ffast-math -fomit-frame-pointer _autotst.c -o _autotst cc1: Invalid option `-frename-registers' :::: very bad, gcc 2.95 doesn't know this flag
Re: comment 12 and 13, the 0 values thing: my mistake, I was being lazy and just dropping the updated ebuild into /usr/portage/net-mail/procmail instead of my portage overlay, then forgetting to make a digest from the new ebuild. So the only problem now is the gcc2.95 incompatibility with -frename-registers in comment 14.
Ok. I've got a sweet solution to #14, will upload it in a minute.
Created attachment 15541 [details] Work around for gcc < 3 for strstr bug Rather clever code added which checks all CFLAGS with gcc and strips ones it does not recognise. Hope this should be the final version or -r6 Puggy
Created attachment 15542 [details] work around for gcc < 3 for strstr bug Rather clever code added which checks all CFLAGS with gcc and strips ones it does not recognise. Hope this should be the final version of -r5 Puggy
Created attachment 15573 [details] Final -r6 with simple, non-clever code. Replaced clever code as found much easier way.
Created attachment 15574 [details] final -r5 with simpler, non-clever code Removed clever code in favour of -fno-finline-functions Puggy
Seems to work now without these ebuilds. Let me know if anyone still has a problem. Puggy