SlackwareThis 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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
slackware arch is i486. So the binaries don't have any code for mmx instruction set, correct?
when it says i686 optimized it's it means it's optimizing the i486 instruction set schedulilng for a i686, but still is not using the i686 instruction set, correct?
All of the i486 package build scripts use the following CFLAGS:
-march=i486 -mcpu-i686 -O2
What that does, basically, is generate code tuned for the specified CPU, but it does not alter the the set of available instructions generated by -march, so you can still run the resulting binary on other CPUs. In this case the package is tuned for the i686 cpu but can still execute/install on an i486. Also setting the -mcpu=i686 does actually turn on things like mmx. If I understand it correctly.
Here's a decent little article about it, GCC Myths and Facts. You can also google around as there are, quite possibly, hundreds of sites with even more information.
Also setting the -mcpu=i686 does actually turn on things like mmx.
confused if the march is set to the i486 instruction set, which excludes the mmx instuction set then how then can mcpu just turn it on?
I thought mcpu just optimizes the scheduling for a specific arch but still does not use any new instruction outside of march. If it did then the code that included the MMX instruction set would fail to run on anything less than a i686.
-march implies -mcpu, so when you use -march, there's no need to use -mcpu.
-mcpu generates code tuned for the specified CPU, but it does not alter the ABI and the set of available instructions, so you can still run the resulting binary on other CPUs (it turns on flags like mmx/3dnow, etc.).
When you use -march, you generate code for the specified machine type, and the available instructions will be used, which means that you probably cannot run the binary on other machine types.
I could be confused, I get that way sometimes when articles seem to go round in circles. .
-mcpu generates code tuned for the specified CPU, but it does not alter the ABI and the set of available instructions, so you can still run the resulting binary on other CPUs (it turns on flags like mmx/3dnow, etc.).
that sentence is contradicting itself?
1)does not alter the ABI and the set of available instructions
2)it turns on flags like mmx/3dnow, etc
if 1 is true then 2 is false. if 2 is true then 1 is false. true and false = false. therefore the statement is false. SIMPLE LOGIC.
lol. you can't do both. not enable anything outside the i486 instruction set and then go ahead and enable the MMX instruction set, which is outside the i486 instruction set?
-mtune=cpu-type Tune to cpu-type everything applicable about the generated code, except for the ABI and the set of available instructions. (now if I just knew what ABI stood for )
-march=cpu-type Generate instructions for the machine type cpu-type. The choices for cpu-type are the same as for -mtune. Moreover, specifying -march=cpu-type implies -mtune=cpu-type.
So, if I understand this right you can use -march to compile for the "general" architecture, so setting march=i686 would compile for anything from a Pentium (MMX/PRO?) to a Pentium 4 and even the Athlon/Athlon-XP. Then adding mtune=athlon-xp would ADD any optimizations for that specific CPU.
Sorry, I hope you didn't take my logic post as making fun of you. After I looked at it you might take it that way.
If you assume that march=i486 doesn't include the MMX instruction set then then everything makes sense. However, if you assume MMX does get included then everything falls apart again because MMX first started to appear on the pentium 2, it is not on a i486 chip.
So therefore I'm forced to conclude that march=i486 doesn't include the MMX instuction set in the final binary.
Unless some PH D carrying expert dude could explain it to me. Because when I go to the gcc and read the documentation it seems to me only a PH D carrying expert dude could understand what the hell they are documenting about.
Originally posted by chbin Sorry, I hope you didn't take my logic post as making fun of you. After I looked at it you might take it that way.
Nope, never thought no such a thing.
Quote:
Originally posted by chbin Unless some PH D carrying expert dude could explain it to me. Because when I go to the gcc and read the documentation it seems to me only a PH D carrying expert dude could understand what the hell they are documenting about.
Yeah, I was reading some of that stuff and it cleared everything right up!
There is a complete info manual for gcc installed with slackware
To lookup for march, try
info gcc
--then press ' s ' key
--type ' march ', <enter>, <enter> (again)
-- scroll down with the bottom arrow key, position the cursor to:
* i386 and x86-64 Options::
then press <enter>
BTAIM, here is my build script, with what I hope are the correct settings (and I think they are) for my Athlon-XP.
Code:
# /bin/bash
#
# Script for building Slackware packages from .tar.gz archives
#
# Set script variables
SRC="/work/src/path"
FILE="filename"
VER="x.xx.x"
ARCH="i686"
REV="xmmy"
STORE="/work/packages/"
BUILD="/work/builds/"
DESC="/work/builds/install/"
DOCS="WHAT EVER DOCS ARE IN ARCHIVE ROOT"
DOCD="/work/builds/usr/doc/"
HOST=""i486-slackware-linux""
FLAGS=""-march=i686 -mtune=athlon-xp -O2 -pipe -fomit-frame-pointer""
XFLAGS=""-march=i686 -mtune=athlon-xp -O2 -pipe -fomit-frame-pointer""
CFG="--prefix=/usr --sysconfdir=/etc --localstatedir=/var"
# Now let's head on over to the source directory and untarr the archive
cd ${SRC}
tar -xvzf ${FILE}-${VER}.tar.gz
cd ${FILE}-${VER}
# OK, that's done now let's start the compile
CHOST=${HOST} \
CFLAGS=${FLAGS} \
CXXFLAGS=${XFLAGS} \
./configure ${CFG}
# Now run make
make
# I need to make sure that the perms and ownership of the files are correct
chown -R root.root .
find . -perm 777 -exec chmod 755 {} \;
find . -perm 555 -exec chmod 755 {} \;
find . -perm 444 -exec chmod 644 {} \;
find . -perm 666 -exec chmod 644 {} \;
find . -perm 664 -exec chmod 644 {} \;
# Now let's actually build the program and install it to /work/builds
make install DESTDIR=${BUILD}
# Now I need to copy over the "doc" files
mkdir -p ${DOCD}/${FILE}-${VER}
cp ${DOCS} ${DOCD}/${FILE}-${VER}
# Now that's done so we need to head on over to the /work/builds directory
cd ${BUILD}
# Now I need to get the slack-desc file for this package
cp ${SRC}/slack-desc ${DESC}
# Now we're ready to make the package
makepkg ${FILE}-${VER}-${ARCH}-${REV}.tgz
# Now that the package is ready I wan to move it to my package repository
mv *.tgz ${STORE}
# And finally the clean up
rm -rf *
mkdir install
cd ${SRC}
rm -rf ${FILE}-${VER}
# end
I've compiled a few programs using it and the seem to work just fine!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.