Build: Add support for GCC 7.3

Adds support for building TF-M with GCC 7.3, which is the version used
in GNU Arm Embedded Toolchain version 7-2018-q2-update.

Change-Id: I479ceb6ddf9a2c35089e6abc30af7aac1433401e
Signed-off-by: Jamie Fox <jamie.fox@arm.com>
diff --git a/cmake/Common/CompilerGNUARM73.cmake b/cmake/Common/CompilerGNUARM73.cmake
new file mode 100644
index 0000000..29b9555
--- /dev/null
+++ b/cmake/Common/CompilerGNUARM73.cmake
@@ -0,0 +1,63 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2018, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-------------------------------------------------------------------------------
+
+#This file contains settings to specify how GCC shall be used
+
+#Include some dependencies
+Include(Common/CompilerGNUARMCommon)
+Include(Common/Utils)
+
+check_gnuarm_input_vars("7.3")
+
+if(NOT DEFINED ARM_CPU_ARCHITECTURE)
+	set(_NO_ARM_CPU_ARCHITECTURE true)
+elseif (${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv8-M.BASE")
+	string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m.base")
+	string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m.base")
+	string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m.base")
+	string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m.base")
+elseif(${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv8-M.MAIN")
+	string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m.main")
+	string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m.main")
+	string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m.main")
+	string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m.main")
+elseif(${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv7-M")
+	string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-march=" VAL "-march=armv7-m")
+	string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-march=" VAL "-march=armv7-m")
+	string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "-march=" VAL "-march=armv7-m")
+	string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "-march=" VAL "-march=armv7-m")
+else()
+	message(FATAL_ERROR "Unknown or unsupported ARM cpu architecture setting.")
+endif()
+
+#Prefer architecture definition over cpu type.
+if(NOT DEFINED ARM_CPU_ARCHITECTURE)
+	if(NOT DEFINED ARM_CPU_TYPE)
+		string_append_unique_item(_NO_ARM_CPU_TYPE true)
+	elseif(${ARM_CPU_TYPE} STREQUAL "Cortex-M3")
+		string_append_unique_item (CMAKE_C_FLAGS_CPU "-mcpu=cortex-m3")
+		string_append_unique_item (CMAKE_CXX_FLAGS_CPU "-mcpu=cortex-m3")
+		string_append_unique_item (CMAKE_ASM_FLAGS_CPU "--cpu=Cortex-M3")
+		string_append_unique_item (CMAKE_LINK_FLAGS_CPU "--cpu=Cortex-M3")
+	elseif(${ARM_CPU_TYPE} STREQUAL "Cortex-M33")
+		string_append_unique_item (CMAKE_C_FLAGS_CPU "-mcpu=cortex-m33")
+		string_append_unique_item (CMAKE_CXX_FLAGS_CPU "-mcpu=cortex-m33")
+		string_append_unique_item (CMAKE_ASM_FLAGS_CPU "--cpu=Cortex-M33")
+		string_append_unique_item (CMAKE_LINK_FLAGS_CPU "--cpu=Cortex-M33")
+	elseif(${ARM_CPU_TYPE} STREQUAL "Cortex-M23")
+		string_append_unique_item (CMAKE_C_FLAGS_CPU "-mcpu=cortex-m23")
+		string_append_unique_item (CMAKE_CXX_FLAGS_CPU "-mcpu=cortex-m23")
+		string_append_unique_item (CMAKE_ASM_FLAGS_CPU "--cpu=Cortex-M23")
+		string_append_unique_item (CMAKE_LINK_FLAGS_CPU "--cpu=Cortex-M23")
+	else()
+		message(FATAL_ERROR "Unknown ARM cpu setting.")
+	endif()
+endif()
+
+if (_NO_ARM_CPU_TYPE AND _NO_ARM_CPU_ARCHITECTURE)
+	message(FATAL_ERROR "Cannot set CPU specific compiler flags: neither the ARM CPU type nor the architecture is set.")
+endif()
diff --git a/docs/user_guides/tfm_sw_requirement.md b/docs/user_guides/tfm_sw_requirement.md
index dfc1210..179052f 100755
--- a/docs/user_guides/tfm_sw_requirement.md
+++ b/docs/user_guides/tfm_sw_requirement.md
@@ -7,13 +7,15 @@
 - ARM Compiler v6.10
 - ARM Compiler v6.11
 - GNU Arm compiler v6.3.1
+- GNU Arm compiler v7.3
 
 *Note* The ARM compilers above are provided via Keil uVision v5.24.1 or greater,
 DS-5 v5.27.1 or greater, and Development Studio 2018.0, or they can be
 downloaded as standalone packages from [here](https://developer.arm.com/products/software-development-tools/compilers/arm-compiler/downloads/version-6).
 
 *Note* The GNU Arm compiler can be downloaded from [here](https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads).
-On the page select *GNU Arm Embedded Toolchain: 6-2017-q1-update*
+On the page select *GNU Arm Embedded Toolchain: 6-2017-q1-update* or *GNU Arm
+Embedded Toolchain: 7-2018-q2-update*
 
 *Note* In this version, you also need manually clone CMSIS_5 and mbedtls
 repositories at the same location where tfm repo is located.