Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 6145 - Propagate make.conf CFLAGS to kernel build?
Summary: Propagate make.conf CFLAGS to kernel build?
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Low minor (vote)
Assignee: Michael Cohen (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-08-07 05:48 UTC by Klaus Kusche
Modified: 2002-09-02 20:12 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Klaus Kusche 2002-08-07 05:48:05 UTC
Is it possible to propagate the CFLAGS settings from make.conf (at least march
and mcpu, to hint alignment and instruction scheduling!) into the Makefiles of
the kernel tree during emerge?

Kernel compiles still generate code optimized for the PPro (march=i686).
Comment 1 SpanKY gentoo-dev 2002-08-07 07:24:45 UTC
the cpu optimization is handled through the .config file or the kernel ... in 
other words, its something you change by using `make menuconfig` and setting up 
the kernel yourself

i believe the default cpu is PPro
Comment 2 Klaus Kusche 2002-08-07 07:54:08 UTC
Tried it with menuconfig - does not have the desired effect (at least in the
Gentoo crypto-2.4.19-r7 kernel): menuconfig offers "Pentium4", but even when
"Pentium4" is selected, the kernel is built with "-march=i686" (i.e. PPro), not
with "-march=pentium4" as expected.

I believe the kernel config mechanism has to limit its flags to the oldest gcc
allowed for kernel compiles (2.72?) and hence will not use any flags introduced
with gcc 3.[012].
Comment 3 SpanKY gentoo-dev 2002-08-07 08:09:33 UTC
this is true, the kernel cant start using flags that are available in gcc3 
cause that would piss off a lot people (and leave a lot more people in the dark 
wondering why the damned thing wont compile)

or at least right now they cant :)
maybe once ggc3 goes stable they'll consider it as an option with newer 
kernels, but i highly doubt they'll ever support them in older ones
Comment 4 Klaus Kusche 2002-08-07 08:52:26 UTC
That's why I asked if the Gentoo linux ebuild could either patch the i386 arch
Makefile or propagate the CFLAGS from make.conf into it dynamically, as
described in /usr/src/linux/Documentation/kbuild/makefiles.txt
Comment 5 Michael Cohen (RETIRED) gentoo-dev 2002-09-02 20:12:31 UTC
lolo-sources and mjc-sources use my gcc 3.1 optimization patch, which uses
-march=pentium3/4/athlon/etc.