LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 02-13-2010, 04:26 AM   #1
kaz2100
Senior Member
 
Registered: Apr 2005
Location: Penguin land, with apple, no gates
Distribution: SlackWare > Debian testing woody(32) sarge etch lenny squeeze(+64) wheezy .. bullseye bookworm
Posts: 1,832

Rep: Reputation: 108Reputation: 108
The way to compile kernel with -mtune=native (or -march=native)


Hya,

I am looking for the way to compile kernel with -mtune=native.

For one of my Debian with atom N270, I would like to use full cpu potential.

As suggested by several other threads, (1, gentoo wiki I think (hope) it works.

So far, I have done
Code:
make menuconfig
export KCFLAGS="-O2 -mtune=native -pipe"
export KPPCFLAGS="-O2 -mtune=native -pipe"
make all
It seems good. However I am not quite sure if this really overrides processor selection in menuconfig.


Am I correct?

Any input will be appreciated.

Happy Penguins!
 
Old 02-13-2010, 08:03 AM   #2
ozanbaba
Member
 
Registered: May 2003
Location: İzmir
Distribution: Slackware64 15.0 Multilib
Posts: 778

Rep: Reputation: 135Reputation: 135
you are somehow correct,

you are just overriding the c flags for kernel (well adding additional flags to compiler is the right one. i think gcc will use already defined flags, and flags you defined sanely. it's the experience from the other places. however over optimization is not good to think to do. it tent to destabilize the program).


-O2 is pretty safe flag to use. it's the one used by default anyway. -mtune=native should be safe anyway.
 
Old 02-13-2010, 08:20 AM   #3
ozanbaba
Member
 
Registered: May 2003
Location: İzmir
Distribution: Slackware64 15.0 Multilib
Posts: 778

Rep: Reputation: 135Reputation: 135
i forgot to say that you do not hove to do export the flag variables. just use this
Code:
KCFLAGS="-O2 -mtune=native -pipe" KCPPFLAGS="-O2 -mtune=native -pipe" make all
all of them at the same line
 
Old 08-18-2011, 03:45 AM   #4
graysky1
LQ Newbie
 
Registered: Jul 2010
Posts: 4

Rep: Reputation: 1
Very interesting discussion. Shouldn't you substitute "march" for "mtune" though?

Code:
KCFLAGS="-march=native -O2 -pipe" KCPPFLAGS="-march=native -O2 -pipe" make all
Per the gcc manpage:
Quote:
march=cpu-type
Generate instructions for the machine type cpu-type. The choices for cpu-type are the same as for -mtune. Moreover, specifying -march=cpu-type implies -mtune=cpu-type.

Last edited by graysky1; 08-18-2011 at 05:00 AM.
 
  


Reply

Tags
cflags, compile, configure, flags, kernel



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
[SOLVED] GCC options: (-m64) vs (-march=native) vs (-march=core2) -- Which one(s) to use? GrapefruiTgirl Linux - Software 5 09-29-2009 07:53 AM
the problem in Native Language Set in Linux Kernel kennithwang Linux - Kernel 1 09-07-2007 02:38 AM
BCM4318 native kernel drivers FC6 losing packets Diagmato Linux - Wireless Networking 1 10-29-2006 05:25 AM
Removing native kernel Gilion Debian 3 09-26-2003 11:26 AM
Promise TX2000 + native kernel driver Moritz Linux - Hardware 3 11-06-2002 01:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 08:12 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