libc: minimal: Implement abort().
abort() is an important runtime function, oftentimes used to signal abnormal execution conditions in generic applications. Worse, they may be used under such circumstances in e.g. compiler support libraries, in which case lack of implementation of this function will lead to link error. Fixes: #29541 Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
This commit is contained in:
parent
687f799b7f
commit
565228516c
3 changed files with 16 additions and 0 deletions
|
@ -4,6 +4,7 @@ zephyr_system_include_directories(include)
|
||||||
|
|
||||||
zephyr_library()
|
zephyr_library()
|
||||||
zephyr_library_sources(
|
zephyr_library_sources(
|
||||||
|
source/stdlib/abort.c
|
||||||
source/stdlib/atoi.c
|
source/stdlib/atoi.c
|
||||||
source/stdlib/strtol.c
|
source/stdlib/strtol.c
|
||||||
source/stdlib/strtoul.c
|
source/stdlib/strtoul.c
|
||||||
|
|
|
@ -35,6 +35,7 @@ static inline void exit(int status)
|
||||||
{
|
{
|
||||||
_exit(status);
|
_exit(status);
|
||||||
}
|
}
|
||||||
|
void abort(void);
|
||||||
|
|
||||||
int rand(void);
|
int rand(void);
|
||||||
|
|
||||||
|
|
14
lib/libc/minimal/source/stdlib/abort.c
Normal file
14
lib/libc/minimal/source/stdlib/abort.c
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2020 Linaro Limited
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <zephyr.h>
|
||||||
|
|
||||||
|
void abort(void)
|
||||||
|
{
|
||||||
|
printk("abort()\n");
|
||||||
|
k_panic();
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue