LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Trouble compiling gcc and glibc with piledriver cpu optimization (march=bdver2) (http://www.linuxquestions.org/questions/slackware-14/trouble-compiling-gcc-and-glibc-with-piledriver-cpu-optimization-march%3Dbdver2-4175444876/)

Holering 01-09-2013 05:48 PM

Trouble compiling gcc and glibc with piledriver cpu optimization (march=bdver2)
 
Having problems compiling Glibc and GCC on Slackware64 14.0.

Been trying to build gcc and glibc packages from source using slackbuilds and sources from slackware64 14.0 sources dvd. GCC and glibc seem to not handle march=bdver2. Tried march=amdfam10 march=native march=barcelona, safe cflags suggestions from the Gentoo wiki, and other combinations to no avail.

Would like to know specifically what's causing gcc and glibc compile to fail. Compiling is fine with default "-O2 -pipe -fPIC" in their SlackBuilds. Is it not possible to use optimal flags with GCC and Glibc?

EDIT:
Ok I just found something that doesn't make sense:

When I do# gcc -c -Q -march=bdver2 --help=target | grep sse

I get#

-mno-sse4 [enabled]
-msse [disabled]
-msse2 [disabled]
-msse2avx [disabled]
-msse3 [disabled]
-msse4 [disabled]
-msse4.1 [disabled]
-msse4.2 [disabled]
-msse4a [disabled]
-msse5
-msseregparm [disabled]
-mssse3 [disabled]
Known assembler dialects (for use with the -masm-dialect= option):
387 387+sse 387,sse both sse sse+387 sse,387

But if I do# gcc -c -Q -march=native --help=target | grep sse

I get#

-mno-sse4 [disabled]
-msse [enabled]
-msse2 [enabled]
-msse2avx [disabled]
-msse3 [enabled]
-msse4 [enabled]
-msse4.1 [enabled]
-msse4.2 [enabled]
-msse4a [enabled]
-msse5
-msseregparm [disabled]
-mssse3 [enabled]
Known assembler dialects (for use with the -masm-dialect= option):
387 387+sse 387,sse both sse sse+387 sse,387

Piledriver clearly supports sse instructions according to reviews and articles. Don't know what's causing this; perhaps because I installed a glibc package using "-O3 -fPIC -msse -msse2 -msse3 -msse4a -mfpmath=sse -msseregparm"?

EDIT:

Made some progress. Gcc compiles with march=nocona. To be more precise I compiled GCC successfully with "-O2 -pipe -march=nocona -msseregparm -mfpmath=sse -mtune=bdver2". Still want to know what's the problem with march=bdver2.

EDIT:

Ok nevermind I'm still having problems.

heinblöd 01-10-2013 03:10 AM

I'm really not an expert for gcc, but actually in the Gentoo Wiki they also state that -march=native should detect the best optimisation by itself.
A second point is maybe the gcc version , do you know this article ?:
http://www.phoronix.com/scan.php?pag...50_gcc48&num=1

TommyC7 01-10-2013 03:53 AM

Perhaps you should try the settings gcc believes to be optimal for your CPU based on the output of:
Code:

gcc -march=native -v -E - 2>&1 <<<'' | grep "cc1" | egrep -o -e $'-m(arch|tune)=[^ "\']+'
alongside "-O2".

Holering 01-25-2013 10:25 AM

Sorry to bring this old thread back up (well it's not that old). I ended up converting Slackware64 14.0 to multilib as per Alien Bob's multilib guide. While everything seems to work better I'm hitting a nudge with glibc multilib.

glibc-multilib.SlackBuild seems to finish fine (builds all glibc packages) but the resulting packages break my system; have to re-install original glibc-multilib packages from Alien Bob. Not sure what's causing this. Used original CFLAGS in the slackbuild, and mine, but it won't behave. Tried to only upgrade glibc-multilib-2.15 package with mine which seemed ok but glibc can't re-compile itself. Don't know what I'm doing wrong...


All times are GMT -5. The time now is 02:03 AM.