LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-08-2003, 09:38 AM   #1
hadding
Member
 
Registered: Oct 2003
Distribution: Redhat 9
Posts: 40

Rep: Reputation: 15
Question 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
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 11-08-2003, 11:52 PM   #2
hadding
Member
 
Registered: Oct 2003
Distribution: Redhat 9
Posts: 40

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

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.

[RANT]

P.S.

God I'm starting to LOVE vim !!!

Last edited by hadding; 11-09-2003 at 02:27 AM.
 
Old 11-09-2003, 02:08 PM   #3
jinksys
Member
 
Registered: Aug 2003
Location: 63123
Distribution: OpenSuSE/Ubuntu
Posts: 419

Rep: Reputation: 35
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.
 
Old 02-14-2016, 11:30 AM   #4
jazman334
LQ Newbie
 
Registered: May 2015
Posts: 4

Rep: Reputation: Disabled
Talking 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.
 
Old 02-14-2016, 02:47 PM   #5
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,852
Blog Entries: 1

Rep: Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868
There is -mtune=native for the lazy.
 
Old 02-15-2016, 02:02 AM   #6
jinksys
Member
 
Registered: Aug 2003
Location: 63123
Distribution: OpenSuSE/Ubuntu
Posts: 419

Rep: Reputation: 35
Quote:
Originally Posted by jazman334 View Post
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?
 
4 members found this post helpful.
Old 02-15-2016, 04:00 PM   #7
Ramurd
Member
 
Registered: Mar 2009
Location: Rotterdam, the Netherlands
Distribution: Slackwarelinux
Posts: 703

Rep: Reputation: 111Reputation: 111
Quote:
Originally Posted by jinksys View Post
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!?!?
 
  


Reply


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
how to do architecture specific compiles? irfanhab Linux - Software 1 03-26-2005 07:40 AM
force apps in specific virtual desktops gollum26 Linux - Software 2 01-02-2005 07:17 PM
force apt to install specific version cheech66 Linux - Newbie 5 05-29-2004 11:04 AM
Screen goes blank after installing redhat 8,have g-force display , athlon m/c lino Linux - Newbie 4 12-01-2003 09:06 PM
intel architecture dnlds work for athlon? mkuoppala Linux - Newbie 1 08-31-2003 03:10 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:07 AM.

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