Kevin Peng | 9dff986 | 2023-10-09 11:06:08 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2023, Arm Limited. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | /* |
| 9 | * NOTE: When GNU Arm compiler version greater equal than *11.3.Rel1*, there is a linker issue that |
| 10 | * some system calls are not implemented, such as _close, _fstat and _getpid etc. So add this file |
| 11 | * including stub functions of system calls to avoid the above linker issue. |
| 12 | */ |
| 13 | |
| 14 | #include <stddef.h> |
| 15 | #include <stdint.h> |
| 16 | |
| 17 | __attribute__((weak)) |
| 18 | void _close(void) |
| 19 | { |
| 20 | } |
| 21 | |
| 22 | __attribute__((weak)) |
| 23 | void _fstat(void) |
| 24 | { |
| 25 | } |
| 26 | |
| 27 | __attribute__((weak)) |
| 28 | void _getpid(void) |
| 29 | { |
| 30 | } |
| 31 | |
| 32 | __attribute__((weak)) |
| 33 | void _isatty(void) |
| 34 | { |
| 35 | } |
| 36 | |
| 37 | __attribute__((weak)) |
| 38 | void _kill(void) |
| 39 | { |
| 40 | } |
| 41 | |
| 42 | __attribute__((weak)) |
| 43 | void _lseek(void) |
| 44 | { |
| 45 | } |
| 46 | |
| 47 | __attribute__((weak)) |
| 48 | void _read(void) |
| 49 | { |
| 50 | } |
| 51 | |
| 52 | __attribute__((weak)) |
| 53 | void _write(void) |
| 54 | { |
| 55 | } |