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