Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

CFLAGS Central (Part 2)

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
408 posts
  • Page 15 of 17
    • Jump to page:
  • Previous
  • 1
  • …
  • 13
  • 14
  • 15
  • 16
  • 17
  • Next
Author
Message
kernelOfTruth
Watchman
Watchman
User avatar
Posts: 6111
Joined: Tue Dec 20, 2005 10:34 pm
Location: Vienna, Austria; Germany; hello world :)
Contact:
Contact kernelOfTruth
Website

  • Quote

Post by kernelOfTruth » Thu Jan 03, 2008 4:12 pm

Master Shake wrote:Alright has anyone tested out march=naitve besides me? I've been running my system through hoops now to try to see if anything is broken and so far its good.
++

works fine here

use march=native only, and NOT march=native mtune=native or any other combination since that seems to do other not optimal optimizations which from time to time seems to break stuff ...

.. just my 2 Ct's
https://github.com/kernelOfTruth/ZFS-fo ... scCD-4.9.0
https://github.com/kernelOfTruth/pulsea ... zer-ladspa

Hardcore Gentoo Linux user since 2004 :D
Top
Master Shake
l33t
l33t
User avatar
Posts: 755
Joined: Sun Apr 10, 2005 9:19 pm
Location: Wilmington, Delaware

  • Quote

Post by Master Shake » Thu Jan 03, 2008 4:23 pm

I am not currently on my linux box as I'm at work, but my cflags are something to the effect of -march=native -pipe -O2.

Works great. Actually noticed some improvements in World of Warcraft in wine. My old march was nocana.
System Specs:
64-bit gentoo linux
Q6600 @ 3.2Ghz
P35 Chipset
4 Gigs 800mhz 4-4-4-12
Nvidia GeForce 8800 GTX @ 630mhz
Top
Veldrin
Veteran
Veteran
User avatar
Posts: 1945
Joined: Tue Jul 27, 2004 5:47 pm
Location: Zurich, Switzerland

  • Quote

Post by Veldrin » Thu Jan 03, 2008 4:24 pm

++

I changed my CFLAGS to -march=native a month ago, when I switched to gcc-4.2.2. So far I have not encountered any problems.

Tough you have to be careful if you are cross-compiling... as native gets selected for the compiling processor.

just my $.02
Top
Master Shake
l33t
l33t
User avatar
Posts: 755
Joined: Sun Apr 10, 2005 9:19 pm
Location: Wilmington, Delaware

  • Quote

Post by Master Shake » Thu Jan 03, 2008 4:31 pm

That is a good point! Since I don't cross compile I don't need to worry about this, however does distcc take the cflags from the host machine?
System Specs:
64-bit gentoo linux
Q6600 @ 3.2Ghz
P35 Chipset
4 Gigs 800mhz 4-4-4-12
Nvidia GeForce 8800 GTX @ 630mhz
Top
haarp
Guru
Guru
Posts: 535
Joined: Wed Oct 31, 2007 12:44 pm

  • Quote

Post by haarp » Thu Jan 03, 2008 9:08 pm

Next question:
I have reasons to believe that if i compile wxGTK-2.8 with -fvisibility-inlines-hidden in my CXXFLAGS,
it breaks compilation of an app that depends on wxGTK. Is this possible? Up to now, I always assumed this flag was safe.
Top
MrCanis
n00b
n00b
User avatar
Posts: 61
Joined: Sun Dec 02, 2007 8:47 pm

Pentium dual core T2130 -> -march=?

  • Quote

Post by MrCanis » Tue Jan 08, 2008 8:03 am

Hello all and happy new year :D,

I receive today or in the next days a new Laptop

Code: Select all

Inspiron 6400 N-Series Pentium Dual Core T2130 (1.86Ghz, 1MB L2 Cache, 533Mhz)
And I don't know which parameter for

Code: Select all

