5.3. 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, which will be put into the CLFS_HOST variable. To account for the possibility that the host and target are the same arch, as cross-compiling won't work when host and target are the same, part of the triplet needs to be changed slightly to add "cross". Set CLFS_HOST using the following command:

export CLFS_HOST=$(echo ${MACHTYPE} | sed -e 's/-[^-]*/-cross/')

Now you will need to set the triplet for the target architecture. Set the target variable using the following command:

export CLFS_TARGET="[target triplet]"

Replace [target triplet] with the appropriate machine triplet using the table at the bottom of the page.

Copy settings to the Environment

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

cat >> ~/.bashrc << EOF

Table 5.1. Processor Type and Target Triplets

Processor Target Triplet
Unknown alpha-unknown-linux-gnu
EV5 Series alphaev5-unknown-linux-gnu
EV56 Series alphaev56-unknown-linux-gnu
PCA56 Series alphapca56-unknown-linux-gnu
PCA57 Series alphapca57-unknown-linux-gnu
EV6 Series alphaev6-unknown-linux-gnu
EV67 Series alphaev67-unknown-linux-gnu
EV68 Series alphaev68-unknown-linux-gnu