Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Debian This forum is for the discussion of Debian Linux.


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

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


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
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
Registered: May 2003
Location: Tengiz
Distribution: Slackware64 14.1
Posts: 673

Rep: Reputation: 94
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
Registered: May 2003
Location: Tengiz
Distribution: Slackware64 14.1
Posts: 673

Rep: Reputation: 94
i forgot to say that you do not hove to do export the flag variables. just use this
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
LQ Newbie
Registered: Jul 2010
Posts: 4

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

KCFLAGS="-march=native -O2 -pipe" KCPPFLAGS="-march=native -O2 -pipe" make all
Per the gcc manpage:
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.


cflags, compile, configure, flags, kernel

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
[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 > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 01:28 AM.

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