# cflags for amd athlon 64 x2 4200???

## snakeo2

I will be replacing my current cpu with a x2 4200 and wanted to know what cflags i need in order to take full advantage of my new cpu? Also, any other things that I should be aware prior to making the switch..?? Thanks in advance.

----------

## rndusr

I would probably use 

```
CFLAGS="-march=athlon64 -O2 -pipe"

MAKEOPTS="-j2"
```

I noticed that the system is far more responsive when emerging, if I use a lower MAKEOPTS setting. Maybe you think these flags are too conservative, but that of course depends on what you mean by 'full advantage'. The best advantage is in my opinion to have a stable (=tried&true) system, so I mostly follow the dev's recommendations.

To be able to come with relevant tips, I must know what you're switching from  :Smile: 

----------

## Solak

CHOST="i686-pc-linux-gnu"

CFLAGS="-march=k8 -O2 -pipe -fomit-frame-pointer"

CXXFLAGS="${CFLAGS}"

makeopts = '-j3' 

That's when you building 32bit system.

I've build my gentoo with those flags and it runs great.

Also remember about all sse,sse2,sse3 goodness, when you'll be choosing USE flags :)

----------

## Seek

CFLAGS="-march=athlon64 -msse3 -O2 -pipe -fno-ident"

CXXFLAGS="${CFLAGS}"

LDFLAGS="-Wl,-O1 -Wl,--as-needed"

CHOST="x86_64-pc-linux-gnu"

MAKEOPTS="-j3"

#just a few   :Smile: 

USE="glibc-omitfp ssse3 smp 3dnowext mmxext"

here on my 'AMD Athlon(tm) 64 X2 Dual Core Processor 4800+', completely stable!

Don't worry about the LDFLAGS, they are supported by Gentoo. Means if they don't work you can report a bug!

Whole Ubuntu uses them too...

----------

## snakeo2

thanks for the advise. I will do some cleaning, add a zalman cpu cooler 7000B to cool the x2 and also a more ram which should bring me close to 2gb. I will report back to follow up.

----------

## snakeo2

Happy to report that upgrade went without any problems so far. Added the zalman 7000, the AMD Athlon 64 X2 4200 and both XP and Gentoo were able to boot without any issues. Here is my /make.conf

Do I now need to run " emerge world " to be rebuild my entire system ???

 These settings were set by the catalyst build script that automatically built$

# Please consult /etc/make.conf.example for a more detailed example

CFLAGS="-march=athlon64 -msse3 -O2 -pipe"

CHOST="x86_64-pc-linux-gnu"

CXXFLAGS="${CFLAGS}"

MAKEOPTS="-j2"

USE="gtk gnome a52 mad alsa oss avi live matroska mpeg ogg vorbis real theora x$

GENTOO_MIRRORS="ftp://ftp.gtlib.gatech.edu/pub/gentoo http://www.gtlib.gatech.e$

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

INPUT_DEVICES="keyboard mouse evdev"

VIDEO_CARDS="nvidia"

thanks...

----------

## energyman76b

CFLAGS="-march=k8 -O2 -msse3 -pipe"

everything above that is stupid. Everything below that too.

LDFLAGS are the peak of stupidity. Don't touch them. Best case nothing happens. Usual case something breaks badly. Worst case everything breaks horribly.

If you are concerned of startup times, use prelink. It does not break stuff. It works. It is easily undone.

----------

## Seek

 *energyman76b wrote:*   

> CFLAGS="-march=k8 -O2 -msse3 -pipe"
> 
> everything above that is stupid. Everything below that too.
> 
> LDFLAGS are the peak of stupidity. Don't touch them. Best case nothing happens. Usual case something breaks badly. Worst case everything breaks horribly.
> ...

 

Ok then, why should I even bother using Gentoo if even Ubuntu optimize their binary packages better (yes, they use LDFLAGS).

LDFLAGS will break you system, that was true, maybe a few years ago. Time (and binutils) have changed today...

@energyman76b: Did you ever read something about LDFLAGS, like these articles.

There are too many to count them today, because they started becoming stable more than 3 years ago.

http://gentoo-wiki.com/TIP_Safe_LDFLAGS (2 years old)