-march=?
, in /etc/make.conf, I should use? I mean which is the optimal parameter? In gcc 4.2.2 is the possibility to set it to native but in Gentoo we are using gcc 4.1.2 and in this version there is no native option.
The 666 is behind the detail. ;)
Top
desultory
Bodhisattva
Bodhisattva
User avatar
Posts: 9410
Joined: Fri Nov 04, 2005 6:07 pm

  • Quote

Post by desultory » Tue Jan 08, 2008 9:19 am

Merged the above post.
Top
Veldrin
Veteran
Veteran
User avatar
Posts: 1945
Joined: Tue Jul 27, 2004 5:47 pm
Location: Zurich, Switzerland

  • Quote

Post by Veldrin » Tue Jan 08, 2008 9:27 am

<cynic> if you don't know what to use, just leave it unset </cynic>

as it is yet another core cpu, use -march=prescott for 32bit, -march=nocona for 64bit

cheers
V.

for details, read here
Top
MrCanis
n00b
n00b
User avatar
Posts: 61
Joined: Sun Dec 02, 2007 8:47 pm

  • Quote

Post by MrCanis » Tue Jan 08, 2008 10:08 am

Hello Veldrin,
thanks for your answer. You hit the nail exactly on the head. :lol:
That's the info I'm looking for.
The 666 is behind the detail. ;)
Top
MrCanis
n00b
n00b
User avatar
Posts: 61
Joined: Sun Dec 02, 2007 8:47 pm

  • Quote

Post by MrCanis » Wed Feb 06, 2008 1:30 am

Hello,
I'm wondering about the difference between the two GCC - flag combinations:

A)

Code: Select all

... -march=i686
B)

Code: Select all

... -march=i686 -mtune=i686
That are the CFLAG combinations A) for PENTIUM4 and B) for CORE2 in the kernel configuration under "Processor family...". The GNU documentation says that -march implies -mtune. If so, than would in combination B) the -mtune parameter unnecessary. I don't think so but what is the difference? :roll:

I have a Pentium Dual Core T2130. Processor family 6, according to the help text in the kernel configuration, is CORE2 the correct choice. And in /etc/make.conf (according to the WIKI SafeCFLAGS)

Code: Select all

-O2 -march=prescott -pipe
or

Code: Select all

-O2 -march=prescott -mfpmath=sse
or would it be better to use the same configuration as in the kernel configuration (In my case, configuration B)) and perhaps additionally -mfpmath=sse?

The background to this question is: My system, without Gnome (2.20.3), runs fine and fast but Gnome freezes unexpectedly, regardless whether a new home directory or not and if once froze, it happened ever again. The X server hasn't any problems, the same with blackbox and Firefox, Thunderbird and Sundbird. Therefore I don't think that it has something to do with one of the Mozilla programs. I'm a little bit at a loss. :roll:

Thanks in advance.
The 666 is behind the detail. ;)
Top
Master Shake
l33t
l33t
User avatar
Posts: 755
Joined: Sun Apr 10, 2005 9:19 pm
Location: Wilmington, Delaware

  • Quote

Post by Master Shake » Wed Feb 06, 2008 2:50 am

A T2130 is a Core Duo not a Core 2 Duo. Therefore you need to keep it prescott. I would recommend using native, however prescott is the best choice.
System Specs:
64-bit gentoo linux
Q6600 @ 3.2Ghz
P35 Chipset
4 Gigs 800mhz 4-4-4-12
Nvidia GeForce 8800 GTX @ 630mhz
Top
MrCanis
n00b
n00b
User avatar
Posts: 61
Joined: Sun Dec 02, 2007 8:47 pm

  • Quote

Post by MrCanis » Wed Feb 06, 2008 7:03 am

Master Shake wrote:A T2130 is a Core Duo not a Core 2 Duo. Therefore you need to keep it prescott. I would recommend using native, however prescott is the best choice.
Hello,
thanks for your answer. I agree with you but in the kernel configuration is no prescott option. Only the two that I mentioned above ( A,B ). And again where is the difference between this both?

