LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Rebuilding slackware from scratch with gcc-3.4.4 (https://www.linuxquestions.org/questions/slackware-14/rebuilding-slackware-from-scratch-with-gcc-3-4-4-a-352877/)

fast_rizwaan 08-13-2005 11:32 AM

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 :)

keefaz 08-13-2005 11:39 AM

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)

fast_rizwaan 08-13-2005 12:14 PM

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! :)

jong357 08-13-2005 12:19 PM

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.

keefaz 08-13-2005 12:26 PM

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

fast_rizwaan 08-13-2005 12:32 PM

I'm going to build using the .SlackBuild scripts because it automatically patches and creates the packages too.

thanks for the info. though.

kornerr 08-13-2005 01:08 PM

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.

jong357 08-14-2005 11:58 AM

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.

fast_rizwaan 08-14-2005 12:39 PM

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.

shashir 08-14-2005 06:10 PM

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)

gnashley 08-15-2005 10:06 AM

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.

jong357 08-15-2005 01:20 PM

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.


All times are GMT -5. The time now is 12:18 PM.