7.4. Build Variables

Setting Host and Target

During the building of the cross-compile tools you will need to set a few variables that will be dependent on your particular needs. The first variable will be the triplet of the HOST machine. You will need to set the CHOST triplet to match your particular needs. To set this information you can issue the following command:

export CLFS_HOST="$(echo $MACHTYPE | sed "s/$(echo $MACHTYPE | cut -d- -f2)/cross/")"

Now you will need to set the target triplet for the target architecture. You can do this by running the same command as above, just running it on the target machine. If you can't run the command on the target machine, you can use the table at the bottom of this page. Set the command using the method listed below:

export CLFS_TARGET="{target triplet}"

Now you will need to set the MIPS LEVEL. This determines how your uClibc is built. There are currently 5 MIPS ISA Levels. To keep things simple we are only using 2. For more information, go to http://www.linux-mips.org/wiki/Instruction_Set_Architecture

export CLFS_MIPS_LEVEL="{mips level}"

Now we will add these to ~/.bashrc, just in case you have to exit and restart building later:

echo export CLFS_HOST=\""${CLFS_HOST}\"" >> ~/.bashrc
echo export CLFS_TARGET=\""${CLFS_TARGET}\"" >> ~/.bashrc
echo export CLFS_MIPS_LEVEL=\""${CLFS_MIPS_LEVEL}\"" >> ~/.bashrc

Table 7.2. Processor Type and Target Triplets

Processor Target Triplet MIPS Level
MIPS 32 bits Little Endian mipsel-unknown-linux-uclibc 1
MIPS 32 bits Big Endian mips-unknown-linux-uclibc 1
MIPS 64 bits Little Endian mips64el-unknown-linux-uclibc 3
MIPS 64 bits Big Endian mips64-unknown-linux-uclibc 3