Fix: CROSS_COMPILE env variable is ignored

The "arm-linux" deployments ignore the CROSS_COMPILE environment
variable which makes the build fail when the compiler is not on the
PATH.
This patch fixes this incorrect behavior and makes the "arm-linux" and
the "opteesp" deployments aligned on how the environment variable is
handled.
The policy is to prefer any value already in the cache. If the variable
is not in the cache, the value will be taken over from the
environment.

Change-Id: Id3cc4d6c23767d8ad9cb9657a582d6f70e191e37
Signed-off-by: Gyorgy Szing <Gyorgy.Szing@arm.com>
diff --git a/environments/arm-linux/default_toolchain_file.cmake b/environments/arm-linux/default_toolchain_file.cmake
index bc04fdd..5ad7801 100644
--- a/environments/arm-linux/default_toolchain_file.cmake
+++ b/environments/arm-linux/default_toolchain_file.cmake
@@ -1,10 +1,12 @@
 #-------------------------------------------------------------------------------
-# Copyright (c) 2020, Arm Limited and Contributors. All rights reserved.
+# Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
 #-------------------------------------------------------------------------------
-set(ENV{CROSS_COMPILE} "aarch64-linux-gnu-;aarch64-none-linux-gnu-")
+if(NOT CROSS_COMPILE AND NOT DEFINED ENV{CROSS_COMPILE})
+        set(CROSS_COMPILE "aarch64-elf-;aarch64-none-elf-;aarch64-linux-gnu-" CACHE STRING "List of GCC prefix triplets to use.")
+endif()
 
 set(CMAKE_CROSSCOMPILING True)
 set(CMAKE_SYSTEM_NAME Linux)