LinuxQuestions.org
Visit Jeremy's Blog.
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, 06:36 PM   #1
binarybob0001
Member
 
Registered: Dec 2004
Distribution: Debian Wheezy
Posts: 441

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, 06:45 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
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, 06:53 PM   #3
binarybob0001
Member
 
Registered: Dec 2004
Distribution: Debian Wheezy
Posts: 441

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, 07:05 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
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, 07:33 PM   #5
binarybob0001
Member
 
Registered: Dec 2004
Distribution: Debian Wheezy
Posts: 441

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


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


All times are GMT -5. The time now is 12: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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration