Fix: Stop opteesp environment using default libc

The opteesp environment uses the libc implementation part of the
SPDEV-KIT. Projects targeting the opteesp environment shall be
configured to stop using the standard library and its header files
part of the compiler package.
This patch:
  - adds the missing compiler and linker options
  - adds header files missing from SPDEV-KITs libc implementation
  - extends the external component cmake files to align build options
    with the main project
  - moves environment specific mandatory flags to a common file
  - fixes the supported C standard from gnuc99 to c99

The following files where forked from TF-A
 (https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git; SHA: 7737fdf0ed):
- stdarg.h
- stdbool.h
- stddef.h
- stddef_.h

Signed-off-by: Andrew Beggs <andrew.beggs@arm.com>
Signed-off-by: Gyorgy Szing <Gyorgy.Szing@arm.com>
Change-Id: I3890453a29b003c60c8f44dfd19d553e96b1796c
diff --git a/deployments/env-test/env_test.cmake b/deployments/env-test/env_test.cmake
index 9c0926b..ee46eba 100644
--- a/deployments/env-test/env_test.cmake
+++ b/deployments/env-test/env_test.cmake
@@ -44,5 +44,8 @@
 #-------------------------------------------------------------------------------
 
 # Mbed TLS provides libmbedcrypto
+list(APPEND MBEDTLS_EXTRA_INCLUDES ${SP_DEV_KIT_INCLUDE_DIR})
+set(MBEDTLS_EXTRA_INCLUDES ${MBEDTLS_EXTRA_INCLUDES}
+	CACHE STRING "PSA ITS for Mbed TLS" FORCE)
 include(${TS_ROOT}/external/MbedTLS/MbedTLS.cmake)
 target_link_libraries(env-test PRIVATE mbedcrypto)
diff --git a/deployments/env-test/opteesp/CMakeLists.txt b/deployments/env-test/opteesp/CMakeLists.txt
index 044fae0..1ec681b 100644
--- a/deployments/env-test/opteesp/CMakeLists.txt
+++ b/deployments/env-test/opteesp/CMakeLists.txt
@@ -85,20 +85,15 @@
 if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
 	target_compile_options(env-test PRIVATE
 		-fdiagnostics-show-option
-		-fpic
 		-gdwarf-2
 		-mstrict-align
 		-O0
-		$<$<COMPILE_LANGUAGE:C>:-std=gnu99>
+		$<$<COMPILE_LANGUAGE:C>:-std=c99>
 		$<$<COMPILE_LANGUAGE:CXX>:-fno-use-cxa-atexit>
 	)
 
 	# Options for GCC that control linking
 	target_link_options(env-test PRIVATE
-		-e __sp_entry
-		-fno-lto
-		-nostdlib
-		-pie
 		-zmax-page-size=4096
 	)
 	# Options directly for LD, these are not understood by GCC