From 237a71de278b16aa3df3e98f49714ef17cdf0c2b Mon Sep 17 00:00:00 2001 From: mysterywolf <920369182@qq.com> Date: Tue, 8 Sep 2020 10:26:03 +0800 Subject: 修复common文件夹,该文件夹为armlibc/newlib/dlib的共同文件的文件夹 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/libc/compilers/common/SConscript | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'components/libc/compilers/common/SConscript') diff --git a/components/libc/compilers/common/SConscript b/components/libc/compilers/common/SConscript index a8d2606820..7979e20944 100644 --- a/components/libc/compilers/common/SConscript +++ b/components/libc/compilers/common/SConscript @@ -13,7 +13,6 @@ else: if GetDepend('RT_LIBC_USING_TIME'): src += ['time.c'] -if (rtconfig.PLATFORM == 'armcc' or rtconfig.PLATFORM == 'iar') and rtconfig.ARCH != 'sim' : - group = DefineGroup('libc', src, depend = [''], CPPPATH = CPPPATH) +group = DefineGroup('libc', src, depend = [''], CPPPATH = CPPPATH) Return('group') -- cgit v1.3.1 From f021cb982a1add837755af2c513ab17605a55f2d Mon Sep 17 00:00:00 2001 From: mysterywolf <920369182@qq.com> Date: Tue, 8 Sep 2020 10:52:02 +0800 Subject: 修改common下的sconscript脚本文件,增加unistd.c排除条件 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/libc/compilers/common/SConscript | 3 +++ components/libc/compilers/common/unistd.c | 7 ++----- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'components/libc/compilers/common/SConscript') diff --git a/components/libc/compilers/common/SConscript b/components/libc/compilers/common/SConscript index 7979e20944..deadacb426 100644 --- a/components/libc/compilers/common/SConscript +++ b/components/libc/compilers/common/SConscript @@ -13,6 +13,9 @@ else: if GetDepend('RT_LIBC_USING_TIME'): src += ['time.c'] +if GetDepend('RT_USING_POSIX') == False: + SrcRemove(src, ['unistd.c']) + group = DefineGroup('libc', src, depend = [''], CPPPATH = CPPPATH) Return('group') diff --git a/components/libc/compilers/common/unistd.c b/components/libc/compilers/common/unistd.c index e2f2827beb..4068fc5cf5 100644 --- a/components/libc/compilers/common/unistd.c +++ b/components/libc/compilers/common/unistd.c @@ -8,12 +8,11 @@ * 2020-09-01 Meco Man First Version */ -#include #include -#ifdef RT_USING_POSIX - #ifdef RT_USING_POSIX_TERMIOS +#include + int isatty(int fd) { struct termios ts; @@ -25,5 +24,3 @@ char *ttyname(int fd) { return "/dev/tty0"; /*TODO: need to add more specific*/ } - -#endif -- cgit v1.3.1 From 0607ff84ab4cf9a8b6ed92ce17776bd852d9bc62 Mon Sep 17 00:00:00 2001 From: mysterywolf <920369182@qq.com> Date: Tue, 8 Sep 2020 11:12:56 +0800 Subject: 解决minilibc time.c和newlibc仅定义RT_LIBC_USING_TIME时冲突的问题 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/libc/compilers/common/SConscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'components/libc/compilers/common/SConscript') diff --git a/components/libc/compilers/common/SConscript b/components/libc/compilers/common/SConscript index deadacb426..718f05743c 100644 --- a/components/libc/compilers/common/SConscript +++ b/components/libc/compilers/common/SConscript @@ -10,7 +10,7 @@ CPPPATH = [cwd] if GetDepend('RT_USING_LIBC'): src += Glob('*.c') else: - if GetDepend('RT_LIBC_USING_TIME'): + if GetDepend('RT_LIBC_USING_TIME') and not GetDepend('RT_USING_MINILIBC'): src += ['time.c'] if GetDepend('RT_USING_POSIX') == False: -- cgit v1.3.1 From ff097f0467fb0041817846f2472343b7b9c098c4 Mon Sep 17 00:00:00 2001 From: mysterywolf <920369182@qq.com> Date: Tue, 8 Sep 2020 13:16:49 +0800 Subject: 增加 __GNUC__宏定义 和sconscript的平台识别以避免重复定义 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/libc/compilers/common/SConscript | 3 ++- components/libc/compilers/minilibc/SConscript | 2 +- include/libc/libc_errno.h | 4 ++-- include/libc/libc_fcntl.h | 2 +- include/libc/libc_fdset.h | 2 +- include/libc/libc_stat.h | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) (limited to 'components/libc/compilers/common/SConscript') diff --git a/components/libc/compilers/common/SConscript b/components/libc/compilers/common/SConscript index 718f05743c..a5f4a3fda6 100644 --- a/components/libc/compilers/common/SConscript +++ b/components/libc/compilers/common/SConscript @@ -16,6 +16,7 @@ else: if GetDepend('RT_USING_POSIX') == False: SrcRemove(src, ['unistd.c']) -group = DefineGroup('libc', src, depend = [''], CPPPATH = CPPPATH) +if not GetDepend('RT_USING_MINILIBC') and GetDepend('RT_USING_LIBC'): + group = DefineGroup('libc', src, depend = [''], CPPPATH = CPPPATH) Return('group') diff --git a/components/libc/compilers/minilibc/SConscript b/components/libc/compilers/minilibc/SConscript index 518d800571..dec657028f 100644 --- a/components/libc/compilers/minilibc/SConscript +++ b/components/libc/compilers/minilibc/SConscript @@ -8,7 +8,7 @@ group = [] CPPPATH = [cwd] CPPDEFINES = ['RT_USING_MINILIBC'] -if rtconfig.PLATFORM == 'gcc' and rtconfig.ARCH != 'sim' and not GetDepend('RT_USING_LIBC'): +if rtconfig.PLATFORM == 'gcc' and rtconfig.ARCH != 'sim' and not GetDepend('RT_USING_LIBC') and GetDepend('RT_USING_MINILIBC'): group = DefineGroup('libc', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES) diff --git a/include/libc/libc_errno.h b/include/libc/libc_errno.h index 0f3bc7635a..00c1f733d3 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) +#if defined(RT_USING_NEWLIB) || defined(_WIN32) || defined( __GNUC__ ) /* use errno.h file in toolchains */ #include #endif @@ -45,7 +45,7 @@ defined in armcc/errno.h #define ERROR_BASE_NO 0 #endif -#if !defined(RT_USING_NEWLIB) && !defined(_WIN32) +#if !defined(RT_USING_NEWLIB) && !defined(_WIN32) && !defined(__GNUC__ ) #define EPERM (ERROR_BASE_NO + 1) #define ENOENT (ERROR_BASE_NO + 2) diff --git a/include/libc/libc_fcntl.h b/include/libc/libc_fcntl.h index 385ac7cd9f..39740b7d85 100644 --- a/include/libc/libc_fcntl.h +++ b/include/libc/libc_fcntl.h @@ -12,7 +12,7 @@ #ifndef LIBC_FCNTL_H__ #define LIBC_FCNTL_H__ -#if defined(RT_USING_NEWLIB) || defined(_WIN32) +#if defined(RT_USING_NEWLIB) || defined(_WIN32) || defined( __GNUC__ ) #include #ifndef O_NONBLOCK diff --git a/include/libc/libc_fdset.h b/include/libc/libc_fdset.h index b4d2e2189a..4a778b51c1 100644 --- a/include/libc/libc_fdset.h +++ b/include/libc/libc_fdset.h @@ -13,7 +13,7 @@ #include -#if defined(RT_USING_NEWLIB) || defined(_WIN32) +#if defined(RT_USING_NEWLIB) || defined(_WIN32) || defined( __GNUC__ ) #include #if defined(HAVE_SYS_SELECT_H) #include diff --git a/include/libc/libc_stat.h b/include/libc/libc_stat.h index 9079d1ef15..9388688572 100644 --- a/include/libc/libc_stat.h +++ b/include/libc/libc_stat.h @@ -9,7 +9,7 @@ #include -#if defined(RT_USING_NEWLIB) +#if defined(RT_USING_NEWLIB) || defined( __GNUC__ ) /* use header file of newlib */ #include -- cgit v1.3.1 From 4305a678a38d65712d739f0d79bf55dc05e33073 Mon Sep 17 00:00:00 2001 From: mysterywolf <920369182@qq.com> Date: Tue, 8 Sep 2020 16:29:47 +0800 Subject: 修改common文件夹的sconscript 并 取消并恢复上一个commit的提交内容 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bsp/lpc408x/.config | 9 ++------- bsp/lpc408x/rtconfig.h | 3 +-- components/libc/compilers/common/SConscript | 2 +- 3 files changed, 4 insertions(+), 10 deletions(-) (limited to 'components/libc/compilers/common/SConscript') diff --git a/bsp/lpc408x/.config b/bsp/lpc408x/.config index c57e7eb755..b07e256c26 100644 --- a/bsp/lpc408x/.config +++ b/bsp/lpc408x/.config @@ -176,14 +176,9 @@ CONFIG_RT_USING_PIN=y # # POSIX layer and C standard library # -CONFIG_RT_USING_LIBC=y +# CONFIG_RT_USING_LIBC is not set # CONFIG_RT_USING_PTHREADS is not set -CONFIG_RT_USING_POSIX=y -# CONFIG_RT_USING_POSIX_MMAP is not set -# CONFIG_RT_USING_POSIX_TERMIOS is not set -# CONFIG_RT_USING_POSIX_GETLINE is not set -# CONFIG_RT_USING_POSIX_AIO is not set -# CONFIG_RT_USING_MODULE is not set +CONFIG_RT_LIBC_USING_TIME=y # # Network diff --git a/bsp/lpc408x/rtconfig.h b/bsp/lpc408x/rtconfig.h index d5e0c160be..25bba085a6 100644 --- a/bsp/lpc408x/rtconfig.h +++ b/bsp/lpc408x/rtconfig.h @@ -107,8 +107,7 @@ /* POSIX layer and C standard library */ -#define RT_USING_LIBC -#define RT_USING_POSIX +#define RT_LIBC_USING_TIME /* Network */ diff --git a/components/libc/compilers/common/SConscript b/components/libc/compilers/common/SConscript index a5f4a3fda6..18ff51d027 100644 --- a/components/libc/compilers/common/SConscript +++ b/components/libc/compilers/common/SConscript @@ -16,7 +16,7 @@ else: if GetDepend('RT_USING_POSIX') == False: SrcRemove(src, ['unistd.c']) -if not GetDepend('RT_USING_MINILIBC') and GetDepend('RT_USING_LIBC'): +if not GetDepend('RT_USING_MINILIBC') and (GetDepend('RT_USING_LIBC') or GetDepend('RT_LIBC_USING_TIME')): group = DefineGroup('libc', src, depend = [''], CPPPATH = CPPPATH) Return('group') -- cgit v1.3.1 From 28e0c99d0032111add7fadee7834043c332feb79 Mon Sep 17 00:00:00 2001 From: mysterywolf <920369182@qq.com> Date: Wed, 9 Sep 2020 00:53:53 +0800 Subject: Signed-off-by: mysterywolf --- components/libc/compilers/common/SConscript | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'components/libc/compilers/common/SConscript') diff --git a/components/libc/compilers/common/SConscript b/components/libc/compilers/common/SConscript index 18ff51d027..6c14b4e881 100644 --- a/components/libc/compilers/common/SConscript +++ b/components/libc/compilers/common/SConscript @@ -8,13 +8,13 @@ group = [] CPPPATH = [cwd] if GetDepend('RT_USING_LIBC'): - src += Glob('*.c') + src += Glob('*.c') + if GetDepend('RT_USING_POSIX') == False: + SrcRemove(src, ['unistd.c']) else: if GetDepend('RT_LIBC_USING_TIME') and not GetDepend('RT_USING_MINILIBC'): src += ['time.c'] -if GetDepend('RT_USING_POSIX') == False: - SrcRemove(src, ['unistd.c']) if not GetDepend('RT_USING_MINILIBC') and (GetDepend('RT_USING_LIBC') or GetDepend('RT_LIBC_USING_TIME')): group = DefineGroup('libc', src, depend = [''], CPPPATH = CPPPATH) -- cgit v1.3.1 From b3ab8a99e10f68042a3f2cba11e130004aa124e4 Mon Sep 17 00:00:00 2001 From: mysterywolf <920369182@qq.com> Date: Wed, 9 Sep 2020 08:59:39 +0800 Subject: Signed-off-by: mysterywolf --- components/libc/compilers/common/SConscript | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'components/libc/compilers/common/SConscript') diff --git a/components/libc/compilers/common/SConscript b/components/libc/compilers/common/SConscript index 6c14b4e881..2407301405 100644 --- a/components/libc/compilers/common/SConscript +++ b/components/libc/compilers/common/SConscript @@ -9,12 +9,12 @@ CPPPATH = [cwd] if GetDepend('RT_USING_LIBC'): src += Glob('*.c') - if GetDepend('RT_USING_POSIX') == False: - SrcRemove(src, ['unistd.c']) else: if GetDepend('RT_LIBC_USING_TIME') and not GetDepend('RT_USING_MINILIBC'): src += ['time.c'] +if GetDepend('RT_USING_POSIX') == False: + SrcRemove(src, ['unistd.c']) if not GetDepend('RT_USING_MINILIBC') and (GetDepend('RT_USING_LIBC') or GetDepend('RT_LIBC_USING_TIME')): group = DefineGroup('libc', src, depend = [''], CPPPATH = CPPPATH) -- cgit v1.3.1