diff options
author | Anup Patel <anup.patel@wdc.com> | 2021-12-02 16:52:16 +0530 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2021-12-11 17:37:29 +0530 |
commit | d249d6544c3cbf6a817e2fac40b4be0e006ba965 (patch) | |
tree | c2923c89439daf4f3ddbde8a308ed857d036b499 /Makefile | |
parent | 69d7e536138ae71a24028ca849d401a4d64d564b (diff) |
lib: sbi: Fix compile errors using -Os option
When compiling with -Os option along with -ffreestanding, both GCC
and clang will add implicit calls to memcpy() and memset() for stack
variables initialized in declaration.
The C standard as per Clause 4, the compiler cannot necessarily
assume that anything beyond:
* float.h
* iso646.h
* limits.h
* stdalign.h
* stdarg.h
* stdbool.h
* stddef.h
* stdint.h
* stdnoreturn.h
* fenv.h
* math.h
* and the numeric conversion functions of stdlib.h.
This patch maps memcpy() and memset() as weak-alias of sbi_memcpy()
and sbi_memset() respectively so that implicit calls to memcpy()
and memset() will compile properly.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Dong Du <Dd_nirvana@sjtu.edu.cn>
Reviewed-by: Xiang W <wxjstz@126.com>
Diffstat (limited to 'Makefile')
0 files changed, 0 insertions, 0 deletions