Xiang Xiao
4ae7f4c1f6
libs: Move libxx_impure.cxx from libs/libxx/ to libs/libc/misc/
...
to fix the gcov link error:
arm-none-eabi-ld: /home/xiaoxiang/vela/prebuilts/gcc/linux/arm/bin/../lib/gcc/arm-none-eabi/10.3.1/thumb/v7e-m/nofp/libgcov.a(_gcov.o): in function `gcov_error_exit':
libgcov-driver.c:(.text+0x7c): undefined reference to `_impure_ptr'
arm-none-eabi-ld: /home/xiaoxiang/vela/prebuilts/gcc/linux/arm/bin/../lib/gcc/arm-none-eabi/10.3.1/thumb/v7e-m/nofp/libgcov.a(_gcov.o): in function `get_gcov_error_file':
libgcov-driver.c:(.text+0x1e0): undefined reference to `_impure_ptr'
arm-none-eabi-ld: /home/xiaoxiang/vela/prebuilts/gcc/linux/arm/bin/../lib/gcc/arm-none-eabi/10.3.1/thumb/v7e-m/nofp/libgcov.a(_gcov.o): in function `gcov_exit_open_gcda_file.isra.0':
libgcov-driver.c:(.text+0x660): undefined reference to `_impure_ptr'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-06 14:43:57 -03:00
Xiang Xiao
1e0f3ba4da
libc: Remove C99_BOOL8 from libs/libxx/Kconfig
...
since it can be detected automatically by __STDC_VERSION__
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-05 16:23:32 -03:00
Xiang Xiao
577f301a2c
libc: Move cxx_initialize.c from libc/sched/ to libc/misc
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-04 08:58:43 +02:00
Xiang Xiao
b9eff677fe
libc: Simplify the c++ initialization
...
1.Remove CXX_INITIALIZE_MACHO and CXX_INITIALIZE_SINIT
2.Merge cxx_initialize_sinit.c and cxx_initialize_macho.c into cxx_initialize.c
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-04 08:58:43 +02:00
Xiang Xiao
c1082f04d3
libxx: Make HAVE_CXXINITIALIZE workable even HAVE_CXX isn't enabled
...
since this infrastructure is also used in no c++ case(e.g. gcov)
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-04 08:58:43 +02:00
Xiang Xiao
4a03cab6f9
libc: Remove the redundant seek in writev
...
since the file position isn't changed if write return fail
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-01 10:07:36 +03:00
Xiang Xiao
c1e5ba4602
libxx: Always build libcxx with -std=c++17
...
since the implementation of barrier require
the aligned new which is defined in C++ 17
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-29 21:08:14 -03:00
wangbowen6
dcb440a4d9
libc/arch_atomic: add FAR to pointers.
...
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-04-29 15:06:11 +08:00
wangbowen6
ea164f28b8
libc/arch_atomic: add gcc legacy __sync buitins support.
...
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-04-29 15:06:11 +08:00
YAMAMOTO Takashi
ded4fd33c1
Implement preadv and pwritev
2022-04-28 13:40:25 +08:00
YAMAMOTO Takashi
d832df88a5
libc.csv: sort
2022-04-28 13:40:25 +08:00
wangbowen6
cbab540169
arm/arch_setjmp.S: armv6m support setjmp, longjmp
...
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-04-27 23:21:03 +08:00
Xiang Xiao
f4d5a23571
libc/fixedmatch: Avoid "divide by zero" error
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-23 20:15:31 +03:00
Petro Karashchenko
8f7af29d74
libs/libc/string: unify implementation across the functions
...
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-04-23 23:58:54 +08:00
Oki Minabe
185b1cb1b7
libc/string: strcmp/strncmp cast unsigned char
...
Summary:
- Cast to unsigned char for strcmp and strncmp
- strcmp and strncmp are described following by opengroup.org
The sign of a non-zero return value shall be determined by the sign
of the difference between the values of the first pair of bytes
(both interpreted as type unsigned char) that differ in the strings
being compared.
https://pubs.opengroup.org/onlinepubs/9699919799/functions/strcmp.html
https://pubs.opengroup.org/onlinepubs/9699919799/functions/strncmp.html
Impact:
- strcmp and strncmp return value
Testing:
- ostest on sabre-6quad:smp w/ qemu
Signed-off-by: Oki Minabe <minabe.oki@gmail.com>
2022-04-23 16:11:00 +03:00
Xiang Xiao
69b5799b74
libc: Fix typo error in execle
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-22 12:23:09 +03:00
Xiang Xiao
55b5561fdb
sched/task: Implement execle and execve
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-22 10:40:31 +03:00
Alin Jerpelea
148c4903e3
LICENSE: document missing libc files
...
add missing files to the LICENSE file.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-04-20 21:05:45 +08:00
Xiang Xiao
5cb82dfcfb
libc/blkoutstream: Minor style fix
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-18 19:21:22 +03:00
chao.an
889a3bf7fc
libc/blockstream: add block out stream backend
...
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-04-18 19:21:22 +03:00
Xiang Xiao
96ff41d5b2
libc: Don't duplicate string in chdir and lib_restoredir
...
since the new layout doesn't reallocate the unchanged environ variable anymore
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-18 10:36:36 +03:00
Xiang Xiao
ef1a98dd00
Remove the unneeded void cast
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-17 23:32:05 +03:00
anjiahao
a66e8f20ee
libc/string:add LICENSE info
...
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-04-14 21:46:12 +08:00
haopengxiang
fa9ad9b398
libc/string:delete small to big endian marco
...
avoid byte alignment
Signed-off-by: haopengxiang <haopengxiang@xiaomi.com>
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-04-14 21:46:12 +08:00
chao.an
c3cefe6da2
libc/string: Use Byte-Shift algorithm for very long needles
...
Reference here:
https://github.com/taleinat/byteshift_strstr
Signed-off-by: chao.an <anchao@xiaomi.com>
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-04-14 21:46:12 +08:00
anjiahao
e6f77aeb9a
libc/lib_strptime:change code format & add notes
...
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-04-13 10:16:42 +08:00
Xiang Xiao
96ea9b71ed
libc/strptime: fix warning unused-value
...
warning: value computed is not used [-Wunused-value]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-04-13 10:16:42 +08:00
anjiahao
6d3f14d41d
libc/strptime:_conv_num skip space
...
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-04-13 10:16:42 +08:00
liuhaitao
366c25682c
libc/time: add strptime porting support
...
lib_strptime.c copies from android bionic/libc/tzcode.
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-04-13 10:16:42 +08:00
anjiahao
c843cb8a52
libc/net:use strlcpy instead of strncpy
...
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-04-12 21:16:11 +08:00
anjiahao
c30705f5f0
libc/lib_glob:use strlcpy instead of memcpy
...
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-04-12 21:15:45 +08:00
anjiahao
49cd445114
lib_localtime:fix unsigned compare with zero
...
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-04-12 17:10:14 +08:00
anjiahao
bb6279fe60
libc/lib_localtime:fix deadcode
...
isdst always is false
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-04-12 01:51:29 +08:00
songlinzhang
8dd5d0d510
netdb/lib_dnsaddserver.c: Do not insert the duplicate DNS address
...
Signed-off-by: songlinzhang <songlinzhang@xiaomi.com>
2022-04-11 20:31:15 +08:00
Jiuzhu Dong
e93100cb4d
lib_lib_vsprintf/backtrace: fix the type issue
...
using 't': For integer types, causes printf to expect
a ptrdiff_t-sized integer argument.
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-04-07 12:14:27 +08:00
Xiang Xiao
ae6bfdc9b9
libc: Avoid the compiler generate code call self(memcpy/memmove/memset/memcmp) recursively
...
please reference the similar change done by other libc implementation:
https://reviews.llvm.org/D68028?id=224286
85c2e6110c
4a1f55e92f
82dfae9ab0
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-05 13:25:53 +03:00
Xiang Xiao
34e17ba0ce
libc/string: Fix the minor style issue
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-05 13:25:53 +03:00
Petro Karashchenko
d08fbca679
nuttx: unify FAR attribute usage across the code
...
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-04-04 21:32:58 +08:00
Xiang Xiao
499c450d36
libc/netdb: Hold dns lock when operating with resolv.conf
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-04 19:48:36 +09:00
Xiang Xiao
cd695cd0d9
libc/netdb: Remove the temporary unlock in dns_foreach_nameserver
...
since netdb support the recursive lock
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-04 19:48:36 +09:00
Xiang Xiao
a8cac59864
libc/netdb: Support the recursive lock
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-04 19:48:36 +09:00
YAMAMOTO Takashi
75b1358d8e
modlib_bind.c: Restore "Relocation address out of range" checks
...
Restore the checks which got completely broken by the following change.
```
commit 15142a8b10
Author: anjiahao <anjiahao@xiaomi.com>
Date: Fri Apr 1 16:20:03 2022 +0800
modlib/modlib_bind:fix unsigned_compare with zero
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
```
2022-04-04 09:12:37 +03:00
anjiahao
5b214888aa
Update libs/libc/modlib/modlib_bind.c
...
Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-04-02 01:05:22 +08:00
anjiahao
c7badac601
Update libs/libc/modlib/modlib_bind.c
...
u are right
Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-04-02 01:05:22 +08:00
anjiahao
15142a8b10
modlib/modlib_bind:fix unsigned_compare with zero
...
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-04-02 01:05:22 +08:00
anjiahao
2d499ac86d
lib_chdir:use change ret judgment method
...
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-04-01 19:39:33 +03:00
anjiahao
14c5f61e77
libs/libc/lib_err.c:add va_end to vwarn
...
call va_copy,after need call va_end
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-04-01 23:13:25 +08:00
田昕
24bd80eb84
unistd:rename CONFIG_OPEN_MAX to CONFIG_LIBC_OPEN_MAX
...
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
2022-04-01 22:10:51 +08:00
田昕
463a437733
fs and unistd: increase OPEN_MAX by claiming a Kconfig.
...
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
2022-04-01 12:17:47 +03:00
Gustavo Henrique Nihei
0bd436c8db
libcxx: Fix libc++ for archs without conditional load/store support
...
This commit brings a patch already merged to upstream LLVM project:
https://reviews.llvm.org/D118391
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-03-30 11:19:29 +08:00