BaseTools: Only check for GCC prefixes when targeting

LinuxGccToolChain is checking for the environment variable
GCC_AARCH64_PREFIX when GCC_AARCH64_INSTALL is set in the environment
variables. GCC_AARCH64_INSTALL is set when any gcc aarch64 compiler
is installed (i.e. aarch64-none-elf, aarch64-linux-gnu, aarch64-unknown-elf
all result in a GCC_AARCH64_INSTALL environment variable).

When compiling for an X86 target, if an AARCH64 tool chain is installed
in the system, this will result in an error due to the GCC_AARCH64_PREFIX
not being set.

Add a check based upon TARGET_ARCH and and only verify the prefixes
when attempting to build AARCH64.

Replicate the same check for RISCV and LOONGARCH64 architectures as well.

Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
1 file changed