https://forums.gentoo.org/viewtopic-t-226909.html (3 years old)

If you don't like them, don't use them. I only hate it when people say some thing like this:

"You have to/should use this flags, everything except that is stupid."

Why are you using Gentoo then? Isn't to because you want a costumisable system, isn't it CHOICE?

I'm running 3 production servers with gentoo and use LDFLAGS since about 7-8 months now, and I never experienced any problem, never.

In addition to that I have 2 gentoo desktop-systems at home and there was never a problem too.

@snakeo2: I'm sorry if I ever sounded like you SHOULD use this or that flags.

You can do whatever you want, I think that people who are asking become accurate (and up-to-date) information.

Now, to anser your question: You don't have to rebuild your whole system.

A 'emerge -uND world' would be nice, but its not nessesary to rebuild to whole system like 'emerge -e world'.

You have to do it of course, if your flags changed alot AND you want to take full advantage of them.

Only one last suggestion. I would add 'vesa' to your VIDEO_CARDS, if you are going to rebuild you system, it won't hurt.

Just because to have an alternative - nvidia-drivers don't like everybody. ;D

Good luck with your system!

[EDIT] Oh, yes! You can even use crazy flags like LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=both" together with prelink. Tested this last week, completely stable ^^;

----------

## energyman76b

 *Seek wrote:*   

>  *energyman76b wrote:*   CFLAGS="-march=k8 -O2 -msse3 -pipe"
> 
> everything above that is stupid. Everything below that too.
> 
> LDFLAGS are the peak of stupidity. Don't touch them. Best case nothing happens. Usual case something breaks badly. Worst case everything breaks horribly.
> ...

 

oh. for you it is all about ricing? I am using gentoo because I don't need to install crap I never need because of some stupid dependencies (like gnome crap).

 *Seek wrote:*   

> 
> 
> LDFLAGS will break you system, that was true, maybe a few years ago. Time (and binutils) have changed today...
> 
> 

 

no, it is still true today. Just go to b.g.o and look at the INVALID bug reports. Lots and lots of stupid LDFLAGS causing all types of breakage.

 *Seek wrote:*   

> 
> 
> @energyman76b: Did you ever read something about LDFLAGS, like these articles.
> 
> There are too many to count them today, because they started becoming stable more than 3 years ago.
> ...

 

every idiot can write into a wiki and every idiot can post his superdupersuccess story in this forum. That does not change the fact that most LDFLAGS will byte you in your ass. There are enough idiots in this forum using -ffast-math - that should tell you everything about the users.

 *Seek wrote:*   

> 
> 
> If you don't like them, don't use them. I only hate it when people say some thing like this:
> 
> "You have to/should use this flags, everything except that is stupid."
> ...

 

a) I have been there done that. I have tried a lots of different flags - I even tried different LDFLAGS.

The result: hidden breakage, slowness - and if you report a bug, even if it is a real bug, your reports are closes as INVALID. Fact, the most basic flags are the best. Ok, maybe some apps are really faster with special flags - but look at the gcc output! They already set them!

 *Seek wrote:*   

> 
> 
> Why are you using Gentoo then? Isn't to because you want a costumisable system, isn't it CHOICE?
> 
> 

 

because I want a system without crap, with only the stuff installed I want. Yes, it is about choice, but when somebody asks, you should help that person with sane settings and not with crap!

 *Seek wrote:*   

> 
> 
> I'm running 3 production servers with gentoo and use LDFLAGS since about 7-8 months now, and I never experienced any problem, never.
> 
> 

 

I pity your boss.

 *Seek wrote:*   

> 
> 
> In addition to that I have 2 gentoo desktop-systems at home and there was never a problem too.
> 
> 

 

there are always some very special persons who say that they have had no problems ever. Yeah, but one look into b.g.o will show you that a lot of people does have problems.

 *Seek wrote:*   

> 
> 
> @snakeo2: I'm sorry if I ever sounded like you SHOULD use this or that flags.
> 
> You can do whatever you want, I think that people who are asking become accurate (and up-to-date) information.
> ...

 

