summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMeco Man <[email protected]>2021-09-25 13:03:23 -0400
committerMeco Man <[email protected]>2021-09-25 13:03:23 -0400
commitd4a5edf0747de4d1d0604ec8ef394efa6e1bb2c5 (patch)
tree02df68f144a8c169d35097ec3221de6bcd7b54cf
parentf4412c3abc6de3018f9f2358c706e6d2fd4e5114 (diff)
[libc]重构_libc_init_array 防止gcc下芯片无法启动
-rw-r--r--components/libc/compilers/newlib/minilib.c6
-rw-r--r--components/libc/compilers/newlib/syscalls.c1
2 files changed, 7 insertions, 0 deletions
diff --git a/components/libc/compilers/newlib/minilib.c b/components/libc/compilers/newlib/minilib.c
index 612554ca66..7aed3aa36e 100644
--- a/components/libc/compilers/newlib/minilib.c
+++ b/components/libc/compilers/newlib/minilib.c
@@ -64,3 +64,9 @@ void * _sbrk_r(struct _reent *ptr, ptrdiff_t incr)
return RT_NULL;
}
#endif /*RT_USING_HEAP*/
+
+void __libc_init_array(void)
+{
+ /* we not use __libc init_aray to initialize C++ objects */
+ /* __libc_init_array is ARM code, not Thumb; it will cause hardfault. */
+}
diff --git a/components/libc/compilers/newlib/syscalls.c b/components/libc/compilers/newlib/syscalls.c
index aeb4d123e7..b2258c3345 100644
--- a/components/libc/compilers/newlib/syscalls.c
+++ b/components/libc/compilers/newlib/syscalls.c
@@ -303,6 +303,7 @@ void _system(const char *s)
void __libc_init_array(void)
{
/* we not use __libc init_aray to initialize C++ objects */
+ /* __libc_init_array is ARM code, not Thumb; it will cause hardfault. */
}
mode_t umask(mode_t mask)