提交 087c0667 编写于 作者: B bernard.xiong@gmail.com

add some newlib leaked function.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1116 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 872a503a
......@@ -2,6 +2,9 @@ Import('RTT_ROOT')
from building import *
src_bsp = ['application.c', 'startup.c', 'board.c']
if GetDepend('RT_USING_NEWLIB'):
src_bsp = src_bsp + ['newlib_stub.c']
src_drv = ['uart.c', 'lnn800x480.c']
src = File(src_bsp + src_drv)
CPPPATH = [RTT_ROOT + '/bsp/dev3210']
......
......@@ -20,6 +20,8 @@ Export('rtconfig')
# prepare building environment
objs = PrepareBuilding(env, RTT_ROOT)
# libc testsuite
objs = objs + SConscript(RTT_ROOT + '/examples/libc/SConscript', variant_dir='build/examples/libc', duplicate=0)
# build program
env.Program(TARGET, objs)
......
#include <rtthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
/* some newlib leaked function in CodeSourcery G++ Lite for MIPS version */
int
getpid()
{
return 0;
}
int
gettimeofday(struct timeval *__tp, void *__tzp)
{
struct timespec tp;
if (libc_get_time(&tp) == 0)
{
if (__tp != RT_NULL)
{
__tp->tv_sec = tp.tv_sec;
__tp->tv_usec = tp.tv_nsec * 1000UL;
}
return tp.tv_sec;
}
return 0;
}
......@@ -66,6 +66,11 @@
#define RT_USING_CONSOLE
#define RT_CONSOLEBUF_SIZE 128
/* SECTION: the runtime libc library */
/* the runtime libc library */
#define RT_USING_NEWLIB
#define RT_USING_PTHREADS
/* SECTION: finsh, a C-Express shell */
/* Using FinSH as Shell*/
#define RT_USING_FINSH
......@@ -75,8 +80,9 @@
#define FINSH_DEVICE_NAME "uart"
/* SECTION: device filesystem support */
/* #define RT_USING_DFS */
#define RT_USING_DFS
#define RT_USING_DFS_ELMFAT
#define RT_USING_DFS_ROMFS
/* the max number of mounted filesystem */
#define DFS_FILESYSTEMS_MAX 2
......
......@@ -20,7 +20,7 @@ OBJCPY = PREFIX + 'objcopy'
READELF = PREFIX + 'readelf'
DEVICE = ' -mips2'
CFLAGS = DEVICE + ' -EL -G0 -DRT_USING_MINILIBC -mno-abicalls -fno-pic -fno-builtin -fno-exceptions -ffunction-sections -fomit-frame-pointer'
CFLAGS = DEVICE + ' -EL -G0 -mno-abicalls -fno-pic -fno-builtin -fno-exceptions -ffunction-sections -fomit-frame-pointer'
AFLAGS = ' -c' + DEVICE + ' -EL -fno-pic -fno-builtin -mno-abicalls -x assembler-with-cpp'
LFLAGS = DEVICE + ' -EL -Wl,--gc-sections,-Map=rtthread-3210.map,-cref,-u,Reset_Handler -T dev3210_ram.lds'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册