Slackware This Forum is for the discussion of Slackware Linux.
|
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
02-01-2006, 05:20 PM
|
#1
|
|
Member
Registered: Jan 2004
Location: Poland, Poznan
Distribution: Slackware current
Posts: 157
Rep:
|
Passing gcc flags into custom kernel
How to inject "-Os -march=pentium3 -fomit-frame-pointer -pipe" gcc flags settings into kernel being custom compiled ?
Do I need to edit every Makefile in /usr/src/linux*** ?
I do it while compiling other software just by inserting these flags at CFLAGS declarations.
|
|
|
|
02-01-2006, 07:35 PM
|
#2
|
|
Member
Registered: Nov 2004
Location: Columbus, Ohio
Distribution: Slackware-Current / Debian
Posts: 795
Rep:
|
Code:
export CFLAGS="-Os -march=pentium3 -fomit-frame-pointer -pipe"
export CXXFLAGS="-Os -march=pentium3 -fomit-frame-pointer -pipe"
|
|
|
|
02-02-2006, 03:33 AM
|
#3
|
|
Member
Registered: Jan 2004
Location: Poland, Poznan
Distribution: Slackware current
Posts: 157
Original Poster
Rep:
|
But...
Is it enough to run from bash these 2 export commands before running "make" ?
What if there will be another CFLAGS= declaration inside Makefile(s) processed later ? Will my hand declaraion be overwritten ?
|
|
|
|
02-02-2006, 05:52 AM
|
#4
|
|
Member
Registered: Nov 2004
Location: Columbus, Ohio
Distribution: Slackware-Current / Debian
Posts: 795
Rep:
|
The above export commands will append what's already in the makefile, IIRC.
I have the statements in my ~/.bashrc with no ill effects...
|
|
|
|
02-02-2006, 07:59 AM
|
#5
|
|
Member
Registered: Jun 2003
Location: Dublin, Ireland
Distribution: Slack -- current
Posts: 354
Rep:
|
I have flags like the above in my .profile (and .bashrc) and they are over-ridden by the Makefile. You'll have to edit the Makefile I believe, at least that's how I changed it.
(On kernel 2.6.x there is the option for -Os, enabling that will do.)
|
|
|
|
03-04-2012, 09:09 AM
|
#6
|
|
LQ Newbie
Registered: May 2005
Posts: 7
Rep:
|
env vars didn't work on CentOS 6.2
I had to manually edit the 2 makefiles in this folder:-
/usr/src/redhat/BUILD/kernel-2.6.32/linux-2.6.32.x86_64/arch/x86
to get the thing to pick up those changes, prior to building like this:-
cd /usr/src/redhat/SPECS/;rpmbuild -bb --target `uname -m` kernel.spec
|
|
|
|
03-04-2012, 09:32 AM
|
#7
|
|
Member
Registered: May 2007
Posts: 276
Rep:
|
Set the following config options. It's better to do it this way, so you can keep a record of the config file. There's no reason to edit the Makefiles, or set CC on your own.
General setup -> Check "Optimize for size" (CONFIG_CC_OPTIMIZE_FOR_SIZE)
Processor type and features -> Processor family -> Check "Pentium-III/Celeron(Coppermine)/Xeon" (CONFIG_MPENTIUMIII)
Kernel hacking -> Uncheck "Compile the kernel with frame pointers" (CONFIG_FRAME_POINTER=n)
-pipe doesn't affect the quality of the compiled code.
|
|
|
|
03-05-2012, 03:17 AM
|
#8
|
|
Member
Registered: May 2007
Location: US
Distribution: slackware
Posts: 125
Rep:
|
Quote:
Originally Posted by cnd
I had to manually edit the 2 makefiles in this folder:-
/usr/src/redhat/BUILD/kernel-2.6.32/linux-2.6.32.x86_64/arch/x86
to get the thing to pick up those changes, prior to building like this:-
cd /usr/src/redhat/SPECS/;rpmbuild -bb --target `uname -m` kernel.spec
|
You bumped a 6 year old Slackware thread to give Redhat advice?
|
|
|
1 members found this post helpful.
|
03-05-2012, 04:03 AM
|
#9
|
|
LQ Newbie
Registered: May 2005
Posts: 7
Rep:
|
@narz Why are you wasting everyones time with your stupid comment?
I obviously had my reasons, and you'd have to be pretty dim not to figure it out: This is the top google result for this issue, and the advice doesn't work for modern distros.
If you actually want to optimize your kernel for your running CPU, my response now tells people how to do that, which is to mod the -mtune=native parm into those 2 makefiles.
Do not reply. Go on. I dare you. Prove you're not a troll, and try not to reply.
|
|
|
|
03-05-2012, 05:10 AM
|
#10
|
|
Member
Registered: Sep 2009
Location: Yorks. W.R. 167397
Distribution: Slackware 13.37
Posts: 171
Rep: 
|
Quote:
Originally Posted by cnd
This is the top google result for this issue, and the advice doesn't work for modern distros.
|
And, uh, what proportion of modern distros does your advice work for? the3dfxdude's advice works properly, for all distros, and the fact that the options are right there in the standard kernel menus for all to see is why nobody worries about this any more.
Allocation of stupidity is left as an exercise for the reader.
|
|
|
1 members found this post helpful.
|
03-05-2012, 06:39 AM
|
#11
|
|
Member
Registered: May 2007
Location: US
Distribution: slackware
Posts: 125
Rep:
|
Quote:
Originally Posted by cnd
@narz Why are you wasting everyones time with your stupid comment?
I obviously had my reasons, and you'd have to be pretty dim not to figure it out: This is the top google result for this issue, and the advice doesn't work for modern distros.
If you actually want to optimize your kernel for your running CPU, my response now tells people how to do that, which is to mod the -mtune=native parm into those 2 makefiles.
Do not reply. Go on. I dare you. Prove you're not a troll, and try not to reply.
|
Wow you're serious?? Like 55020 mentioned, the3dfxdude tells you exactly how to do all this on modern distros. You don't have to edit any makefiles. Try and relax.
Last edited by narz; 03-05-2012 at 06:41 AM.
|
|
|
|
03-05-2012, 10:09 AM
|
#12
|
|
Moderator
Registered: May 2001
Posts: 24,805
|
Now now, there there. All quiet again... (Closed)
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 06:40 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|