ARC: LIB: add ARC MWDT libc support
ARC MWDT toolchain doesn't provide newlib, let's add support of ARC MWDT libc to Zephyr Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
This commit is contained in:
parent
a53a706c9d
commit
e479d9aea0
4 changed files with 31 additions and 0 deletions
|
@ -2,6 +2,8 @@
|
|||
|
||||
if(CONFIG_NEWLIB_LIBC)
|
||||
add_subdirectory(newlib)
|
||||
elseif(CONFIG_ARCMWDT_LIBC)
|
||||
add_subdirectory(arcmwdt)
|
||||
else()
|
||||
add_subdirectory(minimal)
|
||||
endif()
|
||||
|
|
|
@ -31,6 +31,13 @@ config NEWLIB_LIBC
|
|||
Build with newlib library. The newlib library is expected to be
|
||||
part of the SDK in this case.
|
||||
|
||||
config ARCMWDT_LIBC
|
||||
bool "ARC MWDT C library"
|
||||
depends on !NATIVE_APPLICATION
|
||||
depends on "$(ZEPHYR_TOOLCHAIN_VARIANT)" = "arcmwdt"
|
||||
help
|
||||
C library provided by ARC MWDT toolchain.
|
||||
|
||||
config EXTERNAL_LIBC
|
||||
bool "External C library"
|
||||
help
|
||||
|
|
6
lib/libc/arcmwdt/CMakeLists.txt
Normal file
6
lib/libc/arcmwdt/CMakeLists.txt
Normal file
|
@ -0,0 +1,6 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
zephyr_library()
|
||||
zephyr_library_sources(
|
||||
arcmwdt-string.c
|
||||
)
|
16
lib/libc/arcmwdt/arcmwdt-string.c
Normal file
16
lib/libc/arcmwdt/arcmwdt-string.c
Normal file
|
@ -0,0 +1,16 @@
|
|||
/*
|
||||
* Copyright (c) 2021 Synopsys.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define __STDC_WANT_LIB_EXT1__ 1
|
||||
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
size_t strnlen(const char *s, size_t maxlen)
|
||||
{
|
||||
return strnlen_s(s, maxlen);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue