Implementing _gettimeofday on Zynq

Asked by JS

I'm compiling for the Zynq chip using CodeSourcery Lite, and when I include <time.h> and reference the time() function, the linker complains that it can't find _gettimeofday:

~/CodeSourcery/bin/../lib/gcc/arm-none-eabi/4.3.3/../../../../arm-none-eabi/lib/libc.a(lib_a-gettimeofdayr.o): In function `_gettimeofday_r':
gettimeofdayr.c:(.text+0x1c): undefined reference to `_gettimeofday'
collect2: ld returned 1 exit status

How do I give it a _gettimeofday function to use for getting the system timer ticks? This seems to be a deficiency with CodeSourcery Lite, as I don't have a problem when compiling using Xilinx tools.

Question information

Language:
English Edit question
Status:
Answered
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Terry Guo (terry.guo) said :
#1

Sorry that we don't provide support to CodeSourcery Lite. I recommend you to try out tool chain released in this website. At least we do have this function:

terguo01@terry-pc01:/work/terguo01/tools$ ./gcc-arm-none-eabi-4_8-2014q2/bin/arm-none-eabi-nm ./gcc-arm-none-eabi-4_8-2014q2/arm-none-eabi/lib/libc.a | grep _gettimeofday
         U _gettimeofday
00000000 T _gettimeofday_r
         U _gettimeofday_r
         U _gettimeofday_r

If you run into any problem, feel free to raise it. We are happy to provide support.

Can you help with this problem?

Provide an answer of your own, or ask JS for more information if necessary.

To post a message you must log in.