Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Best way to use make.conf CFLAGS for kernel make?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1556
Location: Germany

PostPosted: Sun Jan 25, 2015 6:56 pm    Post subject: Best way to use make.conf CFLAGS for kernel make? Reply with quote

Hi,

why dealing with Gentoo on VMware virtual machines I got to know that using -march=native is not always sane when it is likely to move the virtual machine between some ESX server or local VMware Workstation. So I learned a bit about -march and -mtune... There I use now the smallest -march of all targets while using -mtune=native on all.

For machines that are remaining on the same hardware for sure I'm still preferring -march=native.
Now I wondered what the kernel make is using itself. Isn't it preferable to use the same CFLAGS especially -march and -mtune also for the kernel?

So what is the best way to use make.conf there? Some elegant way to source make.conf before making the kernel?
_________________
ppc:PowerBook5,8 15"(1440)-G4/1.67,2G|amd64:HP EliteBook 8560w,i7-2620M,16G|Acer Z5610 (Core2QuadQ8200),8G|amd64-prefix:OpenSuse|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770
Lila-Theme
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43186
Location: 56N 3W

PostPosted: Sun Jan 25, 2015 7:12 pm    Post subject: Reply with quote

Massimo B.,

The kernel make system does its own thing based on the CPU options you set in make menuconfig.
make.conf is not used at all.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1556
Location: Germany

PostPosted: Sun Jan 25, 2015 7:20 pm    Post subject: Reply with quote

I see, so CONFIG_MNATIVE=y is just the same as passing "-march=native" to gcc?
Then I wonder that the moved virtual machine was booting that kernel at all and first breaking when shells and services where starting.
So for a machine that needs to be portable I should use a more generic setting there?
Code:
Processor family (Native optimizations autodetected by GCC)  --->

Is there some -mtune option in the kernel config?
_________________
ppc:PowerBook5,8 15"(1440)-G4/1.67,2G|amd64:HP EliteBook 8560w,i7-2620M,16G|Acer Z5610 (Core2QuadQ8200),8G|amd64-prefix:OpenSuse|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770
Lila-Theme
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43186
Location: 56N 3W

PostPosted: Sun Jan 25, 2015 8:34 pm    Post subject: Reply with quote

Massimo B,

The kernel does not benefit from most of the instruction set extensions.
Just because gcc is allowed to use instructions the processor does not have does not mean that it will.
You only encounter a problem when you actually encounter an illegal instruction.

I don't know the kernel build system well enough to know if there is a -mtune option.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1556
Location: Germany

PostPosted: Mon Jan 26, 2015 7:46 am    Post subject: Reply with quote

I see different menu items on these hosts:

Linux/x86 3.18.0-ck Kernel Configuration
Intel(R) Core(TM) i7-2620M CPU @ 2.70GHz
Code:
┌────────────────────── Processor family ───────────────────────┐
│  Use the arrow keys to navigate this window or press the      │ 
│  hotkey of the item you wish to select followed by the <SPACE │ 
│  BAR>. Press <?> for additional information about this        │ 
│ ┌───────────^(-)────────────────────────────────────────────┐ │ 
│ │       ( ) Intel Atom                                      │ │ 
│ │       ( ) Intel Core 2                                    │ │ 
│ │       ( ) Intel Core i7                                   │ │ 
│ │       ( ) Intel Core 2nd Gen AVX                          │ │ 
│ │       ( ) Intel Core 3rd Gen AVX                          │ │ 
│ │       ( ) Intel Core AVX2                                 │ │ 
│ │       ( ) Generic-x86-64                                  │ │ 
│ │       (X) Native optimizations autodetected by GCC        │ │
│ └───────────v(+)────────────────────────────────────────────┘ │ 
├───────────────────────────────────────────────────────────────┤ 
│                    <Select>      < Help >                     │ 
└───────────────────────────────────────────────────────────────┘

Linux/x86 3.17.7-gentoo Kernel Configuration
model name : Intel(R) Xeon(R) CPU X5690 @ 3.47GHz
Code:
┌────────────────────── Processor family ───────────────────────┐
│  Use the arrow keys to navigate this window or press the      │ 
│  hotkey of the item you wish to select followed by the <SPACE │ 
│  BAR>. Press <?> for additional information about this        │ 
│ ┌───────────────────────────────────────────────────────────┐ │ 
│ │         ( ) Opteron/Athlon64/Hammer/K8                    │ │ 
│ │         ( ) Intel P4 / older Netburst based Xeon          │ │ 
│ │         ( ) Core 2/newer Xeon                             │ │ 
│ │         ( ) Intel Atom                                    │ │ 
│ │         (X) Generic-x86-64                                │ │ 
│ └───────────────────────────────────────────────────────────┘ │ 
├───────────────────────────────────────────────────────────────┤ 
│                    <Select>      < Help >                     │ 
└───────────────────────────────────────────────────────────────┘
Is that part of the new kernel version or does it dynamically disable some items based on cpu?
_________________
ppc:PowerBook5,8 15"(1440)-G4/1.67,2G|amd64:HP EliteBook 8560w,i7-2620M,16G|Acer Z5610 (Core2QuadQ8200),8G|amd64-prefix:OpenSuse|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770
Lila-Theme
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum