LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 08-13-2005, 11:32 AM   #1
fast_rizwaan
Member
 
Registered: Oct 2002
Location: Hyderabad, India
Distribution: Slackware 10.1
Posts: 34

Rep: Reputation: 15
Rebuilding slackware from scratch with gcc-3.4.4


Hey, I am downloading "slackware-current" sources, I wish to have everything compiled with GCC-3.4.4 (present in the slackware current /testing/gcc).

I want to recompile my whole slackware system with GCC-3.4.4 for performance improvement. I have observed Speed improvement with Kernel-2.6.11.7 and KDE.

How do I go about building the whole system with gcc 3.4.4? Please advise...

thanks

Last edited by fast_rizwaan; 08-13-2005 at 11:33 AM.
 
Old 08-13-2005, 11:39 AM   #2
keefaz
Senior Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 4,340

Rep: Reputation: 73
Quote:
I want to recompile my whole slackware system with GCC-3.4.4 for performance improvement.
Where did you read that recompile your system with gcc 3.4.4 will improve performance ?
Also what do you need to improve exactly ?

(don't take it as an offence, I personnally think compiling a whole system is an
interesting experience)
 
Old 08-13-2005, 12:14 PM   #3
fast_rizwaan
Member
 
Registered: Oct 2002
Location: Hyderabad, India
Distribution: Slackware 10.1
Posts: 34

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by keefaz
Where did you read that recompile your system with gcc 3.4.4 will improve performance ?
Also what do you need to improve exactly ?

(don't take it as an offence, I personnally think compiling a whole system is an
interesting experience)
As in my theard itself i've said, I found kernel and kde performance or should I rephrase that "responsive" and KDE applications just popped open twice as fast.

I did that (compiling of Kernel 2.6.11.7 and KDE 3.4.1 ) few months back with gcc 3.4.3, now the problem I would face is "incompatible" libraries. hence I want to recompile the whole system. esp. with nvidia drivers and alsa. I also compiled KDE 3.4.1 and kernel 2.6 with GCC 4.0.1, but sound won't work and most base applications won't work due to incompatible libraries.)

btw, GCC 4x and 3.4.x has "-f-visibility" something features which improves the C++ compiled programs. whereas gcc 3.3.5 (default gcc with slackware 10.1) doesn't support that feature.

I'm also learning/understanding how GNU/Linux work!
 
Old 08-13-2005, 12:19 PM   #4
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
That's quite an undertaking. If you've never built LFS before you probably should do that first (once or twice) and then figuring out a rebuild of Slackware would actually be alot easier. Using pkgtools with LFS and using the BSD init scripts hint in place of the books sysvinit section will pretty much give you Slackware. Seriously, you really won't be able to tell a difference. I've done it before and it's really slick.

There is a thread in the LQ LFS forum on using pkgtools and then check out LFS HINTS for the BSD bootup scripts. If you don't mind SysVinit scripts, then just follow the LFS book when you get to that part. That will still leave you will pkgtools and an i686 optimized build. Except for the bootup process, again, you'll be hard pressed to differentiate between the two.

You'll need alot of patches from LFS if your building with a newer GCC. Again, build LFS and you'll see what I'm talking about.

What keefaz implied is correct. I don't think your going to get a performance boost just from using a newer GCC. It's the flags you use with GCC that is going to give you an increase in speed, however miniscule that may be. You really won't be able to tell a diff between an i686 Slack and an i486 Slack. It's still a worth while project tho, just because you learn alot in the process.
 
Old 08-13-2005, 12:26 PM   #5
keefaz
Senior Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 4,340

Rep: Reputation: 73
A few time ago, I was reading some docs from LFS
http://www.linuxfromscratch.org/lfs/view/development/

They pointed out the importance of the Toolchain and various tip for
compiling softwares and libs

For slackware, I would try to follow the slackbuild scripts available from
slackware source mirrors with the help of LFS docs
 
Old 08-13-2005, 12:32 PM   #6
fast_rizwaan
Member
 
Registered: Oct 2002
Location: Hyderabad, India
Distribution: Slackware 10.1
Posts: 34

Original Poster
Rep: Reputation: 15
I'm going to build using the .SlackBuild scripts because it automatically patches and creates the packages too.

thanks for the info. though.
 
Old 08-13-2005, 01:08 PM   #7
kornerr
Member
 
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893

Rep: Reputation: 35
fast_rizwaan, how did you recompile QT?
I've changed all Makefiles (not manually, of course, they're 240!) with "-O3 -march=pentium4 -s -Wall -pipe"...
and couldn't compile any further, only errors
How did you do that step?

Thanks.
 
Old 08-14-2005, 11:58 AM   #8
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
Quote:
Originally posted by fast_rizwaan
I'm going to build using the .SlackBuild scripts because it automatically patches and creates the packages too.

thanks for the info. though.
That's what I was implying. Build/Install pkgtools right after you complete the toolchain section of LFS and then use the .SlackBuild scripts. You'll need to do everything in a certain order. Looking at the LFS order will help you with that. That leaves you with an i686 Slackware once your done.