My GCC version is 4.1.2. How can I get 4.2.x?

Thanks in advance.
The 666 is behind the detail. ;)
Top
Veldrin
Veteran
Veteran
User avatar
Posts: 1945
Joined: Tue Jul 27, 2004 5:47 pm
Location: Zurich, Switzerland

  • Quote

Post by Veldrin » Wed Feb 06, 2008 9:05 am

My GCC version is 4.1.2. How can I get 4.2.x?
keyword; upgrade; gcc-config to select new compiler - code is below.

Code: Select all

 # echo =sys-devel/gcc-4.2* ~x86 >> /etc/portage/package.keywords
# emerge -au gcc
# gcc-config -l
# gcc-config <2>
Top
MrCanis
n00b
n00b
User avatar
Posts: 61
Joined: Sun Dec 02, 2007 8:47 pm

  • Quote

Post by MrCanis » Wed Feb 06, 2008 10:32 am

Veldrin wrote:
My GCC version is 4.1.2. How can I get 4.2.x?
keyword; upgrade; gcc-config to select new compiler - code is below.

Code: Select all

 # echo =sys-devel/gcc-4.2* ~x86 >> /etc/portage/package.keywords
# emerge -au gcc
# gcc-config -l
# gcc-config <2>
Hello,
thanks for your answer. That will simplify things, I hope. :wink:
The 666 is behind the detail. ;)
Top
MrCanis
n00b
n00b
User avatar
Posts: 61
Joined: Sun Dec 02, 2007 8:47 pm

  • Quote

Post by MrCanis » Wed Feb 06, 2008 12:56 pm

Hello,
a little typo:
Veldrin wrote:

Code: Select all

 # echo =sys-devel/gcc-4.2* ~x86 >> /etc/portage/package.keywords
Should be:

Code: Select all

 # echo =sys-devel/gcc ~x86 >> /etc/portage/package.keywords

If not, emerge says: "Invalid atom..."
The 666 is behind the detail. ;)
Top
Veldrin
Veteran
Veteran
User avatar
Posts: 1945
Joined: Tue Jul 27, 2004 5:47 pm
Location: Zurich, Switzerland

  • Quote

Post by Veldrin » Wed Feb 06, 2008 1:18 pm

hmm weird. AFAIK you can unmask a package version with wild-chars. But at least it worked.
Top
MrCanis
n00b
n00b
User avatar
Posts: 61
Joined: Sun Dec 02, 2007 8:47 pm

  • Quote

Post by MrCanis » Wed Feb 06, 2008 1:34 pm

Veldrin wrote:hmm weird. AFAIK you can unmask a package version with wild-chars. But at least it worked.
That's what I thought too, but emerge saws that different. Anyway, have I to run fix-libtool or something like that or was that only for the gcc 3.* relevant?

Now runs the build process for gcc 4.2.2. If that finished I will do a

Code: Select all

gcc-config 2 && emerge -e system && emerge -e world
with the new CFLAGS settings (-O2 -march=native -mtune=native -pipe) or have I before that something more to do?

Thanks in advance.
The 666 is behind the detail. ;)
Top
Veldrin
Veteran
Veteran
User avatar
Posts: 1945
Joined: Tue Jul 27, 2004 5:47 pm
Location: Zurich, Switzerland

  • Quote

Post by Veldrin » Wed Feb 06, 2008 1:40 pm

No, this should be alright. though there is a big discussion whether you really need to build the system twice (once in system, once in world), and the answer was pretty much no.

personally, I would rebuild the toolchain, and then the world.

Code: Select all

# emerge -1a binutils gcc-config gcc linux-headers glibc libstdc++v3 && emerge -e world
Top
MrCanis
n00b
n00b
User avatar
Posts: 61
Joined: Sun Dec 02, 2007 8:47 pm

  • Quote

Post by MrCanis » Wed Feb 06, 2008 2:03 pm

Veldrin wrote:No, this should be alright. though there is a big discussion whether you really need to build the system twice (once in system, once in world), and the answer was pretty much no.
Yes I know, but I was unsure because of the gcc-update doc. There it would suggest that I have to do it in two steps. And actually I never did this two steps, but this gcc update is the first for me.
personally, I would rebuild the toolchain, and then the world.

Code: Select all

# emerge -1a binutils gcc-config gcc linux-headers glibc libstdc++v3 && emerge -e world
Your suggestion sounds good to me. I will do so.

Thanks.
The 666 is behind the detail. ;)
Top
MrCanis
n00b
n00b
User avatar
Posts: 61
Joined: Sun Dec 02, 2007 8:47 pm

  • Quote

Post by MrCanis » Wed Feb 06, 2008 3:05 pm

Veldrin wrote:hmm weird. AFAIK you can unmask a package version with wild-chars. But at least it worked.
Hello,
it isn't weird, I did something wrong. I recreated the entry and it works. :oops:

Sometimes are the finger faster than the brain, that shouldn't but... :lol:
The 666 is behind the detail. ;)
Top
desultory
Bodhisattva
Bodhisattva
User avatar
Posts: 9410
Joined: Fri Nov 04, 2005 6:07 pm

  • Quote

Post by desultory » Thu Feb 07, 2008 12:04 am

What you are most likely want is to accept unstable versions of sys-devel/gcc in a specific slot, as opposed to matching glob pattern.

Code: Select all

sys-devel/gcc:4.2
Top
MrCanis
n00b
n00b
User avatar
Posts: 61
Joined: Sun Dec 02, 2007 8:47 pm

  • Quote

Post by MrCanis » Thu Feb 07, 2008 11:27 am

desultory wrote:What you are most likely want is to accept unstable versions of sys-devel/gcc in a specific slot, as opposed to matching glob pattern.

Code: Select all

sys-devel/gcc:4.2
Thanks for the info. For now I did it as Veldrin suggested. But my initial question isn't answered, perhaps you know the difference between the usage of "-march=i686" or "-march=i686 -mtune=i686". (Details some posts above)


Thanks in advance.
The 666 is behind the detail. ;)
Top
desultory
Bodhisattva
Bodhisattva
User avatar
Posts: 9410
Joined: Fri Nov 04, 2005 6:07 pm

  • Quote

Post by desultory » Fri Feb 08, 2008 12:13 am

Considering that since -mtune was introduced -march is supposed to imply the equivalent -mtune, so far as I know they should be equivalent.
Top
MrCanis
n00b
n00b
User avatar
Posts: 61
Joined: Sun Dec 02, 2007 8:47 pm

  • Quote

Post by MrCanis » Fri Feb 08, 2008 2:18 pm

desultory wrote:Considering that since -mtune was introduced -march is supposed to imply the equivalent -mtune, so far as I know they should be equivalent.
Hello,
thanks for your answer.

That's what I thought too, but if you have a look in the kernel configuration, you will see that both option will be used for menu entry "CORE2" and only -march for "PENTIUM4". Therefore I think there is a difference, but what? In the document (WIKI) Save CFLAGS for dual cores cites a email, which shall prove that for a dual core, prescott is the right option. This email stated that it should -march=prescott -mtune=generic but he wants look into it. (The wiki is, as I wrote this, not available) :(
That's not that important since gcc 4.2.2, because we have there the option native. But for those who do cross compiling or use distcc, it could be important and I think it is.
The 666 is behind the detail. ;)
Top
Eckos
Apprentice
Apprentice
User avatar
Posts: 197
Joined: Fri Jan 25, 2008 4:14 pm
Location: Houston, Texas, USA
Contact:
Contact Eckos
Website

  • Quote

Post by Eckos » Fri Feb 08, 2008 4:56 pm

what would be good flags for Athlon XP 2200+
Top
Post Reply

408 posts
  • Page 15 of 17
    • Jump to page:
  • Previous
  • 1
  • …
  • 13
  • 14
  • 15
  • 16
  • 17
  • Next

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic