Click to See Complete Forum and Search --> : Compiling wine


nouse66
10-05-2002, 05:27 PM
I'd like to compile wine with athlon or at least i686 optimizations. I'm using gcc 2.96 on redhat 7.3 with an AMD Duron 700. I'd like to get some more speed out of wine so games will run better.

i tried:

export CFLAGS="-O3 -march=i686"
export CXXFLAGS="-O3 -march=i686"

and then rpm --rebuild wine-src.rpm

and it doesnt seem to be using my CFLAGS
i see this in my xterm:
gcc -c -I. -I. -I../../include -I../../include -g -O2 -Wall -mpreferred-stack-boundary=2...

Anyone know what I'm doing wrong?

Also I've seen other more complicated optimizations like this:

export CFLAGS="-s -O3 -fomit-frame-pointer -Wall -march=athlon -malign-functions=4 -funroll-loops -fexpensive-optimizations -malign-double -fschedule-insns2 -mwide-multiply"
CXXFLAGS=$CFLAGS

I don't really know what these things do so I'm hesitant to try it. Would this help or break things?

bwkaz
10-05-2002, 06:43 PM
Well it was the case a while ago that using -O3 with Wine (... mmm, maybe not, maybe that's TransGaming's WineX CVS only, not sure on that one) causes it to not be able to actually load anything (program- or .dll-wise) into memory. -march=athlon-xp, -march=i686, -O2, etc. all work fine. And -O3 might work fine now as well, but I don't know. Don't use -march=athlon unless you have an Athlon. I'm not sure that Intel systems can use the resulting binary. The other stuff in the "more optimizations" CFLAGS looks OK to me at least (some of it I think is the default anyway, but I'm not sure, so try it anyway).

Are you using either a .srpm or a .src.rpm to do the rpmbuild --rebuild? If not, it won't work anyway -- you can't just rebuild a binary RPM. If you are, then keep going, to:

Try the .tar.gz version instead. I don't know if rpmbuild --rebuild reruns the configure script or not, but your shell's CFLAGS variable only gets used in the build process if it was set when the configure script was run. If you use the .tar.gz version, you can unpack it, set CFLAGS (CXXFLAGS isn't used for Wine, that I've ever seen) to whatever you want, and then do a ./configure with appropriate options (check the output of ./configure --help to see the options available), a make depend && make, and a make install. Keep the tree around (you can make clean on it if you need to save space or whatever) so you can uninstall it later -- that's a simple make uninstall, if you have the tree still.

nouse66
10-05-2002, 07:27 PM
yeah, it was a source rpm file but it gave me an error during compilation so i'll give up on that. i just thought it might be better because i'm using version 20020904 from source and the rpm was 20020904-7.

so i recompiled the tar.gz source like this:

ran the export commands to the CFLAGS...
./configure
make depend && make

and i'm still seeing the same type of output from gcc...

gcc -c -I. -I. -I../../include -I../../include -g -O2 -Wall -mpreferred-stack-boundary=2 -fPIC -D__WINE__ -D_NTSYSTEM_ -DBINDIR="\"/usr/local/bin\"" -DETCDIR="\"/usr/local/etc\"" -D_REENTRANT -I/usr/X11R6/include -o ../../loader/resource.o ../../loader/resource.c

am i correct in my assumption that there should be a -march=i686 showing up with every gcc command?
i dont know any other way of checking but it doesnt seem to be using my CFLAGS

bwkaz
10-05-2002, 09:25 PM
Yes, there should be...

What did you set CFLAGS to?

Also, try a make distclean to remove the old Makefiles that still have your old CFLAGS value in them, if you changed it since you've run ./configure. Actually, try that anyway...

nouse66
10-06-2002, 03:09 AM
ok, i tried doing a make distclean, make clean and then started over but that didnt change anything.

i've been running a shell script that contains the following:

export CFLAGS="-O3 -march=i686"
export CXXFLAGS="-O3 -march=i686"


i that thats what other people had posted as their method when i search the forum but something's obviously wrong.....

bwkaz
10-06-2002, 01:42 PM
Yep, that's (probably) the problem. When you start up a shell script, usually, it starts its own shell. Then, when it's done, that shell goes away, and with it go your variables.

To see if this is actually the problem, run that script, and then do an echo $CFLAGS to see if they got set in your current shell. Most likely, you'll see a blank line, meaning they didn't.

Either set them in your current shell, manually, or set them in your ~/.bashrc or ~/.bash_profile or ~/.profile and re-login. But check before you run the configure script, using the echo $CFLAGS command again.

nouse66
10-06-2002, 05:07 PM
thanks, that worked. now i just have to fine tune the optimizations so wine wont seg fault :(

nouse66
10-07-2002, 07:31 PM
you were right about that -O3 problem. ichanged it to -O2 and everything works great. thanks again!