If your building with a newer GCC, you WILL need extra patches for certain progs. You can't just use Slacks source directory with 3.4.4..... Many programs will bomb out on the make. Some programs are slow to fix code so it will compile with a newer GCC. Anytime you see "This patch fixes a compilation problem with GCC-3.4.4" in the LFS book, you will need that patch.
 
Old 08-14-2005, 12:39 PM   #9
fast_rizwaan
Member
 
Registered: Oct 2002
Location: Hyderabad, India
Distribution: Slackware 10.1
Posts: 34

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by kornerr
fast_rizwaan, how did you recompile QT?
I've changed all Makefiles (not manually, of course, they're 240!) with "-O3 -march=pentium4 -s -Wall -pipe"...
and couldn't compile any further, only errors
How did you do that step?

Thanks.
I would rather get QT 3.3.5 from http://www.alinux.org

then install the src.rpm

1. rpm -ivh qt-*.src.rpm
2. cd /usr/src/rpm/SPECS
3. rpmbuild -ba qt*.spec

also delete the dependencies in the spec files

and wait for the compilation to complete. hope this helps.

Last edited by fast_rizwaan; 08-14-2005 at 12:41 PM.
 
Old 08-14-2005, 06:10 PM   #10
shashir
Member
 
Registered: Jul 2004
Posts: 70

Rep: Reputation: 15
Don't compile your whole system from scratch. You will waste at least 20 hours and it won't be made up in the time it saves until over 10 years (and in 5 years, you will probably start thinking of a new computer anyway). Why bother getting a 2 second faster optimized KDE with stability issues when you can have it lag for 2 seconds and have it running with zero issues. I really think compiling from scratch is a waste of sweet time and you will just end up using 100s hours from then on trying to fix bugs when the compiles don't go very smoothly. The slackware packages are precompiled and extremely stable versions anyway.

I am telling you from experience... I wasted at least 200 hours of my short life trying to optimize everything... and for what end? I just run back to using precompiled packages.

Use your time wisely... go practice chess and improve your intellectual skills (your country needs your kind more than ever now... now that everyone there is trying to come to America)

Last edited by shashir; 08-14-2005 at 06:18 PM.
 
Old 08-15-2005, 10:06 AM   #11
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,749

Rep: Reputation: 461Reputation: 461Reputation: 461Reputation: 461Reputation: 461
What you want to do is the same as what Patrick does to create a new version with lib changes.

1. First compile your new libs and install them somewhere temporarily where you can keep them separate from your running libs.

2. compile your new compiler, linked against the new libraries and install in a separate path from your running gcc.

3. This is the hard part :-(
Use the new compiler to compile your new programs, linking them to your new libraries.
a. You have to change your path so that it finds the new toolchain before your running gcc and ld.
b. Configure each source package so that it links to your new libs (where they are now), but looks for them in the 'right' place once compiled and installed.
This means specifying LD_LIBRARY_PATH and with your installation dirs specified ( bindir= sbindir= , and especially, libdir=).
c. Once you have the basic packages compiled (enough to run your new compiler in a stand-alone installation), you can install the new libs, compiler and other packages to a new drive, boot that and then build packages normally using the regular slackware scripts.

If you just want to use the new compiler, but linking with the same libs as in current, just install the compiler and start recompiling packages using the slackware build scripts and then install them normally to create your system.

I've done something similar recently, getting gcc-2.95.3 compiled and (partially working). Partially means that C progs compile and link fine, but c++ source doesn't -haven't got the linking just right yet.
Some time ago I did a more radical thing by working my way through a (defunct) project called uStep (uses LinuxStep stuff also). That's more involved, since it entails also changing the default paths in the kernel and in very program. Still you can build a demo system with just a few packages -each patched and hand-edited along with the kernel! Now that one will teach you a thing or two. Actually, the build is very well documented, and just having it there for reference helps.
 
Old 08-15-2005, 01:20 PM   #12
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
I'd hardly call compiling your system from scratch a waste of time. The amount of things you learn by doing so can be stagering.... More than you'll ever learn by just USING Slackware. (Although, .SlackBuild scripts will take away from the learning considerably).

As far as having it run faster, yea... Probably a waste of time. IF it does run faster, 10:1 you won't even be able to perceive the difference.
 
  


Reply


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
Building GCC on SuSE 9.3 from scratch... foucault Linux - Software 0 10-25-2005 06:30 AM
Installing GCC from scratch?? The_Nerd Linux - Software 2 10-23-2005 03:39 PM
odd problem with GCC pass 1... :scratch: ParticleHunter Linux From Scratch 15 12-05-2004 10:21 PM
New Linux From Scratch system still using GCC in /tools! black hole sun Linux From Scratch 1 09-26-2004 08:21 PM
ali aladdin v agp stinks :scratch: :scratch: :scratch: Mr Marmmalade Linux - Hardware 1 07-08-2003 05:11 AM


All times are GMT -5. The time now is 08:51 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration