Source Mage GNU/Linux

Programs Speedtouch Project Snoopy Project eciadsl Project The bread recipe Source Mage BeOS My resume My blog Notes Donation
Programs
Speedtouch Project
Snoopy Project
eciadsl Project
The bread recipe
Source Mage
BeOS
My resume
My blog
Notes
Donation
en fr

Source Mage GNU/Linux

Benoīt PAPILLAULT, 2004-09-21
Last updated 2005-02-16

Documentation of sorcery's modifications

Those modifications are needed to support bi-arch platforms, like AMD64 (x86-64) for instance.

Converting a spell to be BUILD_API=2 compliant

First of all, only BUILD_API=2 compliant spells are supported. BUILD_API=1 compliant spells need to be converted by following a simple procedure that is described here:

  • Delete the part of the BUILD file after prepare_install and put it in the INSTALL file. The BUILD file should be equivalent to:
    ./configure --build="${BUILD}" --host="${HOST}" \
                --prefix=/usr \
                --sysconfdir=/etc \
                --localstatedir=var \
                --libdir="\${prefix}/${LIB}" \
                --mandir="\${prefix}/share/man" \
                --infodir="\${prefix}/share/info"
                $OPTS
    make
    

    Note: the use of LIB variable is needed for bi-arch spells.

    Furthermore, the INSTALL file should contain the equivalent of :

    make install DESTDIR="${INSTALL_ROOT}"
    

    Note: when this file is executed, the current directory could be different from the current directory at the end of BUILD file execution. This only occur on bi-arch platforms and in the case of bi-arch spell.

  • Even if that is not needed, sorcery requires that BUILD and INSTALL files be executable. If they are not, they are simply ignored!
  • Add BUILD_API=2 and update the field UPDATED= in the DETAILS file.

Modifications needed for bi-arch spells

Further modifications are needed for bi-arch spells, ie for spells that will be compiled for both architectures. You need to add BI_ARCH_SPELL=yes in the DETAILS (and update UDATED= if needed). In this case, BUILD and INSTALL files ONLY are executed for both architectures.

Modifications of architecture's definition

Each architecture is defined in a file under /var/lib/sorcery/archspecs. For sorcery, each architecture is defined in a file with the same name. For instance, x86_64 is defined in /var/lib/sorcery/archspecs/amd64/x86_64. For bi-arch platforms, 4 parameters have been added to this file:

  • BI_ARCH="yes" tells us that we are dealing with a bi-arch platform.
  • LIB="lib64" is the directory where native libraries will be installed. Like other distros, this is the lib64 directory. The value should not contains any /, nor before, not after, since it's used in expression like /${LIB} or /usr/${LIB}.
  • SUBARCH="x86_32" is the name of the sub architecture. Like the name of the architecture, it is the name of a file. Here, x86_32
  • SUBLIB="lib" is the directory where libraries of the sub-architecture will be installed. Like other distros, this is the lib directory. The value should not contains any /, nor before, not after, since it's used in expression like /${LIB} or /usr/${LIB}. It must be a different directory than LIB= of course.
Here are the files that we have used:
  • /var/lib/sorcery/archspecs/amd64/x86_64
    CPUNAME="AMD Athlon 64, Athlon 64 FX and Opteron"
    # -m64 is not needed since it is the default. However, since gcc spell
    # adds  a -m32, this was causing problems.
    CFLAGS="-march=athlon-xp -mmmx -mfpmath=sse -msse -msse2 -m3dnow"
    HOST="x86_64-unknown-linux-gnu"
    FAST="-O2"
    SMALL="-Os"
    BI_ARCH="yes"
    LIB="lib64"
    SUBARCH="x86_32"
    SUBLIB="lib"
    
  • /var/lib/sorcery/archspecs/amd64/x86_32
    CPUNAME="AMD Athlon 64, Athlon 64 FX and Opteron"
    CFLAGS="-march=athlon-xp -mmmx -mfpmath=sse -msse -msse2 -m3dnow -m32"
    HOST="i686-pc-linux-gnu"
    FAST="-O3"
    SMALL="-Os"
    

Used patches

Those patches applies to sorcery stable 1.11.4.
Valid XHTML 1.0! CSS Valide !
BenoƮt Papillault PGP key