Skip to content

Commit b2d3317

Browse files
committed
remove minilibc
1 parent c21f018 commit b2d3317

File tree

15 files changed

+54
-74
lines changed

15 files changed

+54
-74
lines changed

bsp/efm32/copy_this_file_shell.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,6 @@ ALIGN(RT_ALIGN_SIZE)
3232
static char finsh_thread_stack[FINSH_THREAD_STACK_SIZE];
3333
struct finsh_shell* shell;
3434

35-
#if !defined (RT_USING_NEWLIB) && !defined (RT_USING_MINILIBC)
36-
int strcmp (const char *s1, const char *s2)
37-
{
38-
while (*s1 && *s1 == *s2) s1++, s2++;
39-
40-
return (*s1 - *s2);
41-
}
42-
4335
#ifdef RT_USING_HEAP
4436
char *strdup(const char *s)
4537
{

bsp/lpc2148/rtconfig.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,6 @@
8080
/* Using QEMU or SkyEye*/
8181
/* #define RT_USING_EMULATOR */
8282

83-
/* SECTION: a mini libc */
84-
/* Using mini libc library*/
85-
/* #define RT_USING_MINILIBC */
86-
8783
/* SECTION: C++ support */
8884
/* Using C++ support*/
8985
/* #define RT_USING_CPLUSPLUS */

bsp/microblaze/rtconfig.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@
9393
/* SECTION: a runtime libc library */
9494
/* a runtime libc library*/
9595
/* #define RT_USING_NEWLIB */
96-
#define RT_USING_MINILIBC
9796

9897
/* SECTION: C++ support */
9998
/* Using C++ support*/

bsp/sam7x/rtconfig.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,6 @@
7272
#define FINSH_USING_SYMTAB
7373
#define FINSH_USING_DESCRIPTION
7474

75-
/* SECTION: a mini libc */
76-
/* Using mini libc library*/
77-
/* #define RT_USING_MINILIBC */
78-
7975
/* SECTION: C++ support */
8076
/* Using C++ support*/
8177
/* #define RT_USING_CPLUSPLUS */

bsp/wh44b0/rtconfig.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,6 @@
6565
/* Using FinSH as Shell*/
6666
/* #define RT_USING_FINSH */
6767

68-
/* SECTION: a mini libc */
69-
/* Using mini libc library*/
70-
/* #define RT_USING_MINILIBC */
71-
7268
/* SECTION: C++ support */
7369
/* Using C++ support*/
7470
/* #define RT_USING_CPLUSPLUS */

components/dfs/filesystems/nfs/rpc/types.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -47,30 +47,14 @@
4747

4848
#include <string.h>
4949
#include <stdint.h>
50-
51-
#ifndef RT_USING_MINILIBC
52-
typedef unsigned int u_int;
53-
typedef unsigned char u_char;
54-
typedef unsigned long u_long;
55-
#else
5650
#include <sys/types.h>
57-
#include <stdint.h>
58-
#endif
5951

6052
typedef long long int64_t;
6153
typedef unsigned long long uint64_t;
6254

6355
typedef int bool_t;
6456
typedef int enum_t;
6557

66-
#ifndef RT_USING_NEWLIB
67-
typedef unsigned long dev_t;
68-
#endif
69-
70-
#if !defined(RT_USING_NEWLIB) && !defined(RT_USING_MINILIBC)
71-
typedef rt_int32_t ssize_t;
72-
#endif
73-
7458
/* This needs to be changed to uint32_t in the future */
7559
typedef unsigned long rpcprog_t;
7660
typedef unsigned long rpcvers_t;

components/libc/compilers/armlibc/sys/types.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,10 @@ typedef long signed int ssize_t; /* Used for a count of bytes or an error
2323
#endif
2424
typedef unsigned long useconds_t; /* microseconds (unsigned) */
2525

26+
typedef unsigned long dev_t;
27+
28+
typedef unsigned int u_int;
29+
typedef unsigned char u_char;
30+
typedef unsigned long u_long;
31+
2632
#endif

components/libc/compilers/common/SConscript

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ CPPPATH = [cwd]
1010
if GetDepend('RT_USING_LIBC'):
1111
src += Glob('*.c')
1212
else:
13-
if GetDepend('RT_LIBC_USING_TIME') and not GetDepend('RT_USING_MINILIBC'):
13+
if GetDepend('RT_LIBC_USING_TIME'):
1414
src += ['time.c']
1515

1616
if GetDepend('RT_USING_POSIX') == False:
@@ -21,7 +21,7 @@ if rtconfig.CROSS_TOOL == 'keil':
2121
else:
2222
CPPDEFINES = []
2323

24-
if not GetDepend('RT_USING_MINILIBC') and (GetDepend('RT_USING_LIBC') or GetDepend('RT_LIBC_USING_TIME')):
24+
if GetDepend('RT_USING_LIBC') or GetDepend('RT_LIBC_USING_TIME'):
2525
group = DefineGroup('libc', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)
2626

2727
Return('group')

components/libc/compilers/dlib/sys/types.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,10 @@ typedef long signed int ssize_t; /* Used for a count of bytes or an error
2222
#endif
2323
typedef unsigned long useconds_t; /* microseconds (unsigned) */
2424

25+
typedef unsigned long dev_t;
26+
27+
typedef unsigned int u_int;
28+
typedef unsigned char u_char;
29+
typedef unsigned long u_long;
30+
2531
#endif
Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,30 @@
11
from building import *
22
Import('rtconfig')
33

4-
src = Glob('*.c')
4+
src = []
55
cwd = GetCurrentDir()
66
group = []
77

88
CPPPATH = [cwd]
9-
CPPDEFINES = ['RT_USING_NEWLIB']
10-
11-
# link with libc and libm:
12-
# libm is a frequently used lib. Newlib is compiled with -ffunction-sections in
13-
# recent GCC tool chains. The linker would just link in the functions that have
14-
# been referenced. So setting this won't result in bigger text size.
15-
LIBS = ['c', 'm']
169

1710
if rtconfig.PLATFORM == 'gcc':
18-
group = DefineGroup('libc', src, depend = ['RT_USING_LIBC'],
19-
CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES, LIBS = LIBS)
11+
if GetDepend('RT_USING_LIBC'):
12+
CPPDEFINES = ['RT_USING_NEWLIB']
13+
# link with libc and libm:
14+
# libm is a frequently used lib. Newlib is compiled with -ffunction-sections in
15+
# recent GCC tool chains. The linker would just link in the functions that have
16+
# been referenced. So setting this won't result in bigger text size.
17+
LIBS = ['c', 'm']
18+
19+
src += Glob('*.c')
20+
SrcRemove(src, ['minilib.c'])
21+
if GetDepend('RT_USING_MODULE') == False:
22+
SrcRemove(src, ['libc_syms.c'])
23+
else:
24+
src += ['minilib.c']
25+
CPPDEFINES = []
26+
LIBS = []
27+
28+
group = DefineGroup('libc', src, depend = [], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES, LIBS = LIBS)
2029

2130
Return('group')

0 commit comments

Comments
 (0)