From 9d401ea8b06518a49b59b6d246325afa5902e3f4 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Sun, 18 Apr 2021 00:51:07 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E9=87=8D=E6=96=B0=E6=95=B4=E7=90=86libc?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E5=85=B1=E7=94=A8=E6=96=87=E4=BB=B6=EF=BC=8C?= =?UTF-8?q?=E5=88=9B=E5=BB=BAcommon=5Ffor=5Fall=20=E5=92=8C=20common=5Ffor?= =?UTF-8?q?=5Fkeiliar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/libc/compilers/armlibc/dirent.h | 62 ------------------- components/libc/compilers/armlibc/sys/mman.h | 58 ----------------- .../{common => common_all}/SConscript | 0 .../{newlib/sys => common_all}/dirent.h | 0 .../{common => common_all}/readme.md | 0 .../compilers/{common => common_all}/stdlib.c | 0 .../{common => common_all}/sys/ioctl.h | 5 +- .../{newlib => common_all}/sys/mman.h | 2 + .../{newlib => common_all}/sys/statfs.h | 0 .../{newlib => common_all}/sys/termios.h | 0 .../{common => common_all}/sys/time.h | 0 .../{common => common_all}/termios.h | 0 .../compilers/{common => common_all}/time.c | 0 .../compilers/{common => common_all}/unistd.c | 0 .../compilers/common_except_gcc/SConscript | 13 ++++ .../{armlibc => common_except_gcc}/fcntl.h | 0 .../{armlibc => common_except_gcc}/sys/stat.h | 0 .../sys/types.h | 2 + .../sys/unistd.h | 0 .../{armlibc => common_except_gcc}/unistd.h | 0 components/libc/compilers/dlib/dirent.h | 62 ------------------- components/libc/compilers/dlib/fcntl.h | 8 --- components/libc/compilers/dlib/sys/mman.h | 58 ----------------- components/libc/compilers/dlib/sys/stat.h | 8 --- components/libc/compilers/dlib/sys/types.h | 33 ---------- components/libc/compilers/dlib/sys/unistd.h | 57 ----------------- components/libc/compilers/dlib/unistd.h | 14 ----- include/rtlibc.h | 5 -- 28 files changed, 21 insertions(+), 366 deletions(-) delete mode 100644 components/libc/compilers/armlibc/dirent.h delete mode 100644 components/libc/compilers/armlibc/sys/mman.h rename components/libc/compilers/{common => common_all}/SConscript (100%) rename components/libc/compilers/{newlib/sys => common_all}/dirent.h (100%) rename components/libc/compilers/{common => common_all}/readme.md (100%) rename components/libc/compilers/{common => common_all}/stdlib.c (100%) rename components/libc/compilers/{common => common_all}/sys/ioctl.h (77%) rename components/libc/compilers/{newlib => common_all}/sys/mman.h (97%) rename components/libc/compilers/{newlib => common_all}/sys/statfs.h (100%) rename components/libc/compilers/{newlib => common_all}/sys/termios.h (100%) rename components/libc/compilers/{common => common_all}/sys/time.h (100%) rename components/libc/compilers/{common => common_all}/termios.h (100%) rename components/libc/compilers/{common => common_all}/time.c (100%) rename components/libc/compilers/{common => common_all}/unistd.c (100%) create mode 100644 components/libc/compilers/common_except_gcc/SConscript rename components/libc/compilers/{armlibc => common_except_gcc}/fcntl.h (100%) rename components/libc/compilers/{armlibc => common_except_gcc}/sys/stat.h (100%) rename components/libc/compilers/{armlibc => common_except_gcc}/sys/types.h (94%) rename components/libc/compilers/{armlibc => common_except_gcc}/sys/unistd.h (100%) rename components/libc/compilers/{armlibc => common_except_gcc}/unistd.h (100%) delete mode 100644 components/libc/compilers/dlib/dirent.h delete mode 100644 components/libc/compilers/dlib/fcntl.h delete mode 100644 components/libc/compilers/dlib/sys/mman.h delete mode 100644 components/libc/compilers/dlib/sys/stat.h delete mode 100644 components/libc/compilers/dlib/sys/types.h delete mode 100644 components/libc/compilers/dlib/sys/unistd.h delete mode 100644 components/libc/compilers/dlib/unistd.h diff --git a/components/libc/compilers/armlibc/dirent.h b/components/libc/compilers/armlibc/dirent.h deleted file mode 100644 index 2c0521d2e3..0000000000 --- a/components/libc/compilers/armlibc/dirent.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2006-2021, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - */ -#ifndef __RTT_DIRENT_H__ -#define __RTT_DIRENT_H__ - -#include -#include - -/* -* dirent.h - format of directory entries - * Ref: http://www.opengroup.org/onlinepubs/009695399/basedefs/dirent.h.html - */ - -/* File types */ -#define FT_REGULAR 0 /* regular file */ -#define FT_SOCKET 1 /* socket file */ -#define FT_DIRECTORY 2 /* directory */ -#define FT_USER 3 /* user defined */ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef HAVE_DIR_STRUCTURE -typedef struct -{ - int fd; /* directory file */ - char buf[512]; - int num; - int cur; -} DIR; -#endif - -#ifndef HAVE_DIRENT_STRUCTURE -struct dirent -{ - rt_uint8_t d_type; /* The type of the file */ - rt_uint8_t d_namlen; /* The length of the not including the terminating null file name */ - rt_uint16_t d_reclen; /* length of this record */ - char d_name[256]; /* The null-terminated file name */ -}; -#endif - -int closedir(DIR *); -DIR *opendir(const char *); -struct dirent *readdir(DIR *); -int readdir_r(DIR *, struct dirent *, struct dirent **); -void rewinddir(DIR *); -void seekdir(DIR *, long int); -long telldir(DIR *); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/components/libc/compilers/armlibc/sys/mman.h b/components/libc/compilers/armlibc/sys/mman.h deleted file mode 100644 index 6a260ccd70..0000000000 --- a/components/libc/compilers/armlibc/sys/mman.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2006-2021, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2017/11/30 Bernard The first version. - */ - -#ifndef _SYS_MMAN_H -#define _SYS_MMAN_H - -#ifdef __cplusplus -extern "C" { -#endif - -#define MAP_FAILED ((void *) -1) - -#define MAP_SHARED 0x01 -#define MAP_PRIVATE 0x02 -#define MAP_TYPE 0x0f -#define MAP_FIXED 0x10 -#define MAP_ANON 0x20 -#define MAP_ANONYMOUS MAP_ANON -#define MAP_NORESERVE 0x4000 -#define MAP_GROWSDOWN 0x0100 -#define MAP_DENYWRITE 0x0800 -#define MAP_EXECUTABLE 0x1000 -#define MAP_LOCKED 0x2000 -#define MAP_POPULATE 0x8000 -#define MAP_NONBLOCK 0x10000 -#define MAP_STACK 0x20000 -#define MAP_HUGETLB 0x40000 -#define MAP_FILE 0 - -#define PROT_NONE 0 -#define PROT_READ 1 -#define PROT_WRITE 2 -#define PROT_EXEC 4 -#define PROT_GROWSDOWN 0x01000000 -#define PROT_GROWSUP 0x02000000 - -#define MS_ASYNC 1 -#define MS_INVALIDATE 2 -#define MS_SYNC 4 - -#define MCL_CURRENT 1 -#define MCL_FUTURE 2 -#define MCL_ONFAULT 4 - -void *mmap (void *start, size_t len, int prot, int flags, int fd, off_t off); -int munmap (void *start, size_t len); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/components/libc/compilers/common/SConscript b/components/libc/compilers/common_all/SConscript similarity index 100% rename from components/libc/compilers/common/SConscript rename to components/libc/compilers/common_all/SConscript diff --git a/components/libc/compilers/newlib/sys/dirent.h b/components/libc/compilers/common_all/dirent.h similarity index 100% rename from components/libc/compilers/newlib/sys/dirent.h rename to components/libc/compilers/common_all/dirent.h diff --git a/components/libc/compilers/common/readme.md b/components/libc/compilers/common_all/readme.md similarity index 100% rename from components/libc/compilers/common/readme.md rename to components/libc/compilers/common_all/readme.md diff --git a/components/libc/compilers/common/stdlib.c b/components/libc/compilers/common_all/stdlib.c similarity index 100% rename from components/libc/compilers/common/stdlib.c rename to components/libc/compilers/common_all/stdlib.c diff --git a/components/libc/compilers/common/sys/ioctl.h b/components/libc/compilers/common_all/sys/ioctl.h similarity index 77% rename from components/libc/compilers/common/sys/ioctl.h rename to components/libc/compilers/common_all/sys/ioctl.h index df17b19a61..648d90230d 100644 --- a/components/libc/compilers/common/sys/ioctl.h +++ b/components/libc/compilers/common_all/sys/ioctl.h @@ -10,6 +10,9 @@ #ifndef _SYS_IOCTL_H #define _SYS_IOCTL_H - +#include +#ifdef RT_USING_POSIX +#include +#endif #endif diff --git a/components/libc/compilers/newlib/sys/mman.h b/components/libc/compilers/common_all/sys/mman.h similarity index 97% rename from components/libc/compilers/newlib/sys/mman.h rename to components/libc/compilers/common_all/sys/mman.h index 6a260ccd70..a9235d61f0 100644 --- a/components/libc/compilers/newlib/sys/mman.h +++ b/components/libc/compilers/common_all/sys/mman.h @@ -15,6 +15,8 @@ extern "C" { #endif +#include + #define MAP_FAILED ((void *) -1) #define MAP_SHARED 0x01 diff --git a/components/libc/compilers/newlib/sys/statfs.h b/components/libc/compilers/common_all/sys/statfs.h similarity index 100% rename from components/libc/compilers/newlib/sys/statfs.h rename to components/libc/compilers/common_all/sys/statfs.h diff --git a/components/libc/compilers/newlib/sys/termios.h b/components/libc/compilers/common_all/sys/termios.h similarity index 100% rename from components/libc/compilers/newlib/sys/termios.h rename to components/libc/compilers/common_all/sys/termios.h diff --git a/components/libc/compilers/common/sys/time.h b/components/libc/compilers/common_all/sys/time.h similarity index 100% rename from components/libc/compilers/common/sys/time.h rename to components/libc/compilers/common_all/sys/time.h diff --git a/components/libc/compilers/common/termios.h b/components/libc/compilers/common_all/termios.h similarity index 100% rename from components/libc/compilers/common/termios.h rename to components/libc/compilers/common_all/termios.h diff --git a/components/libc/compilers/common/time.c b/components/libc/compilers/common_all/time.c similarity index 100% rename from components/libc/compilers/common/time.c rename to components/libc/compilers/common_all/time.c diff --git a/components/libc/compilers/common/unistd.c b/components/libc/compilers/common_all/unistd.c similarity index 100% rename from components/libc/compilers/common/unistd.c rename to components/libc/compilers/common_all/unistd.c diff --git a/components/libc/compilers/common_except_gcc/SConscript b/components/libc/compilers/common_except_gcc/SConscript new file mode 100644 index 0000000000..bda0d5610f --- /dev/null +++ b/components/libc/compilers/common_except_gcc/SConscript @@ -0,0 +1,13 @@ +from building import * + +Import('rtconfig') + +if rtconfig.PLATFORM == 'iar' or rtconfig.PLATFORM == 'armcc' or rtconfig.PLATFORM == 'armclang': + src = [] + cwd = GetCurrentDir() + CPPPATH = [cwd] + group = [] + src += Glob('*.c') + + group = DefineGroup('libc', src, depend = ['RT_USING_LIBC'], CPPPATH = CPPPATH) + Return('group') diff --git a/components/libc/compilers/armlibc/fcntl.h b/components/libc/compilers/common_except_gcc/fcntl.h similarity index 100% rename from components/libc/compilers/armlibc/fcntl.h rename to components/libc/compilers/common_except_gcc/fcntl.h diff --git a/components/libc/compilers/armlibc/sys/stat.h b/components/libc/compilers/common_except_gcc/sys/stat.h similarity index 100% rename from components/libc/compilers/armlibc/sys/stat.h rename to components/libc/compilers/common_except_gcc/sys/stat.h diff --git a/components/libc/compilers/armlibc/sys/types.h b/components/libc/compilers/common_except_gcc/sys/types.h similarity index 94% rename from components/libc/compilers/armlibc/sys/types.h rename to components/libc/compilers/common_except_gcc/sys/types.h index a6b245b81c..7222326a2a 100644 --- a/components/libc/compilers/armlibc/sys/types.h +++ b/components/libc/compilers/common_except_gcc/sys/types.h @@ -18,6 +18,8 @@ typedef int32_t key_t; /* Used for interprocess communication. typedef int pid_t; /* Used for process IDs and process group IDs. */ typedef unsigned short uid_t; typedef unsigned short gid_t; +typedef signed long off_t; +typedef int mode_t; #ifndef ARCH_CPU_64BIT typedef signed int ssize_t; /* Used for a count of bytes or an error indication. */ #else diff --git a/components/libc/compilers/armlibc/sys/unistd.h b/components/libc/compilers/common_except_gcc/sys/unistd.h similarity index 100% rename from components/libc/compilers/armlibc/sys/unistd.h rename to components/libc/compilers/common_except_gcc/sys/unistd.h diff --git a/components/libc/compilers/armlibc/unistd.h b/components/libc/compilers/common_except_gcc/unistd.h similarity index 100% rename from components/libc/compilers/armlibc/unistd.h rename to components/libc/compilers/common_except_gcc/unistd.h diff --git a/components/libc/compilers/dlib/dirent.h b/components/libc/compilers/dlib/dirent.h deleted file mode 100644 index 2c0521d2e3..0000000000 --- a/components/libc/compilers/dlib/dirent.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2006-2021, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - */ -#ifndef __RTT_DIRENT_H__ -#define __RTT_DIRENT_H__ - -#include -#include - -/* -* dirent.h - format of directory entries - * Ref: http://www.opengroup.org/onlinepubs/009695399/basedefs/dirent.h.html - */ - -/* File types */ -#define FT_REGULAR 0 /* regular file */ -#define FT_SOCKET 1 /* socket file */ -#define FT_DIRECTORY 2 /* directory */ -#define FT_USER 3 /* user defined */ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef HAVE_DIR_STRUCTURE -typedef struct -{ - int fd; /* directory file */ - char buf[512]; - int num; - int cur; -} DIR; -#endif - -#ifndef HAVE_DIRENT_STRUCTURE -struct dirent -{ - rt_uint8_t d_type; /* The type of the file */ - rt_uint8_t d_namlen; /* The length of the not including the terminating null file name */ - rt_uint16_t d_reclen; /* length of this record */ - char d_name[256]; /* The null-terminated file name */ -}; -#endif - -int closedir(DIR *); -DIR *opendir(const char *); -struct dirent *readdir(DIR *); -int readdir_r(DIR *, struct dirent *, struct dirent **); -void rewinddir(DIR *); -void seekdir(DIR *, long int); -long telldir(DIR *); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/components/libc/compilers/dlib/fcntl.h b/components/libc/compilers/dlib/fcntl.h deleted file mode 100644 index c4b42083c4..0000000000 --- a/components/libc/compilers/dlib/fcntl.h +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright (c) 2006-2021, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - */ diff --git a/components/libc/compilers/dlib/sys/mman.h b/components/libc/compilers/dlib/sys/mman.h deleted file mode 100644 index 6a260ccd70..0000000000 --- a/components/libc/compilers/dlib/sys/mman.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2006-2021, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2017/11/30 Bernard The first version. - */ - -#ifndef _SYS_MMAN_H -#define _SYS_MMAN_H - -#ifdef __cplusplus -extern "C" { -#endif - -#define MAP_FAILED ((void *) -1) - -#define MAP_SHARED 0x01 -#define MAP_PRIVATE 0x02 -#define MAP_TYPE 0x0f -#define MAP_FIXED 0x10 -#define MAP_ANON 0x20 -#define MAP_ANONYMOUS MAP_ANON -#define MAP_NORESERVE 0x4000 -#define MAP_GROWSDOWN 0x0100 -#define MAP_DENYWRITE 0x0800 -#define MAP_EXECUTABLE 0x1000 -#define MAP_LOCKED 0x2000 -#define MAP_POPULATE 0x8000 -#define MAP_NONBLOCK 0x10000 -#define MAP_STACK 0x20000 -#define MAP_HUGETLB 0x40000 -#define MAP_FILE 0 - -#define PROT_NONE 0 -#define PROT_READ 1 -#define PROT_WRITE 2 -#define PROT_EXEC 4 -#define PROT_GROWSDOWN 0x01000000 -#define PROT_GROWSUP 0x02000000 - -#define MS_ASYNC 1 -#define MS_INVALIDATE 2 -#define MS_SYNC 4 - -#define MCL_CURRENT 1 -#define MCL_FUTURE 2 -#define MCL_ONFAULT 4 - -void *mmap (void *start, size_t len, int prot, int flags, int fd, off_t off); -int munmap (void *start, size_t len); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/components/libc/compilers/dlib/sys/stat.h b/components/libc/compilers/dlib/sys/stat.h deleted file mode 100644 index c4b42083c4..0000000000 --- a/components/libc/compilers/dlib/sys/stat.h +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright (c) 2006-2021, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - */ diff --git a/components/libc/compilers/dlib/sys/types.h b/components/libc/compilers/dlib/sys/types.h deleted file mode 100644 index 6e2d1ce839..0000000000 --- a/components/libc/compilers/dlib/sys/types.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2006-2021, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2020-12-16 Meco Man add useconds_t - */ -#ifndef __TYPES_H__ -#define __TYPES_H__ - -#include - -typedef int32_t clockid_t; -typedef int32_t key_t; /* Used for interprocess communication. */ -typedef int pid_t; /* Used for process IDs and process group IDs. */ -typedef unsigned short uid_t; -typedef unsigned short gid_t; -#ifndef ARCH_CPU_64BIT -typedef signed int ssize_t; /* Used for a count of bytes or an error indication. */ -#else -typedef long signed int ssize_t; /* Used for a count of bytes or an error indication. */ -#endif -typedef unsigned long useconds_t; /* microseconds (unsigned) */ - -typedef unsigned long dev_t; - -typedef unsigned int u_int; -typedef unsigned char u_char; -typedef unsigned long u_long; - -#endif diff --git a/components/libc/compilers/dlib/sys/unistd.h b/components/libc/compilers/dlib/sys/unistd.h deleted file mode 100644 index 14966a2bad..0000000000 --- a/components/libc/compilers/dlib/sys/unistd.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2006-2021, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2020-12-16 Meco Man add usleep - */ -#ifndef _SYS_UNISTD_H -#define _SYS_UNISTD_H - -#include -#include "types.h" - -#ifdef RT_USING_DFS - -#define STDIN_FILENO 0 /* standard input file descriptor */ -#define STDOUT_FILENO 1 /* standard output file descriptor */ -#define STDERR_FILENO 2 /* standard error file descriptor */ - -#include -#else -#define _FREAD 0x0001 /* read enabled */ -#define _FWRITE 0x0002 /* write enabled */ -#define _FAPPEND 0x0008 /* append (writes guaranteed at the end) */ -#define _FMARK 0x0010 /* internal; mark during gc() */ -#define _FDEFER 0x0020 /* internal; defer for next gc pass */ -#define _FASYNC 0x0040 /* signal pgrp when data ready */ -#define _FSHLOCK 0x0080 /* BSD flock() shared lock present */ -#define _FEXLOCK 0x0100 /* BSD flock() exclusive lock present */ -#define _FCREAT 0x0200 /* open with file create */ -#define _FTRUNC 0x0400 /* open with truncation */ -#define _FEXCL 0x0800 /* error on open if file exists */ -#define _FNBIO 0x1000 /* non blocking I/O (sys5 style) */ -#define _FSYNC 0x2000 /* do all writes synchronously */ -#define _FNONBLOCK 0x4000 /* non blocking I/O (POSIX style) */ -#define _FNDELAY _FNONBLOCK /* non blocking I/O (4.2 style) */ -#define _FNOCTTY 0x8000 /* don't assign a ctty on this open */ - -#endif - - -int isatty (int fd); -char * ttyname (int desc); - -unsigned int sleep(unsigned int seconds); -int usleep(useconds_t usec); - -pid_t getpid(void); -pid_t getppid(void); -uid_t getuid(void); -uid_t geteuid(void); -gid_t getgid(void); -gid_t getegid(void); - -#endif /* _SYS_UNISTD_H */ diff --git a/components/libc/compilers/dlib/unistd.h b/components/libc/compilers/dlib/unistd.h deleted file mode 100644 index 72b9d538ec..0000000000 --- a/components/libc/compilers/dlib/unistd.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) 2006-2021, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - */ -#ifndef _UNISTD_H_ -#define _UNISTD_H_ - -# include "sys/unistd.h" - -#endif /* _UNISTD_H_ */ diff --git a/include/rtlibc.h b/include/rtlibc.h index 5a260d250d..6f6777a2f3 100644 --- a/include/rtlibc.h +++ b/include/rtlibc.h @@ -23,11 +23,6 @@ #include "libc/libc_limits.h" #include "libc/libc_stdio.h" -#if defined(__CC_ARM) || defined(__CLANG_ARM) || defined(__IAR_SYSTEMS_ICC__) -typedef signed long off_t; -typedef int mode_t; -#endif - #if defined(__MINGW32__) || defined(_WIN32) typedef signed long off_t; typedef int mode_t; From bc25c8a6e87e0f070152985eda47a3648390881f Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Sun, 18 Apr 2021 00:55:32 +0800 Subject: [PATCH 2/8] update sconscript --- .../libc/compilers/common_except_gcc/SConscript | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/components/libc/compilers/common_except_gcc/SConscript b/components/libc/compilers/common_except_gcc/SConscript index bda0d5610f..346e69b478 100644 --- a/components/libc/compilers/common_except_gcc/SConscript +++ b/components/libc/compilers/common_except_gcc/SConscript @@ -2,12 +2,12 @@ from building import * Import('rtconfig') -if rtconfig.PLATFORM == 'iar' or rtconfig.PLATFORM == 'armcc' or rtconfig.PLATFORM == 'armclang': - src = [] - cwd = GetCurrentDir() - CPPPATH = [cwd] - group = [] - src += Glob('*.c') +src = [] +cwd = GetCurrentDir() +CPPPATH = [cwd] +group = [] +src += Glob('*.c') +if rtconfig.PLATFORM != 'gcc': group = DefineGroup('libc', src, depend = ['RT_USING_LIBC'], CPPPATH = CPPPATH) - Return('group') +Return('group') From 6026c68d372e8e272aaa3186ae0cb24237a3a0d8 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Sun, 18 Apr 2021 01:00:37 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E5=A3=B0?= =?UTF-8?q?=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/dfs/include/dfs_fs.h | 1 + 1 file changed, 1 insertion(+) diff --git a/components/dfs/include/dfs_fs.h b/components/dfs/include/dfs_fs.h index 8dc93f9599..ed0600f1f7 100644 --- a/components/dfs/include/dfs_fs.h +++ b/components/dfs/include/dfs_fs.h @@ -12,6 +12,7 @@ #define __DFS_FS_H__ #include +#include #ifdef __cplusplus extern "C" { From 926cd865892cfbb9b474d36cfd046688d92ecc37 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Sun, 18 Apr 2021 01:36:35 +0800 Subject: [PATCH 4/8] remove dlib and armlibc sys folder --- components/libc/compilers/armlibc/sys/README.md | 1 - components/libc/compilers/armlibc/sys/errno.h | 14 -------------- .../libc/compilers/common_except_gcc/readme.md | 3 +++ components/libc/compilers/dlib/sys/README.md | 1 - components/libc/compilers/dlib/sys/errno.h | 16 ---------------- components/libc/compilers/dlib/sys/signal.h | 16 ---------------- 6 files changed, 3 insertions(+), 48 deletions(-) delete mode 100644 components/libc/compilers/armlibc/sys/README.md delete mode 100644 components/libc/compilers/armlibc/sys/errno.h create mode 100644 components/libc/compilers/common_except_gcc/readme.md delete mode 100644 components/libc/compilers/dlib/sys/README.md delete mode 100644 components/libc/compilers/dlib/sys/errno.h delete mode 100644 components/libc/compilers/dlib/sys/signal.h diff --git a/components/libc/compilers/armlibc/sys/README.md b/components/libc/compilers/armlibc/sys/README.md deleted file mode 100644 index 7ad10a7d43..0000000000 --- a/components/libc/compilers/armlibc/sys/README.md +++ /dev/null @@ -1 +0,0 @@ -Because Keil MDK leaks some system header file, we put them in here. \ No newline at end of file diff --git a/components/libc/compilers/armlibc/sys/errno.h b/components/libc/compilers/armlibc/sys/errno.h deleted file mode 100644 index 74cc986f7c..0000000000 --- a/components/libc/compilers/armlibc/sys/errno.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) 2006-2021, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - */ -#ifndef SYS_ERRNO_H__ -#define SYS_ERRNO_H__ - -#include - -#endif diff --git a/components/libc/compilers/common_except_gcc/readme.md b/components/libc/compilers/common_except_gcc/readme.md new file mode 100644 index 0000000000..15f8e60d59 --- /dev/null +++ b/components/libc/compilers/common_except_gcc/readme.md @@ -0,0 +1,3 @@ +## Attentions + +This folder is "common" for armlibc and dlib. \ No newline at end of file diff --git a/components/libc/compilers/dlib/sys/README.md b/components/libc/compilers/dlib/sys/README.md deleted file mode 100644 index 4f0d203180..0000000000 --- a/components/libc/compilers/dlib/sys/README.md +++ /dev/null @@ -1 +0,0 @@ -Because IAR leaks some system header file, we put them in here. \ No newline at end of file diff --git a/components/libc/compilers/dlib/sys/errno.h b/components/libc/compilers/dlib/sys/errno.h deleted file mode 100644 index 54a1d33cd0..0000000000 --- a/components/libc/compilers/dlib/sys/errno.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2006-2021, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2019-07-08 Bernard The first version - */ - -#ifndef SYS_ERRNO_H__ -#define SYS_ERRNO_H__ - -#include - -#endif diff --git a/components/libc/compilers/dlib/sys/signal.h b/components/libc/compilers/dlib/sys/signal.h deleted file mode 100644 index a30235f2b2..0000000000 --- a/components/libc/compilers/dlib/sys/signal.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2006-2021, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2019-07-08 Bernard The first version - */ - -#ifndef SYS_SIGNAL_H__ -#define SYS_SIGNAL_H__ - -#include - -#endif From 40c09fc1e088e1f7a9eb91c85bd30119d4a38822 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Wed, 21 Apr 2021 00:56:36 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E9=87=8D=E6=96=B0=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E4=B8=BAcommon=E6=96=87=E4=BB=B6=E5=A4=B9=E4=B8=8B=E5=B1=9Eall?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=A4=B9=E5=92=8Cexcgcc=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=A4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/dfs/include/dfs_fs.h | 2 ++ components/libc/compilers/common/SConscript | 15 +++++++++++++++ .../{common_all => common/all}/SConscript | 0 .../compilers/{common_all => common/all}/dirent.h | 0 .../{common_all => common/all}/readme.md | 0 .../compilers/{common_all => common/all}/stdlib.c | 0 .../{common_all => common/all}/sys/ioctl.h | 0 .../{common_all => common/all}/sys/mman.h | 0 .../{common_all => common/all}/sys/statfs.h | 0 .../{common_all => common/all}/sys/termios.h | 0 .../{common_all => common/all}/sys/time.h | 0 .../{common_all => common/all}/termios.h | 0 .../compilers/{common_all => common/all}/time.c | 0 .../compilers/{common_all => common/all}/unistd.c | 0 .../excgcc}/SConscript | 0 .../{common_except_gcc => common/excgcc}/fcntl.h | 0 .../excgcc}/readme.md | 0 .../excgcc}/sys/stat.h | 0 .../excgcc}/sys/types.h | 0 .../excgcc}/sys/unistd.h | 0 .../{common_except_gcc => common/excgcc}/unistd.h | 0 include/rtlibc.h | 7 +++++++ 22 files changed, 24 insertions(+) create mode 100644 components/libc/compilers/common/SConscript rename components/libc/compilers/{common_all => common/all}/SConscript (100%) rename components/libc/compilers/{common_all => common/all}/dirent.h (100%) rename components/libc/compilers/{common_all => common/all}/readme.md (100%) rename components/libc/compilers/{common_all => common/all}/stdlib.c (100%) rename components/libc/compilers/{common_all => common/all}/sys/ioctl.h (100%) rename components/libc/compilers/{common_all => common/all}/sys/mman.h (100%) rename components/libc/compilers/{common_all => common/all}/sys/statfs.h (100%) rename components/libc/compilers/{common_all => common/all}/sys/termios.h (100%) rename components/libc/compilers/{common_all => common/all}/sys/time.h (100%) rename components/libc/compilers/{common_all => common/all}/termios.h (100%) rename components/libc/compilers/{common_all => common/all}/time.c (100%) rename components/libc/compilers/{common_all => common/all}/unistd.c (100%) rename components/libc/compilers/{common_except_gcc => common/excgcc}/SConscript (100%) rename components/libc/compilers/{common_except_gcc => common/excgcc}/fcntl.h (100%) rename components/libc/compilers/{common_except_gcc => common/excgcc}/readme.md (100%) rename components/libc/compilers/{common_except_gcc => common/excgcc}/sys/stat.h (100%) rename components/libc/compilers/{common_except_gcc => common/excgcc}/sys/types.h (100%) rename components/libc/compilers/{common_except_gcc => common/excgcc}/sys/unistd.h (100%) rename components/libc/compilers/{common_except_gcc => common/excgcc}/unistd.h (100%) diff --git a/components/dfs/include/dfs_fs.h b/components/dfs/include/dfs_fs.h index ed0600f1f7..828f15a0f5 100644 --- a/components/dfs/include/dfs_fs.h +++ b/components/dfs/include/dfs_fs.h @@ -12,7 +12,9 @@ #define __DFS_FS_H__ #include +#ifdef RT_USING_LIBC #include +#endif #ifdef __cplusplus extern "C" { diff --git a/components/libc/compilers/common/SConscript b/components/libc/compilers/common/SConscript new file mode 100644 index 0000000000..4c815c49b8 --- /dev/null +++ b/components/libc/compilers/common/SConscript @@ -0,0 +1,15 @@ +# RT-Thread building script for bridge + +import os +from building import * + +cwd = GetCurrentDir() +objs = [] +list = os.listdir(cwd) + +for d in list: + path = os.path.join(cwd, d) + if os.path.isfile(os.path.join(path, 'SConscript')): + objs = objs + SConscript(os.path.join(d, 'SConscript')) + +Return('objs') diff --git a/components/libc/compilers/common_all/SConscript b/components/libc/compilers/common/all/SConscript similarity index 100% rename from components/libc/compilers/common_all/SConscript rename to components/libc/compilers/common/all/SConscript diff --git a/components/libc/compilers/common_all/dirent.h b/components/libc/compilers/common/all/dirent.h similarity index 100% rename from components/libc/compilers/common_all/dirent.h rename to components/libc/compilers/common/all/dirent.h diff --git a/components/libc/compilers/common_all/readme.md b/components/libc/compilers/common/all/readme.md similarity index 100% rename from components/libc/compilers/common_all/readme.md rename to components/libc/compilers/common/all/readme.md diff --git a/components/libc/compilers/common_all/stdlib.c b/components/libc/compilers/common/all/stdlib.c similarity index 100% rename from components/libc/compilers/common_all/stdlib.c rename to components/libc/compilers/common/all/stdlib.c diff --git a/components/libc/compilers/common_all/sys/ioctl.h b/components/libc/compilers/common/all/sys/ioctl.h similarity index 100% rename from components/libc/compilers/common_all/sys/ioctl.h rename to components/libc/compilers/common/all/sys/ioctl.h diff --git a/components/libc/compilers/common_all/sys/mman.h b/components/libc/compilers/common/all/sys/mman.h similarity index 100% rename from components/libc/compilers/common_all/sys/mman.h rename to components/libc/compilers/common/all/sys/mman.h diff --git a/components/libc/compilers/common_all/sys/statfs.h b/components/libc/compilers/common/all/sys/statfs.h similarity index 100% rename from components/libc/compilers/common_all/sys/statfs.h rename to components/libc/compilers/common/all/sys/statfs.h diff --git a/components/libc/compilers/common_all/sys/termios.h b/components/libc/compilers/common/all/sys/termios.h similarity index 100% rename from components/libc/compilers/common_all/sys/termios.h rename to components/libc/compilers/common/all/sys/termios.h diff --git a/components/libc/compilers/common_all/sys/time.h b/components/libc/compilers/common/all/sys/time.h similarity index 100% rename from components/libc/compilers/common_all/sys/time.h rename to components/libc/compilers/common/all/sys/time.h diff --git a/components/libc/compilers/common_all/termios.h b/components/libc/compilers/common/all/termios.h similarity index 100% rename from components/libc/compilers/common_all/termios.h rename to components/libc/compilers/common/all/termios.h diff --git a/components/libc/compilers/common_all/time.c b/components/libc/compilers/common/all/time.c similarity index 100% rename from components/libc/compilers/common_all/time.c rename to components/libc/compilers/common/all/time.c diff --git a/components/libc/compilers/common_all/unistd.c b/components/libc/compilers/common/all/unistd.c similarity index 100% rename from components/libc/compilers/common_all/unistd.c rename to components/libc/compilers/common/all/unistd.c diff --git a/components/libc/compilers/common_except_gcc/SConscript b/components/libc/compilers/common/excgcc/SConscript similarity index 100% rename from components/libc/compilers/common_except_gcc/SConscript rename to components/libc/compilers/common/excgcc/SConscript diff --git a/components/libc/compilers/common_except_gcc/fcntl.h b/components/libc/compilers/common/excgcc/fcntl.h similarity index 100% rename from components/libc/compilers/common_except_gcc/fcntl.h rename to components/libc/compilers/common/excgcc/fcntl.h diff --git a/components/libc/compilers/common_except_gcc/readme.md b/components/libc/compilers/common/excgcc/readme.md similarity index 100% rename from components/libc/compilers/common_except_gcc/readme.md rename to components/libc/compilers/common/excgcc/readme.md diff --git a/components/libc/compilers/common_except_gcc/sys/stat.h b/components/libc/compilers/common/excgcc/sys/stat.h similarity index 100% rename from components/libc/compilers/common_except_gcc/sys/stat.h rename to components/libc/compilers/common/excgcc/sys/stat.h diff --git a/components/libc/compilers/common_except_gcc/sys/types.h b/components/libc/compilers/common/excgcc/sys/types.h similarity index 100% rename from components/libc/compilers/common_except_gcc/sys/types.h rename to components/libc/compilers/common/excgcc/sys/types.h diff --git a/components/libc/compilers/common_except_gcc/sys/unistd.h b/components/libc/compilers/common/excgcc/sys/unistd.h similarity index 100% rename from components/libc/compilers/common_except_gcc/sys/unistd.h rename to components/libc/compilers/common/excgcc/sys/unistd.h diff --git a/components/libc/compilers/common_except_gcc/unistd.h b/components/libc/compilers/common/excgcc/unistd.h similarity index 100% rename from components/libc/compilers/common_except_gcc/unistd.h rename to components/libc/compilers/common/excgcc/unistd.h diff --git a/include/rtlibc.h b/include/rtlibc.h index 6f6777a2f3..50bddc6ee8 100644 --- a/include/rtlibc.h +++ b/include/rtlibc.h @@ -23,6 +23,13 @@ #include "libc/libc_limits.h" #include "libc/libc_stdio.h" +#ifndef RT_USING_LIBC +#if defined(__CC_ARM) || defined(__CLANG_ARM) || defined(__IAR_SYSTEMS_ICC__) +typedef signed long off_t; +typedef int mode_t; +#endif +#endif + #if defined(__MINGW32__) || defined(_WIN32) typedef signed long off_t; typedef int mode_t; From c871726e8930099efc1bbade8907e8b4571615eb Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Wed, 21 Apr 2021 02:16:29 +0800 Subject: [PATCH 6/8] update readme --- components/libc/compilers/common/all/readme.md | 2 +- components/libc/compilers/common/excgcc/readme.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/libc/compilers/common/all/readme.md b/components/libc/compilers/common/all/readme.md index 81bb005d0a..856ddeb045 100644 --- a/components/libc/compilers/common/all/readme.md +++ b/components/libc/compilers/common/all/readme.md @@ -1,6 +1,6 @@ ## Attentions -1. This folder is "common" for armlibc newlibc and dlib. +1. This folder is "common" for all toolchains. 2. If you want to add new `.c` files, please do not forget to fix SConscript file too. eg: diff --git a/components/libc/compilers/common/excgcc/readme.md b/components/libc/compilers/common/excgcc/readme.md index 15f8e60d59..b10940d003 100644 --- a/components/libc/compilers/common/excgcc/readme.md +++ b/components/libc/compilers/common/excgcc/readme.md @@ -1,3 +1,3 @@ ## Attentions -This folder is "common" for armlibc and dlib. \ No newline at end of file +This folder is "common" for toolchains excluding gcc. \ No newline at end of file From f9ba41f4c22855b4dff8c422283ea6832ad1fc2b Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Sun, 25 Apr 2021 21:10:31 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E6=9B=B4=E6=94=B9libc=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E4=B8=BAcommon=20=E4=BB=A5=E5=8F=8A=20none-gcc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/libc/compilers/common/SConscript | 34 +++++++++++++------ .../libc/compilers/common/all/SConscript | 27 --------------- .../libc/compilers/common/{all => }/dirent.h | 0 .../common/{excgcc => none-gcc}/SConscript | 0 .../common/{excgcc => none-gcc}/fcntl.h | 0 .../common/{excgcc => none-gcc}/readme.md | 0 .../common/{excgcc => none-gcc}/sys/stat.h | 0 .../common/{excgcc => none-gcc}/sys/types.h | 0 .../common/{excgcc => none-gcc}/sys/unistd.h | 0 .../common/{excgcc => none-gcc}/unistd.h | 0 .../libc/compilers/common/{all => }/readme.md | 0 .../libc/compilers/common/{all => }/stdlib.c | 0 .../compilers/common/{all => }/sys/ioctl.h | 0 .../compilers/common/{all => }/sys/mman.h | 0 .../compilers/common/{all => }/sys/statfs.h | 0 .../compilers/common/{all => }/sys/termios.h | 0 .../compilers/common/{all => }/sys/time.h | 0 .../libc/compilers/common/{all => }/termios.h | 0 .../libc/compilers/common/{all => }/time.c | 0 .../libc/compilers/common/{all => }/unistd.c | 0 20 files changed, 23 insertions(+), 38 deletions(-) delete mode 100644 components/libc/compilers/common/all/SConscript rename components/libc/compilers/common/{all => }/dirent.h (100%) rename components/libc/compilers/common/{excgcc => none-gcc}/SConscript (100%) rename components/libc/compilers/common/{excgcc => none-gcc}/fcntl.h (100%) rename components/libc/compilers/common/{excgcc => none-gcc}/readme.md (100%) rename components/libc/compilers/common/{excgcc => none-gcc}/sys/stat.h (100%) rename components/libc/compilers/common/{excgcc => none-gcc}/sys/types.h (100%) rename components/libc/compilers/common/{excgcc => none-gcc}/sys/unistd.h (100%) rename components/libc/compilers/common/{excgcc => none-gcc}/unistd.h (100%) rename components/libc/compilers/common/{all => }/readme.md (100%) rename components/libc/compilers/common/{all => }/stdlib.c (100%) rename components/libc/compilers/common/{all => }/sys/ioctl.h (100%) rename components/libc/compilers/common/{all => }/sys/mman.h (100%) rename components/libc/compilers/common/{all => }/sys/statfs.h (100%) rename components/libc/compilers/common/{all => }/sys/termios.h (100%) rename components/libc/compilers/common/{all => }/sys/time.h (100%) rename components/libc/compilers/common/{all => }/termios.h (100%) rename components/libc/compilers/common/{all => }/time.c (100%) rename components/libc/compilers/common/{all => }/unistd.c (100%) diff --git a/components/libc/compilers/common/SConscript b/components/libc/compilers/common/SConscript index 4c815c49b8..319e1a3555 100644 --- a/components/libc/compilers/common/SConscript +++ b/components/libc/compilers/common/SConscript @@ -1,15 +1,27 @@ -# RT-Thread building script for bridge - -import os from building import * -cwd = GetCurrentDir() -objs = [] -list = os.listdir(cwd) +Import('rtconfig') -for d in list: - path = os.path.join(cwd, d) - if os.path.isfile(os.path.join(path, 'SConscript')): - objs = objs + SConscript(os.path.join(d, 'SConscript')) +src = [] +cwd = GetCurrentDir() +group = [] +CPPPATH = [cwd] -Return('objs') +if GetDepend('RT_USING_LIBC'): + src += Glob('*.c') +else: + if GetDepend('RT_LIBC_USING_TIME'): + src += ['time.c'] + +if GetDepend('RT_USING_POSIX') == False: + SrcRemove(src, ['unistd.c']) + +if rtconfig.CROSS_TOOL == 'keil': + CPPDEFINES = ['__CLK_TCK=RT_TICK_PER_SECOND'] +else: + CPPDEFINES = [] + +if GetDepend('RT_USING_LIBC') or GetDepend('RT_LIBC_USING_TIME'): + group = DefineGroup('libc', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES) + +Return('group') diff --git a/components/libc/compilers/common/all/SConscript b/components/libc/compilers/common/all/SConscript deleted file mode 100644 index 319e1a3555..0000000000 --- a/components/libc/compilers/common/all/SConscript +++ /dev/null @@ -1,27 +0,0 @@ -from building import * - -Import('rtconfig') - -src = [] -cwd = GetCurrentDir() -group = [] -CPPPATH = [cwd] - -if GetDepend('RT_USING_LIBC'): - src += Glob('*.c') -else: - if GetDepend('RT_LIBC_USING_TIME'): - src += ['time.c'] - -if GetDepend('RT_USING_POSIX') == False: - SrcRemove(src, ['unistd.c']) - -if rtconfig.CROSS_TOOL == 'keil': - CPPDEFINES = ['__CLK_TCK=RT_TICK_PER_SECOND'] -else: - CPPDEFINES = [] - -if GetDepend('RT_USING_LIBC') or GetDepend('RT_LIBC_USING_TIME'): - group = DefineGroup('libc', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES) - -Return('group') diff --git a/components/libc/compilers/common/all/dirent.h b/components/libc/compilers/common/dirent.h similarity index 100% rename from components/libc/compilers/common/all/dirent.h rename to components/libc/compilers/common/dirent.h diff --git a/components/libc/compilers/common/excgcc/SConscript b/components/libc/compilers/common/none-gcc/SConscript similarity index 100% rename from components/libc/compilers/common/excgcc/SConscript rename to components/libc/compilers/common/none-gcc/SConscript diff --git a/components/libc/compilers/common/excgcc/fcntl.h b/components/libc/compilers/common/none-gcc/fcntl.h similarity index 100% rename from components/libc/compilers/common/excgcc/fcntl.h rename to components/libc/compilers/common/none-gcc/fcntl.h diff --git a/components/libc/compilers/common/excgcc/readme.md b/components/libc/compilers/common/none-gcc/readme.md similarity index 100% rename from components/libc/compilers/common/excgcc/readme.md rename to components/libc/compilers/common/none-gcc/readme.md diff --git a/components/libc/compilers/common/excgcc/sys/stat.h b/components/libc/compilers/common/none-gcc/sys/stat.h similarity index 100% rename from components/libc/compilers/common/excgcc/sys/stat.h rename to components/libc/compilers/common/none-gcc/sys/stat.h diff --git a/components/libc/compilers/common/excgcc/sys/types.h b/components/libc/compilers/common/none-gcc/sys/types.h similarity index 100% rename from components/libc/compilers/common/excgcc/sys/types.h rename to components/libc/compilers/common/none-gcc/sys/types.h diff --git a/components/libc/compilers/common/excgcc/sys/unistd.h b/components/libc/compilers/common/none-gcc/sys/unistd.h similarity index 100% rename from components/libc/compilers/common/excgcc/sys/unistd.h rename to components/libc/compilers/common/none-gcc/sys/unistd.h diff --git a/components/libc/compilers/common/excgcc/unistd.h b/components/libc/compilers/common/none-gcc/unistd.h similarity index 100% rename from components/libc/compilers/common/excgcc/unistd.h rename to components/libc/compilers/common/none-gcc/unistd.h diff --git a/components/libc/compilers/common/all/readme.md b/components/libc/compilers/common/readme.md similarity index 100% rename from components/libc/compilers/common/all/readme.md rename to components/libc/compilers/common/readme.md diff --git a/components/libc/compilers/common/all/stdlib.c b/components/libc/compilers/common/stdlib.c similarity index 100% rename from components/libc/compilers/common/all/stdlib.c rename to components/libc/compilers/common/stdlib.c diff --git a/components/libc/compilers/common/all/sys/ioctl.h b/components/libc/compilers/common/sys/ioctl.h similarity index 100% rename from components/libc/compilers/common/all/sys/ioctl.h rename to components/libc/compilers/common/sys/ioctl.h diff --git a/components/libc/compilers/common/all/sys/mman.h b/components/libc/compilers/common/sys/mman.h similarity index 100% rename from components/libc/compilers/common/all/sys/mman.h rename to components/libc/compilers/common/sys/mman.h diff --git a/components/libc/compilers/common/all/sys/statfs.h b/components/libc/compilers/common/sys/statfs.h similarity index 100% rename from components/libc/compilers/common/all/sys/statfs.h rename to components/libc/compilers/common/sys/statfs.h diff --git a/components/libc/compilers/common/all/sys/termios.h b/components/libc/compilers/common/sys/termios.h similarity index 100% rename from components/libc/compilers/common/all/sys/termios.h rename to components/libc/compilers/common/sys/termios.h diff --git a/components/libc/compilers/common/all/sys/time.h b/components/libc/compilers/common/sys/time.h similarity index 100% rename from components/libc/compilers/common/all/sys/time.h rename to components/libc/compilers/common/sys/time.h diff --git a/components/libc/compilers/common/all/termios.h b/components/libc/compilers/common/termios.h similarity index 100% rename from components/libc/compilers/common/all/termios.h rename to components/libc/compilers/common/termios.h diff --git a/components/libc/compilers/common/all/time.c b/components/libc/compilers/common/time.c similarity index 100% rename from components/libc/compilers/common/all/time.c rename to components/libc/compilers/common/time.c diff --git a/components/libc/compilers/common/all/unistd.c b/components/libc/compilers/common/unistd.c similarity index 100% rename from components/libc/compilers/common/all/unistd.c rename to components/libc/compilers/common/unistd.c From ae66d8262499c30e2f9617a101fc200b7e4814cb Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Sun, 25 Apr 2021 21:32:08 +0800 Subject: [PATCH 8/8] update sconscript --- components/libc/compilers/common/SConscript | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/libc/compilers/common/SConscript b/components/libc/compilers/common/SConscript index 319e1a3555..d9de1cf17f 100644 --- a/components/libc/compilers/common/SConscript +++ b/components/libc/compilers/common/SConscript @@ -23,5 +23,9 @@ else: if GetDepend('RT_USING_LIBC') or GetDepend('RT_LIBC_USING_TIME'): group = DefineGroup('libc', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES) - + list = os.listdir(cwd) + for d in list: + path = os.path.join(cwd, d) + if os.path.isfile(os.path.join(path, 'SConscript')): + group = group + SConscript(os.path.join(d, 'SConscript')) Return('group')