Platform: Simplify ARMCLANG - IAR compatibility

ARMCLANG defines a number of special symbols, not normally defined
by IAR (or GCC). The IAR linker has no facility to define these
symbols in the linker script, like the Gnu linker. These symbols used
to be defined on the command line to the compiler through CMake, but it
was causing issues where bash was needed to execute the commands and it
was impossible to define these symbols in the IDE. Defining them in
region.h instead solves this.

Signed-off-by: TTornblom <thomas.tornblom@iar.com>
Change-Id: Iaffe21ac530df3316b1bf71aad392262f9cf8017
diff --git a/CommonConfig.cmake b/CommonConfig.cmake
index cb5df6c..34e91c1 100644
--- a/CommonConfig.cmake
+++ b/CommonConfig.cmake
@@ -156,7 +156,7 @@
 	set (COMMON_COMPILE_FLAGS -e --dlib_config=full --vla --silent -DNO_TYPEOF --diag_suppress Pe546,Pe940,Pa082,Pa084)
 	##Shared compiler and linker settings.
 	function(config_setting_shared_compiler_flags tgt)
-		embedded_set_target_compile_flags(TARGET ${tgt} LANGUAGE C APPEND FLAGS ${COMMON_COMPILE_FLAGS} "-DImage$$= " "-DLoad$$LR$$= " "-D$$ZI$$Base=$$Base" "-D$$ZI$$Limit=$$Limit" "-D$$RO$$Base=$$Base" "-D$$RO$$Limit=$$Limit" "-D$$RW$$Base=$$Base" "-D$$RW$$Limit=$$Limit" "-D_DATA$$RW$$Base=_DATA$$Base" "-D_DATA$$RW$$Limit=_DATA$$Limit" "-D_DATA$$ZI$$Base=_DATA$$Base" "-D_DATA$$ZI$$Limit=_DATA$$Limit" "-D_STACK$$ZI$$Base=_STACK$$Base" "-D_STACK$$ZI$$Limit=_STACK$$Limit" )
+		embedded_set_target_compile_flags(TARGET ${tgt} LANGUAGE C APPEND FLAGS ${COMMON_COMPILE_FLAGS} )
 	endfunction()
 
 	##Shared linker settings.
diff --git a/docs/getting_started/tfm_build_instruction_iar.rst b/docs/getting_started/tfm_build_instruction_iar.rst
index 6f39539..a2c1846 100644
--- a/docs/getting_started/tfm_build_instruction_iar.rst
+++ b/docs/getting_started/tfm_build_instruction_iar.rst
@@ -14,8 +14,6 @@
     Currently the MUSCA_B1, MUSCA_S1 and SSE-200_AWS targets are not supported with IARARM,
     due to lack of testing. The FVP_SSE300_MPS2 target is currently not supported by IARARM.
 
-    bash needs to be installed and used by cmake for the build steps.
-
     cmake needs to be version 3.14 or newer.
 
     The V8M IAR CMSIS_5 RTX libraries in CMSIS_5 5.5.0 has a problem and has been updated in
diff --git a/platform/include/region.h b/platform/include/region.h
index c6ca921..00d88a0 100644
--- a/platform/include/region.h
+++ b/platform/include/region.h
@@ -14,4 +14,25 @@
 #define REGION_DECLARE(a, b, c) extern uint32_t REGION_NAME(a, b, c)
 #define REGION_DECLARE_T(a, b, c, t) extern t REGION_NAME(a, b, c)
 
+#ifdef __ICCARM__
+/*
+ * ARMCLANG - IAR linker compatibility
+ */
+#define Image$$
+#define Load$$LR$$
+#define $$ZI$$Base $$Base
+#define $$ZI$$Limit $$Limit
+#define $$RO$$Base $$Base
+#define $$RO$$Limit $$Limit
+#define $$RW$$Base $$Base
+#define $$RW$$Limit $$Limit
+#define _DATA$$RW$$Base _DATA$$Base
+#define _DATA$$RW$$Limit _DATA$$Limit
+#define _DATA$$ZI$$Base _DATA$$Base
+#define _DATA$$ZI$$Limit _DATA$$Limit
+#define _STACK$$ZI$$Base _STACK$$Base
+#define _STACK$$ZI$$Limit _STACK$$Limit
+
+#endif  /* __ICCARM__ */
+
 #endif  /* __REGION_H__ */