yes, you can use them with prelink. But if you use prelink there is even less reason to use any fancy idiotic LDFLAGS.

----------

## Seek

I really agree with most things you said. 

Well, sorry for my comparison with Ubuntu, this was really crap - don't mind plz.   :Embarassed: 

I only wanted to point out that there had been a lot of develeloptment and a lot of changes in the last years.

Because of this gentoo is ready for some LDFLAGS today, I think. But maybe I only think so because my system never broke because of them, maybe it would if I started using them earlier. Plz trust me, when I say that I never had problems with them. The last thing I want to do is harming other people with my suggestions...

I'm surprised to hear that they don't care about LDFLAG related bugs in b.g.o. Well, thats all a question about how far you push it. People using -ffast-math are another topic... (Maybe we should let them write their own C or C++ programs and let them compile it with their own c-flags   :Twisted Evil:  would be nice to see how far they get... )

Personally I really like to try things out. You don't need to worry about my boss, my servers are not that huge, and I'm kind of my own boss.

I had LDFLAGS="-Wl,-O1" on a lot of systems, and I will continue suggesting them in the future, since they are harmless nowadays.

I'll think about it again after my first crash.   :Wink: 

The last thing for me to do, is to make clear that I'm NOT counting to the ffast-math-people out there.

You are completely right, every idiot can post shit in our forums/wiki, but there is a lot of space between really-5yearsuptime-stable and total overkill, you know. ^^

My flags and settings are tested for stability and speed, and I like them. 

Once I hat a ubuntu-time, but everybody needs to start somehow. Now, I know why I love using gentoo.

Maybe you'll try them out sometimes in the future, maybe not, your choice.

After all, it is kinda a minor decision.

----------

## energyman76b

 *Seek wrote:*   

> 
> 
> I'm surprised to hear that they don't care about LDFLAG related bugs in b.g.o. 
> 
> 

 

you wouldn't be surprised if you have seen all the breakage caused by fancy flags. At some point the devs have to make a cut. And the cut is: if you use fancy [C/LD]FLAGS you are on your own.

 *Seek wrote:*   

> 
> 
> Personally I really like to try things out. You don't need to worry about my boss, my servers are not that huge, and I'm kind of my own boss.
> 
> I had LDFLAGS="-Wl,-O1" on a lot of systems, and I will continue suggesting them in the future, since they are harmless nowadays.
> ...

 

well, yes, these are safe ones - but as-needed for example has caused a lot of grief in the past. And as I said, if you use prelink startup time isn't a problem anymore. So there is no real reason to worry about them.

 *Seek wrote:*   

> 
> 
> My flags and settings are tested for stability and speed, and I like them. 
> 
> Once I hat a ubuntu-time, but everybody needs to start somehow. Now, I know why I love using gentoo.
> ...

 

I liked my 'old' flags too... fweb, tracer and a lot of other cool stuff. I rebuilt my whole system with standard flags because I hit a bug and the devs said 'no help until sane flags' - and look at this, it is even faster! And konqueror stopped with it 1crash/day, it is 1crash/week now. Wow! 

he problem was still there - but now it is Sun's problem  :Wink: .

If somebody asks for flags, give him the safe ones. The ones where he get help. If he wants to try fancy ones.. well it is his choice but don't support him..

I am sorry that I got carried away and angry. That was not ok. Excuse me, please.

----------

## Seek

 *energyman76b wrote:*   

> If somebody asks for flags, give him the safe ones. The ones where he get help. If he wants to try fancy ones.. well it is his choice but don't support him..

 

Thank you for your advice, I'll take it to heart in the future. Now, after our little discussion I'm able to understand that my advises should be more 'stable'. I just imagined how it would be as a gentoo newbie with a completely broken system and nobody cares about you.. really unlovely.

 *energyman76b wrote:*   

> I am sorry that I got carried away and angry. That was not ok. Excuse me, please.

 

I would like to ask for your pardon too, please. It's just so easy to get completely 'occupied' and even angry discussing such topics. Weird..

Anyway thank you for talking, it was still fun!

@snakeo2: I hope you will keep a happy gentoo-user. Now you should know enough to decide how crazy your flags will be.  :Wink: 

----------

