C-lib status


Erwin Rol
 

Hey all (yeah there he is again),

I was wondering what the status and planning is for the C-library? I
tried a simple example and I guess I directly hit a problem. The
"buildin" mini C-lib doesn't offer much (I wanted the time(NULL)
function), so I selected newlibc. That compiles but doesn't work, it
ends up in an endless loop where gettimeofday calls _gettimeofday_r and
that calls gettimeofday again (see stack trace below).

Am I doing something wrong here (Zephyr configuration or something like
that) or is newlib support just not yet ready to use ?

- Erwin

#0 gettimeofday (ptimeval=ptimeval@entry=0x20001720 <_main_stack+4052>, ptimezone=ptimezone@entry=0x0) at /usr/src/debug/newlib/2.4.0-r0/newlib-2.4.0/newlib/libc/syscalls/sysgettod.c:12
#1 0x0800091c in _gettimeofday_r (ptr=0x20000008 <impure_data>, ptimeval=ptimeval@entry=0x20001720 <_main_stack+4052>, ptimezone=ptimezone@entry=0x0)
at /usr/src/debug/newlib/2.4.0-r0/newlib-2.4.0/newlib/libc/reent/gettimeofdayr.c:71
#2 0x0800093c in gettimeofday (ptimeval=ptimeval@entry=0x20001720 <_main_stack+4052>, ptimezone=ptimezone@entry=0x0) at /usr/src/debug/newlib/2.4.0-r0/newlib-2.4.0/newlib/libc/syscalls/sysgettod.c:12
#3 0x0800091c in _gettimeofday_r (ptr=0x20000008 <impure_data>, ptimeval=ptimeval@entry=0x20001720 <_main_stack+4052>, ptimezone=ptimezone@entry=0x0)
at /usr/src/debug/newlib/2.4.0-r0/newlib-2.4.0/newlib/libc/reent/gettimeofdayr.c:71
#4 0x0800093c in gettimeofday (ptimeval=ptimeval@entry=0x20001720 <_main_stack+4052>, ptimezone=ptimezone@entry=0x0) at /usr/src/debug/newlib/2.4.0-r0/newlib-2.4.0/newlib/libc/syscalls/sysgettod.c:12
#5 0x0800091c in _gettimeofday_r (ptr=0x20000008 <impure_data>, ptimeval=ptimeval@entry=0x20001720 <_main_stack+4052>, ptimezone=ptimezone@entry=0x0)
at /usr/src/debug/newlib/2.4.0-r0/newlib-2.4.0/newlib/libc/reent/gettimeofdayr.c:71
#6 0x0800093c in gettimeofday (ptimeval=ptimeval@entry=0x20001720 <_main_stack+4052>, ptimezone=ptimezone@entry=0x0) at /usr/src/debug/newlib/2.4.0-r0/newlib-2.4.0/newlib/libc/syscalls/sysgettod.c:12
#7 0x0800091c in _gettimeofday_r (ptr=0x20000008 <impure_data>, ptimeval=ptimeval@entry=0x20001720 <_main_stack+4052>, ptimezone=ptimezone@entry=0x0)
at /usr/src/debug/newlib/2.4.0-r0/newlib-2.4.0/newlib/libc/reent/gettimeofdayr.c:71
#8 0x0800093c in gettimeofday (ptimeval=ptimeval@entry=0x20001720 <_main_stack+4052>, ptimezone=ptimezone@entry=0x0) at /usr/src/debug/newlib/2.4.0-r0/newlib-2.4.0/newlib/libc/syscalls/sysgettod.c:12
#9 0x0800091c in _gettimeofday_r (ptr=0x20000008 <impure_data>, ptimeval=ptimeval@entry=0x20001720 <_main_stack+4052>, ptimezone=ptimezone@entry=0x0)
at /usr/src/debug/newlib/2.4.0-r0/newlib-2.4.0/newlib/libc/reent/gettimeofdayr.c:71
#10 0x0800093c in gettimeofday (ptimeval=ptimeval@entry=0x20001720 <_main_stack+4052>, ptimezone=ptimezone@entry=0x0) at /usr/src/debug/newlib/2.4.0-r0/newlib-2.4.0/newlib/libc/syscalls/sysgettod.c:12
#11 0x0800091c in _gettimeofday_r (ptr=0x20000008 <impure_data>, ptimeval=ptimeval@entry=0x20001720 <_main_stack+4052>, ptimezone=ptimezone@entry=0x0)
at /usr/src/debug/newlib/2.4.0-r0/newlib-2.4.0/newlib/libc/reent/gettimeofdayr.c:71
#12 0x080008ee in time (t=t@entry=0x0) at /usr/src/debug/newlib/2.4.0-r0/newlib-2.4.0/newlib/libc/time/time.c:46
#13 0x0800094a in main () at /home/erwin/zephyr/samples/hello_world/src/main.c:43

Join devel@lists.zephyrproject.org to automatically receive all group messages.