LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Slackware: i486 and optimizations (http://www.linuxquestions.org/questions/slackware-14/slackware-i486-and-optimizations-575414/)

alphisb0t 08-07-2007 03:16 PM

Slackware: i486 and optimizations
 
Hello all. I'm a huge fan of Slackware and recently tried out Gentoo because of a friend (who is hardcore into Gentoo). Its a very nice distro but I prefer my laptop to have Slackware on it. And now that 12.0 is out I'm updating my laptop as I type this.

Now getting to my question. I've been building apps for slackware via source for a long time and never thought anything of it until now. Gentoo has this make.conf file which is designed for optimization of anything you build. The target, host, and optimization level are all in there so when you build something it always builds with those optimizations and parameters.

I notice i486 in the filenames and during compilation of most of the software I build on my slack box and am thinking to myself that this could be made much better! I'm not using a 486 and as such the software shouldn't be built with such a system as a target.

Can I make i686 or better compiles with Slack? If so then how?

Thanks for any and all information!

hollywoodb 08-07-2007 03:32 PM

If you're comfortable with bash, the SlackBuilds.org template has provisions for optimizing for i486 or i686:

http://slackbuilds.org/template.SlackBuild

Basically it is determined by what you pass to ./configure at compile time.

the3dfxdude 08-07-2007 04:12 PM

You already said you have been compiling from source for a long time, so it's likely you don't have to do anything much different. gcc without any flags will automatically pick safe optimizations for your architecture. So most "./configure && make" with no flags is good enough.

Inuit-Uprising 08-07-2007 04:32 PM

Do the optimizations make a clear difference? Is it even worth it?

crashmeister 08-07-2007 04:43 PM

Actually many of the options in the make.conf get filtered out otherwise there would be a lot or borked systems around.All those flags have side effects - like O3 and further flags make the binary bigger resulting in longer startup times.
Anyway whatever you do don't change the CHOST setting from i486 to anything else or things will get strange - just did that the other day - that setting doesn't affect the compilerflags anyway.

Eternal_Newbie 08-07-2007 04:50 PM

Slackware is already optimised for i686, if you have a look at any of the slackbuild scripts you will see it contains the "-mtune=i686" flag.
Nothing to stop you optimising further of course.

MannyNix 08-07-2007 05:08 PM

Interesting post.
I'm also trying something similar.
As said before, most Slackbuilds (official or from slackbuilds.org) have the $ARCH template.
Here's what i'm doing with some official slackbuilds, this is part of my modified glibc.SlackBuild:
Code:

# This should be i486 for all 32-bit x86 arch:
TARGET=${TARGET:-i486}
if [ "$ARCH" = "i386" ]; then
  OPTIMIZ="-O3 -march=i386 -mcpu=i686"
elif [ "$ARCH" = "i486" ]; then
  OPTIMIZ="-O3 -march=pentium4 -pipe -fomit-frame-pointer"
 else
  OPTIMIZ="-O3"
fi

Gentoo, Slackware, <any>distro can be optimized.
Portage does it all for you with make.conf and USE flags. In Slackware you are the package manager :)
You can have the "USE" flags on the slackbuilds themselves:
Code:

CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
  --disable-debug \
  --without-kipi \
  --without-arts \

Quote:

Anyway whatever you do don't change the CHOST setting from i486 to anything else or things will get strange
I totally agree.

Have you seen arch-linux ABS?
Take a look at their /etc/makepkg.conf

The only thing i didn't like about Gentoo on the lappy is how hot it gets sometimes :)
And yes:
Quote:

Slackware Linux can run on 486 systems all the way up to the latest x86 machines (but uses -mcpu=i686 optimization for best performance on i686-class machines like the P3, P4, and Duron/Athlon).
(http://slackware.com/info/)

Have fun!

EDIT: Oh yeah, as alphageek told me:
Quote:

having a turbocharged custom build of 'ls' won't exactly do much for you :)


All times are GMT -5. The time now is 08:11 AM.