Slackware for x86_64 - multilib packages & build instructions
=============================================================
Slackware for the x86_64 architecture (or Slackware64 for short) is a pure
64-bit Operating System, but by design it is "multilib-ready". This means,
that is it is possible to add a layer of software that will allow you to run
32bit software without changes to either Slackware64 or these 32bit packages.
Furthermore, the multilib-enabled Slackware64 can compile 32bit binaries,
if you add the right software to it.
This README contains instructions on how to use the packages in this
directory to create a multilib Slackware64.
The exciting thing about Slackware64, is that you do not have to compile
all these basic 32-bit packages from scratch. You simply take them from the
32-bit Slackware package tree! Further down, I will explain how you can take
a 32-bit Slackware package (say, the "mesa" package) and strip/re-package its
content into a "mesa-compat32" package that you can install straight away.
Enabling multilib
=================
Fast-track (examples assume slackware64-13.0 ... change to your needs):
* First, upgrade your 64bit Slackware gcc and glibc packages to their multilib
versions:
In the directory where you find the README you are reading right now, go to
the subdirectory with the number of your Slackware release (that would be
"13.0" if you are running Slackware64 13.0) and run the command
"upgradepkg --reinstall --install-new *.t?z" there.
This will also install a new package called "compat32-tools".
* You must have a 32-bit Slackware package tree available. A few lines further
down I use the example path "~ftp/pub/slackware/slackware-13.0/slackware/" .
There should be sub-directories 'a', 'ap', 'd', 'l', 'n', 'x' immediately
below this directory.
* Create a new empty directory (let us call it 'compat32') and change into it:
"mkdir compat32 ; cd compat32"
* Run the following command to create a set of 32bit compatibility packages,
using the original 32bit Slackware packages as input:
"massconvert32.sh -i ~ftp/pub/slackware/slackware-13.0/slackware/"
(in that command I assume that "~ftp/pub/slackware/slackware-13.0/slackware"
is the location where you have a 32bit Slackware package tree available).
* Install the 60 MB of freshly converted 32-bit Slackware packages:
"installpkg *-compat32/*.t?z"
* Done!
In more detail:
The following packages are replacements for - not additions to - standard
Slackware packages. You use the "upgradepkg" program to upgrade to my
multilib versions of gcc and glibc. You will need these in order to run,
and build, 32-bit software on your 64-bit Slackware computer:
==Slackware64 13.0==
* The gcc compiler suite:
- gcc-4.3.3_multilib-x86_64-4alien.txz
- gcc-g++-4.3.3_multilib-x86_64-4alien.txz
- gcc-gfortran-4.3.3_multilib-x86_64-4alien.txz
- gcc-gnat-4.3.3_multilib-x86_64-4alien.txz
- gcc-java-4.3.3_multilib-x86_64-4alien.txz
- gcc-objc-4.3.3_multilib-x86_64-4alien.txz
* The GNU libc libraries:
- glibc-2.9_multilib-x86_64-3alien.txz
- glibc-i18n-2.9_multilib-x86_64-3alien.txz
- glibc-profile-2.9_multilib-x86_64-3alien.txz
- glibc-solibs-2.9_multilib-x86_64-3alien.txz
- glibc-zoneinfo-2.9_multilib-noarch-3alien.txz
==Slackware64 13.1==
* The gcc compiler suite:
- gcc-4.4.4_multilib-x86_64-1alien.txz
- gcc-g++-4.4.4_multilib-x86_64-1alien.txz
- gcc-gfortran-4.4.4_multilib-x86_64-1alien.txz
- gcc-gnat-4.4.4_multilib-x86_64-1alien.txz
- gcc-java-4.4.4_multilib-x86_64-1alien.txz
- gcc-objc-4.4.4_multilib-x86_64-1alien.txz
* The GNU libc libraries:
- glibc-2.11.1_multilib-x86_64-3alien.txz
- glibc-i18n-2.11.1_multilib-x86_64-3alien.txz
- glibc-profile-2.11.1_multilib-x86_64-3alien.txz
- glibc-solibs-2.11.1_multilib-x86_64-3alien.txz
- glibc-zoneinfo-2.11.1_multilib-noarch-3alien.txz
Note that Slamd64 had separate 64bit and 32bit gcc/glibc multilib packages.
However, I decided that it is cleaner to keep these essential multilib
packages undivided. Just like Slackware64's own binutils, which has 64-bit
and 32-bit multilib capability bundled into one package too.
There is one more package (compat32-tools); you install it using the
"installpkg" program:
* A "32-bit toolkit" (scripts that facilitate the creation of 32bit packages)
- compat32-tools-2.0-noarch-1alien.tgz
Adding 32-bit programs
======================
The scripts in the "compat32-tools" package need some explanation.
The package installs a detailed 'README' in the /usr/doc/compat32-tools-*/
directory that will help you on your way. Basically, you get three scripts
to run:
- /etc/profile.d/32dev.sh
This is the same script that also comes with Slamd64 and which configures
an environment that you need for compiling 32-bit software (by preferring
the 32-bit compilers and libraries over their 64-bit versions)
- convertpkg-compat32
This script takes a 32-bit Slackware package and converts it to a
'-compat32' package that you can install (using "installpkg") on
Slackware64, alongside a 64-bit version of the same software.
- massconvert32.sh
This script has an internal list of an essential set of 32-bit Slackware
packages. It uses the previous "convertpkg-compat32" script to grab
every package that is on the internal package list, and convert that
into '-compat32' packages. You will end up with about 60 MB of packages
that you should install next, using "installpkg", to form a pretty
complete 32-bit compatibility layer on top of Slackware64. Of course,
you must have a local 32-bit Slackware package tree available or this
conversion process won't work! The script takes the pathname for your
local package tree as its argument, and optionally you can specify an
output directory other than your current directory.
Running 32-bit programs
=======================
Running a 32-bit program is easy after the above system preparation - just
download, install and start it. You may find that you still miss a 32-bit
Slackware library; in that case, use the "convertpkg-compat32" program to
convert the original 32-bit Slackware package and install the resulting
32bit compatibility package on Slackware64.
Compiling 32-bit programs
=========================
In case you need to compile a 32-bit program (wine and grub are two examples
of open source programs that are 32-bit only) you first configure your
shell environment by running the command:
. /etc/profile.d/32dev.sh
Note the 'dot' in front of the filename - that is actually part of the
commandline! It will change or create several environment variables so
that 32-bit versions of binaries are preferred.
You will be able to use standard SlackBuilds to build 32-bit packages for
Slackware64. There are two things to keep in mind:
(1) You will have to define the ARCH variable as 'x86_64' even though you
are compiling a 32-bit program!
(2) You will have to edit the SlackBuild and if it wants to use 'lib64/'
directories for "$ARCH = x86_64", you will have to force it to use 'lib/'
directories instead. Usually, this is accomplished by finding a definition
like:
LIBDIRSUFFIX="64"
and change this line to
LIBDIRSUFFIX=""
Acknowledgements
================
A lot of thanks should go to Fred Emmott, who created Slamd64, the original
unofficial 64-bit fork of Slackware. Although Slackware64 was not based
on Fred's work, I still learnt most of what I know about setting up the
32-bit part of a multilib Linux from his writings that are found in Slamd64.
Cross Linux From Scratch. The CLFS Wiki
(http://trac.cross-lfs.org/wiki/read#ReadtheCrossLinuxFromScratchBookOnline)
is a 'must-read' if you want to understand how to port Linux to a new
architecture. I took several ideas, concepts and patches from them when
creating Slackware64 from scratch, and again when I created my multilib
gcc/glibc packages from scratch (my README on this multilib-from-scratch
is available in the ./source directory).
Have fun!
Eric
=============================================================================
Eric Hameleers <alien@slackware.com> 15-may-2010
Apache/2.2.14 Server at slackware.com Port 80