From 4fb265657d4d3018ea2e29fbcff97f39b122ea81 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Wed, 5 Feb 2020 10:51:10 -0600 Subject: [PATCH] libc: newlibc: Implement dummy _gettimeofday to link With the change in SDK 0.11.1 to newlib to remove -DMISSING_SYSCALL_NAMES we now need to implement a version of _gettimeofday. Previously with pre SDK 0.11.1 we had a recursive mess of _gettimeofday_r -> gettimeofday -> _gettimeofday_r. (which are all implemented in newlib and thus we didn't get a link error). With SDK 0.11.1 we have: _gettimeofday_r -> _gettimeofday. And we should provide a version of _gettimeofday. Fixes #22484 Signed-off-by: Kumar Gala --- lib/libc/newlib/libc-hooks.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/libc/newlib/libc-hooks.c b/lib/libc/newlib/libc-hooks.c index bb551c6ed59..9ba04cab654 100644 --- a/lib/libc/newlib/libc-hooks.c +++ b/lib/libc/newlib/libc-hooks.c @@ -358,3 +358,13 @@ void *_sbrk_r(struct _reent *r, int count) return _sbrk(count); } #endif /* CONFIG_XTENSA */ + +struct timeval; + +int _gettimeofday(struct timeval *__tp, void *__tzp) +{ + ARG_UNUSED(__tp); + ARG_UNUSED(__tzp); + + return -1; +}