From 9596a94a8b05e16ead0d977a3f6ba0a812efb797 Mon Sep 17 00:00:00 2001 From: MurphyZhao Date: Thu, 11 Apr 2019 14:21:05 +0800 Subject: [PATCH 1/4] =?UTF-8?q?[compilers/newlib]=20=E5=9C=A8=20syscalls.c?= =?UTF-8?q?=20=E5=A2=9E=E5=8A=A0=20=5F=5Ferrno=20()=20=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=EF=BC=8C=E8=A7=A3=E5=86=B3=E5=9C=A8=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=20newlib=20=E7=BC=96=E8=AF=91=E6=97=B6=20errno=20?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E9=87=8D=E5=AE=9A=E5=90=91=E5=88=B0=20=5Frt?= =?UTF-8?q?=5Ferrno=20=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: MurphyZhao --- components/libc/compilers/newlib/syscalls.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/components/libc/compilers/newlib/syscalls.c b/components/libc/compilers/newlib/syscalls.c index 759feafe67..9919e11727 100644 --- a/components/libc/compilers/newlib/syscalls.c +++ b/components/libc/compilers/newlib/syscalls.c @@ -27,6 +27,14 @@ /* Reentrant versions of system calls. */ +#ifndef _REENT_ONLY +int * +__errno () +{ + return _rt_errno(); +} +#endif + int _close_r(struct _reent *ptr, int fd) { From 5885fc414f02fce4be55d26830aa95e7a460048c Mon Sep 17 00:00:00 2001 From: MurphyZhao Date: Thu, 11 Apr 2019 14:24:43 +0800 Subject: [PATCH 2/4] =?UTF-8?q?[include/libc]=20=E5=9C=A8=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=20ARMCC=20=E5=92=8C=20IAR=20=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=AF=B9=20errno.h=20=E7=9A=84=E5=BC=95?= =?UTF-8?q?=E5=85=A5=E3=80=82=E5=A6=82=E6=9E=9C=E5=BC=95=E5=85=A5=E4=BA=86?= =?UTF-8?q?=20errno.h=EF=BC=8Cerrno=20=E5=B0=B1=E4=B8=8D=E4=BC=9A=E8=A2=AB?= =?UTF-8?q?=E9=87=8D=E5=AE=9A=E5=90=91=E5=88=B0=20=5Frt=5Ferrno=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: MurphyZhao --- include/libc/libc_errno.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/libc/libc_errno.h b/include/libc/libc_errno.h index bb9a4dea2a..0f3bc7635a 100644 --- a/include/libc/libc_errno.h +++ b/include/libc/libc_errno.h @@ -13,7 +13,7 @@ #include -#if defined(RT_USING_NEWLIB) || defined(_WIN32) || defined(__CC_ARM) || defined(__IAR_SYSTEMS_ICC__) +#if defined(RT_USING_NEWLIB) || defined(_WIN32) /* use errno.h file in toolchains */ #include #endif From 81e028105d89db1f009c33483f5b9f1c8f7e2cf9 Mon Sep 17 00:00:00 2001 From: MurphyZhao Date: Thu, 11 Apr 2019 14:27:27 +0800 Subject: [PATCH 3/4] =?UTF-8?q?[components/net/lwip-1.4.1]=20=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E5=AF=B9=20errno.h=20=E7=9A=84=E5=BC=95=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: MurphyZhao --- components/net/lwip-1.4.1/src/arch/include/arch/cc.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/components/net/lwip-1.4.1/src/arch/include/arch/cc.h b/components/net/lwip-1.4.1/src/arch/include/arch/cc.h index e0ad8cf588..d85bf13441 100644 --- a/components/net/lwip-1.4.1/src/arch/include/arch/cc.h +++ b/components/net/lwip-1.4.1/src/arch/include/arch/cc.h @@ -55,10 +55,8 @@ typedef uintptr_t mem_ptr_t; #define X32_F "lx" #ifdef RT_USING_LIBC -#if defined(__CC_ARM) || defined(__IAR_SYSTEMS_ICC__) -#include -#else -#include +#if !defined(__CC_ARM) && !defined(__IAR_SYSTEMS_ICC__) + /* some errno not defined in newlib */ #define ENSRNOTFOUND 163 /* Domain name not found */ /* WARNING: ESHUTDOWN also not defined in newlib. We chose From 9be085aa0498e3a56945b60a2e9ba788096f3319 Mon Sep 17 00:00:00 2001 From: MurphyZhao Date: Thu, 11 Apr 2019 15:13:16 +0800 Subject: [PATCH 4/4] =?UTF-8?q?[components/net/lwip-1.4.1]=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E4=B8=8D=E5=BC=80=E5=90=AF=20RT=5FUSING=5FLIBC=20?= =?UTF-8?q?=E6=97=B6=20errno=20=E9=94=99=E8=AF=AF=E7=A0=81=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E5=AE=9A=E4=B9=89=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: MurphyZhao --- components/net/lwip-1.4.1/src/arch/include/arch/cc.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/components/net/lwip-1.4.1/src/arch/include/arch/cc.h b/components/net/lwip-1.4.1/src/arch/include/arch/cc.h index d85bf13441..06c0be6670 100644 --- a/components/net/lwip-1.4.1/src/arch/include/arch/cc.h +++ b/components/net/lwip-1.4.1/src/arch/include/arch/cc.h @@ -64,8 +64,6 @@ typedef uintptr_t mem_ptr_t; in arch.h has been assigned to another error code. */ #define ESHUTDOWN 180 #endif /* __CC_ARM/__IAR_SYSTEMS_ICC__ */ -#else -#define LWIP_PROVIDE_ERRNO #endif #if defined(RT_USING_LIBC) || defined(RT_USING_MINILIBC)