6.4. Build Variables

6.4.1. Set Host

In the process of building the cross-compilation toolchain a local toolchain is also created. To avoid confusion with any existing native compilation tools the "triplet" for this toolchain has the word "cross" embedded into it.


export CLFS_HOST=$(echo ${MACHTYPE} | sed "s/-[^-]*/-cross/")
echo export CLFS_HOST=\""${CLFS_HOST}\"" >> ~/.bashrc

6.4.2. Set Endianess

The Endianess of system refers to how numbers are represented. See the following wiki entry for additional details: http://en.wikipedia.org/wiki/Endianness Based on the selected platform the following setting is appropriate:


export CLFS_ENDIAN=little
echo export CLFS_ENDIAN=\""${CLFS_ENDIAN}\"" >> ~/.bashrc

6.4.3. x86 Variables

During the building of the cross-compile tools you will need to set a few variables that will be dependent on your particular needs. You will need to set the target triplet for the target architecture, and the CPU type. Review the configuration file, especially the "Processor type and features" section. Set the variables using the method listed below:

Table 6.1. Processor Type and Target Triplets

Kernel Processor Target Triplet CPU Type Note
CONFIG_M486 486 Compatibles i486-pc-linux-musl i486 Intel's i486
  Pentium, K6, 586 Compatibles i586-pc-linux-musl i586 Intel Pentium without MMX
CONFIG_M686 Pentium II, Pentium III, Pentium 4 i686-pc-linux-musl i686 PentiumPro instruction set
  Athlon i686-pc-linux-musl athlon AMD 32 bit Athlon
  Opteron x86_64-unknown-linux-musl k8 AMD K8 processors with x86-64


  export CLFS_CPU=i686
  echo export CLFS_CPU=\""${CLFS_CPU}\"" >> ~/.bashrc
  export CLFS_TARGET=i686-unknown-linux-musl
echo export CLFS_TARGET=\""${CLFS_TARGET}\"" >> ~/.bashrc