Register a domain and help support LQ
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 01-09-2013, 06:48 PM   #1
Registered: Feb 2010
Distribution: Slackware
Posts: 184

Rep: Reputation: 22
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?

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]
-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]
-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"?


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.


Ok nevermind I'm still having problems.

Last edited by Holering; 01-09-2013 at 08:48 PM. Reason: Update to strange discovery....
Old 01-10-2013, 04:10 AM   #2
Registered: May 2004
Location: France
Distribution: Slackware Gentoo
Posts: 186

Rep: Reputation: 31
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 ?:

Last edited by heinblöd; 01-10-2013 at 04:14 AM.
Old 01-10-2013, 04:53 AM   #3
Registered: Mar 2012
Distribution: Slackware, CentOS, OpenBSD, FreeBSD
Posts: 454

Rep: Reputation: Disabled
Perhaps you should try the settings gcc believes to be optimal for your CPU based on the output of:
gcc -march=native -v -E - 2>&1 <<<'' | grep "cc1" | egrep -o -e $'-m(arch|tune)=[^ "\']+'
alongside "-O2".
1 members found this post helpful.
Old 01-25-2013, 11:25 AM   #4
Registered: Feb 2010
Distribution: Slackware
Posts: 184

Original Poster
Rep: Reputation: 22
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...


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Compiling trouble with gcc when using the libtool flag kraileth Linux - Software 1 04-25-2012 10:25 PM
[SOLVED] GCC options: (-m64) vs (-march=native) vs (-march=core2) -- Which one(s) to use? GrapefruiTgirl Linux - Software 5 09-29-2009 08:53 AM
compiling cross gcc for powerpc, glibc trouble and73y Programming 14 06-05-2009 05:21 AM
Trouble Compiling a simple Hellow World on Solaris 9 with GCC 3.4.2 jitendra64 Solaris / OpenSolaris 4 10-11-2004 03:57 PM
gcc march agdepus Programming 8 05-26-2004 10:11 AM

All times are GMT -5. The time now is 09:58 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration