LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-29-2007, 05:36 PM   #1
binarybob0001
Member
 
Registered: Dec 2004
Distribution: Debian Wheezy
Posts: 444

Rep: Reputation: 30
Setting CFLAGS makes no difference


Now that I know my processor is an i686, I would like to compile all my code for that type. In /etc/profile I added the following lines to the top.
Code:
export CFLAGS="-O2 -march=pentium4"
export CXXFLAGS=$CFLAGS
I'm using the alsa-driver-1.0.15 as my test. I used the .configure scripts with this option
./configure --with-cards=emu10k1x
I already had a previous compile to compare the files to, so I grabbed snd_timer.ko from /lib/modules/2.6.23.1/kernel/sound/acore and renamed it to snd_timer.ko2. Then, I grabbed the new snd_time.ko that was made recently and put them in the same directory. I did a cmp snd_timer.ko2 snd_timer.ko and it showed no difference. Is this to be expected? What should I try next?
 
Old 10-29-2007, 05:45 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
When you do an
env|grep FLAG
from the shell where you invoke ./configure .... what do you see?

If the terminal you're working on is not an interactive login shell it
may not have inherited the values from /etc/profile



Cheers,
Tink
 
Old 10-29-2007, 05:53 PM   #3
binarybob0001
Member
 
Registered: Dec 2004
Distribution: Debian Wheezy
Posts: 444

Original Poster
Rep: Reputation: 30
I get the following from env | grep FLAG
Code:
CXXFLAGS=-O2 -march=pentium3
CFLAGS=-O2 -march=pentium3
I change the environment variable to use pentium 3 just to see if it made a difference.
 
Old 10-29-2007, 06:05 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
In that case maybe the compiler thinks that there's no call for
instructions specific to the CPU you want it to be using...

It's also possible that alsa-driver will refuse to compile
against anything other than what your current kernel is
compiled for? Would make sense to me ... is your kernel
optimised for P4 or P3?



Cheers,
Tink
 
Old 10-29-2007, 06:33 PM   #5
binarybob0001
Member
 
Registered: Dec 2004
Distribution: Debian Wheezy
Posts: 444

Original Poster
Rep: Reputation: 30
I have set the processor type and features-->Processor family to (Pentium-4/Celeron(P4-based)/Pentium-4 M/older Xeon). I think that's how you would compile for a i686 computer. Is there any way to tell if an executable has been compiled for an i686 other than trying to run it on a i586 machine?
 
  


Reply



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
Cflags bong.mau Programming 1 04-30-2007 11:08 AM
cflags exodist Linux - Software 2 01-14-2005 07:44 PM
What a difference matching Kernel Config to PC makes! fastvfr Debian 1 09-07-2004 10:44 PM
how to unset cflags? shanenin Linux - Software 4 01-25-2004 09:36 PM
Why the density makes so much difference? dj_relentless General 3 04-30-2002 02:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:41 PM.

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