summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2021-12-02 14:22:16 +0300
committerAnup Patel <anup@brainfault.org>2021-12-11 15:07:29 +0300
commitd249d6544c3cbf6a817e2fac40b4be0e006ba965 (patch)
treec2923c89439daf4f3ddbde8a308ed857d036b499 /platform
parent69d7e536138ae71a24028ca849d401a4d64d564b (diff)
downloadopensbi-d249d6544c3cbf6a817e2fac40b4be0e006ba965.tar.xz
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 'platform')
0 files changed, 0 insertions, 0 deletions