Skip to content

Commit 4b72cab

Browse files
committed
samples: net: lwm2m: depend on xsi single process for gettimeofday()
https://github.com/zephyrproject-rtos/zephyr/actions/runs/\ 15014534061/job/42189411225 We were seeing a linker error of the form ``` picolibc/x86_64-zephyr-elf/lib/32/libc.a(libc_time_time.c.o): \ in function `time': time.c:(.text.time+0x11): undefined reference to `gettimeofday' ``` Update the dependency from CONFIG_POSIX_TIMERS to CONFIG_XSI_SINGLE_PROCESS for gettimeofday(). Note: this is really only a workaround. The proper solution would be to have libc functions not depend on POSIX functions. Specifically, here https://github.com/zephyrproject-rtos/picolibc/blob/\ 51a8b32857e75345c37652a80b5cda98b28d69e5/newlib/libc/time/\ time.c#L54 and here https://github.com/zephyrproject-rtos/zephyr/blob/\ 3a4e128/lib/libc/common/\ source/time/time.c#L17 Also mentioned in zephyrproject-rtos#89068 Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
1 parent 3a4e128 commit 4b72cab

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CONFIG_ZCBOR=y
22
CONFIG_ZCBOR_CANONICAL=y
33
CONFIG_LWM2M_RW_SENML_CBOR_SUPPORT=y
4-
CONFIG_POSIX_TIMERS=y
4+
CONFIG_XSI_SINGLE_PROCESS=y
55
CONFIG_LWM2M_RESOURCE_DATA_CACHE_SUPPORT=y

subsys/net/lib/lwm2m/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ config LWM2M_RD_CLIENT_MAX_RETRIES
227227
config LWM2M_RESOURCE_DATA_CACHE_SUPPORT
228228
bool "Resource Time series data cache support"
229229
depends on (LWM2M_RW_SENML_JSON_SUPPORT || LWM2M_RW_SENML_CBOR_SUPPORT)
230-
depends on (POSIX_TIMERS && RING_BUFFER)
230+
depends on (XSI_SINGLE_PROCESS && RING_BUFFER)
231231
help
232232
Enable time series data storage.
233233
Requires time() to provide current Unix timestamp.

0 commit comments

Comments
 (0)