Build: Build stub functions of system calls when required

Change-Id: I286bec82f63d97175d12e486330f62bea5a0c449
Signed-off-by: Kevin Peng <kevin.peng@arm.com>
diff --git a/app_broker/syscalls_stub.c b/app_broker/syscalls_stub.c
new file mode 100644
index 0000000..9ebe78e
--- /dev/null
+++ b/app_broker/syscalls_stub.c
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2023, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ */
+
+/*
+ * NOTE: When GNU Arm compiler version greater equal than *11.3.Rel1*, there is a linker issue that
+ * some system calls are not implemented, such as _close, _fstat and _getpid etc. So add this file
+ * including stub functions of system calls to avoid the above linker issue.
+ */
+
+#include <stddef.h>
+#include <stdint.h>
+
+__attribute__((weak))
+void _close(void)
+{
+}
+
+__attribute__((weak))
+void _fstat(void)
+{
+}
+
+__attribute__((weak))
+void _getpid(void)
+{
+}
+
+__attribute__((weak))
+void _isatty(void)
+{
+}
+
+__attribute__((weak))
+void _kill(void)
+{
+}
+
+__attribute__((weak))
+void _lseek(void)
+{
+}
+
+__attribute__((weak))
+void _read(void)
+{
+}
+
+__attribute__((weak))
+void _write(void)
+{
+}