Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 23253 - procmail stuck on strstr() benchmark with gcc-3.3
Summary: procmail stuck on strstr() benchmark with gcc-3.3
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High normal
Assignee: Douglas Russell (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-21 22:28 UTC by Sean Camanyag
Modified: 2003-10-31 15:48 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Work around for -finline-functions bug (procmail-3.22-r6.ebuild,1.87 KB, text/plain)
2003-08-02 11:50 UTC, Douglas Russell (RETIRED)
Details
Work around for -finline-functions bug (procmail-3.22-r6.ebuild,1.79 KB, text/plain)
2003-08-02 12:13 UTC, Douglas Russell (RETIRED)
Details
Updated procmail-3.22-r6 ebuild (procmail-3.22-r6.ebuild,1.86 KB, text/plain)
2003-08-03 08:22 UTC, Douglas Russell (RETIRED)
Details
Updated procmail-3.22-r5 ebuild (procmail-3.22-r5.ebuild,1.87 KB, text/plain)
2003-08-03 08:23 UTC, Douglas Russell (RETIRED)
Details
Work around for gcc < 3 for strstr bug (procmail-3.22-r6.ebuild,2.31 KB, text/plain)
2003-08-05 07:13 UTC, Douglas Russell (RETIRED)
Details
work around for gcc < 3 for strstr bug (procmail-3.22-r5.ebuild,2.37 KB, text/plain)
2003-08-05 07:14 UTC, Douglas Russell (RETIRED)
Details
Final -r6 with simple, non-clever code. (procmail-3.22-r6.ebuild,1.83 KB, text/plain)
2003-08-05 16:25 UTC, Douglas Russell (RETIRED)
Details
final -r5 with simpler, non-clever code (procmail-3.22-r5.ebuild,1.72 KB, text/plain)
2003-08-05 16:27 UTC, Douglas Russell (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sean Camanyag 2003-06-21 22:28:59 UTC
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.
Comment 1 Douglas Russell (RETIRED) gentoo-dev 2003-08-02 11:44:11 UTC
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
Comment 2 Douglas Russell (RETIRED) gentoo-dev 2003-08-02 11:50:41 UTC
Created attachment 15374 [details]
Work around for -finline-functions bug

See Comment #1 by me.

Puggy
Comment 3 Douglas Russell (RETIRED) gentoo-dev 2003-08-02 12:13:11 UTC
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
Comment 4 Lisa Seelye (RETIRED) gentoo-dev 2003-08-02 12:16:20 UTC
Please test this ebuild. :)
Comment 5 Ian Leitch (RETIRED) gentoo-dev 2003-08-02 16:45:46 UTC
New ebuild works fine here,
Comment 6 Bryan Østergaard (RETIRED) gentoo-dev 2003-08-02 16:47:19 UTC
ebuild works fine with CFLAGS="athlon-xp -O3 -pipe"
Comment 7 Sean Camanyag 2003-08-02 17:25:25 UTC
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]
Comment 8 Douglas Russell (RETIRED) gentoo-dev 2003-08-02 18:08:38 UTC
I'm looking into #7.

Puggy
Comment 9 Douglas Russell (RETIRED) gentoo-dev 2003-08-03 08:18:50 UTC
#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
Comment 10 Douglas Russell (RETIRED) gentoo-dev 2003-08-03 08:22:17 UTC
Created attachment 15442 [details]
Updated procmail-3.22-r6 ebuild

Bug fixed in previous ebuild which was stripping all optimisations.

Puggy
Comment 11 Douglas Russell (RETIRED) gentoo-dev 2003-08-03 08:23:56 UTC
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.
Comment 12 Sean Camanyag 2003-08-04 00:39:22 UTC
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).
Comment 13 Douglas Russell (RETIRED) gentoo-dev 2003-08-04 01:00:55 UTC
Can anyone verify #12, I haven't been able to duplicate this problem.

Puggy
Comment 14 Martin Holzer (RETIRED) gentoo-dev 2003-08-04 15:03:21 UTC
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
Comment 15 Sean Camanyag 2003-08-04 16:26:50 UTC
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.
Comment 16 Douglas Russell (RETIRED) gentoo-dev 2003-08-05 04:28:54 UTC
Ok. I've got a sweet solution to #14, will upload it in a minute.
Comment 17 Douglas Russell (RETIRED) gentoo-dev 2003-08-05 07:13:42 UTC
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
Comment 18 Douglas Russell (RETIRED) gentoo-dev 2003-08-05 07:14:49 UTC
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
Comment 19 Douglas Russell (RETIRED) gentoo-dev 2003-08-05 16:25:02 UTC
Created attachment 15573 [details]
Final -r6 with simple, non-clever code.

Replaced clever code as found much easier way.
Comment 20 Douglas Russell (RETIRED) gentoo-dev 2003-08-05 16:27:08 UTC
Created attachment 15574 [details]
final -r5 with simpler, non-clever code

Removed clever code in favour of -fno-finline-functions

Puggy
Comment 21 Douglas Russell (RETIRED) gentoo-dev 2003-10-31 15:48:39 UTC
Seems to work now without these ebuilds. Let me know if anyone still has
a problem.

Puggy