LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   How to force compile for a specific architecture ie Athlon ? (https://www.linuxquestions.org/questions/programming-9/how-to-force-compile-for-a-specific-architecture-ie-athlon-113755/)

hadding 11-08-2003 09:38 AM

How to force compile for a specific architecture ie Athlon ?
 
The majority of things I compile for rh9 seem to build for i386 or more rarely i686. Is there any way I can force a build (optimizations) for athlons ?

thanks

_h

hadding 11-08-2003 11:52 PM

hmmm......

So far I've come up with manually editing Rules.mk after I do a ./configure and adding

CFLAGS = -march=athlon-xp -O3 -pipe -fomit-frame-pointer

Does anyone know of any other Athlon specific CFLAGS ?

Doing this every time I want to compile something is a pain. Anyone know how to make these CFLAGS the default when I run make ? I guess I could turn it into an environmental variable but I'd really perfer not to do it that way.


Ok seems most people don't seem to use Rules.mk so you have to edit the Makefile directly. Also, for c++ change CXXFLAGS rather than CFLAGS.

From reading the gcc man it appears to me that -fomit-frame-pointer is enabled automatically by using -O3 ( on systems where it won't break debugging). Wonder why so many people include it when setting -O3 ? (maybe it "forces" it or something)

[RANT]


Redhat is really starting to annoy me. Aside from it being one of the most scewy distro's configuration wise, they seem to be releasing their own patched versions of basic utils like gcc etc. that only work with Redhat. Really starting to remind me of a mini Microsoft in a way. ( thank god I never got Lindows !) Now no more support for RH Personal . We get kicked to Feodra. Who knows what this will mean in the end but I can't help getting the feeling of " Thanks for all your help in making us successful but we really need to focus on big corporate clients that we can overcharge for long-term support contracts so kindly piss off" Well Que sera, sera and caveat emptor for that matter :p

Now where was I...... ummm...ok.......... Got it

For Rh, at least, it seems like the only RPMS commonly available are for i386 or i686 to a lesser extent . Now who the fuck actually still uses a 386 for their desktop machine ? Wouldn't it make a bit more sense to default to i686 and let the few people with ancient hardware compile from source and optimize for their architecture ? I didn't spend all this money on a new computer to let my shiny new cpu go under utilized. Ergo my quest for the ultimate gcc optimization flags. Now I basically have to recompile my whole OS. Think I'll switch to Gentoo where you're expected to compile and optimize everything. Got that nifty emerge feature.... edit make.conf to put in your pet flags.... run........ a day later you've got an OS dialed for your system. :p

[RANT]

P.S.

God I'm starting to LOVE vim !!! :cool:

jinksys 11-09-2003 02:08 PM

When a rpm says nameofrpm.version.i386.rpm or something that, it doesnt mean it is optimized for the 386 itself. It just means it is meant to be run on a 386 class processor, aka any x86 processor, like a pentium or athlon.
Lately, distrobutions have been moving forward and naming their rpms with the i686 architechure in the name. This is because modern distros have been dropping the 386 chip because, like you said, who uses a 386 as a desktop machine anyway? True true, some people use 386s as server machines, but not as full fledged desktop machines, it would be rediculous.

ps) beware using a high optimization level. -O2 is usually sufficient when it comes to optimization, -O3 is not that much better and sometimes adds bugs, although not intentionally.

jazman334 02-14-2016 11:30 AM

showing your intelligence there!
 
It shows that youve never compiled a kernel in any ways... No, -o3 and -o4(FPC :-P) do not ADD bugs. They super hyper optimize the code, help to unroll loops, add sse extentions ...etc.

Theres a whole smattering list of what -O4 and -O3 do.If this introduces bugs, you have sloppy code to begin with.Which does not surprise me from the C that Ive seen.I have yet to see in any official documentation anywhere that -o3 and beyond BREAK code. o2 is a baseline, it doesnt do cpu or class specific tweaks.

o2 would be like athalon(amd generic)
03 would be like cpu multi-core family(cpu series)
04 would be 9590 specific for example

and omitting frame pointer, as is common in o3+ removes the stack canary and violates security hardening specs. you should RTFM sometime.That might be unwise, but its not going to otherwise break code or introduce bugs.

NevemTeve 02-14-2016 02:47 PM

There is -mtune=native for the lazy.

jinksys 02-15-2016 02:02 AM

Quote:

Originally Posted by jazman334 (Post 5500095)
It shows that youve never compiled a kernel in any ways... No, -o3 and -o4(FPC :-P) do not ADD bugs. They super hyper optimize the code, help to unroll loops, add sse extentions ...etc.

Theres a whole smattering list of what -O4 and -O3 do.If this introduces bugs, you have sloppy code to begin with.Which does not surprise me from the C that Ive seen.I have yet to see in any official documentation anywhere that -o3 and beyond BREAK code. o2 is a baseline, it doesnt do cpu or class specific tweaks.

o2 would be like athalon(amd generic)
03 would be like cpu multi-core family(cpu series)
04 would be 9590 specific for example

and omitting frame pointer, as is common in o3+ removes the stack canary and violates security hardening specs. you should RTFM sometime.That might be unwise, but its not going to otherwise break code or introduce bugs.

What's the point of replying to a thirteen year old thread just to be an asshole?

Ramurd 02-15-2016 04:00 PM

Quote:

Originally Posted by jinksys (Post 5500356)
What's the point of replying to a thirteen year old thread just to be an asshole?

... so the thread isn't even mature yet!?!?


All times are GMT -5. The time now is 03:44 PM.