zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.98k stars 6.69k forks source link

Lwm2m_client sample broken on native_posix target #48306

Closed SeppoTakalo closed 2 years ago

SeppoTakalo commented 2 years ago

Describe the bug

samples/net/lwm2m_client does not anymore build on native_posix target.

Git bisecting shows:

9ceeb3a0ae0739bb3e5fba00b7d18eda343209ea is the first bad commit
commit 9ceeb3a0ae0739bb3e5fba00b7d18eda343209ea
Author: Kumar Gala <galak@kernel.org>
Date:   Wed Jul 6 11:20:53 2022 -0500

    samples: lwm2m_client: Convert to use gpio_dt_spec

    Move sample to use gpio_dt_spec for GPIO access.

    Signed-off-by: Kumar Gala <galak@kernel.org>

 samples/net/lwm2m_client/src/lwm2m-client.c | 23 ++++++-----------------
 1 file changed, 6 insertions(+), 17 deletions(-)

To Reproduce Steps to reproduce the behavior:

  1. cd samples/net/lwm2m_client
  2. west build -b native_posix

Expected behavior Should build normally.

Impact Blocks testing on native_posix environment

Logs and console output

/usr/bin/ld: app/libapp.a(lwm2m-client.c.obj): in function `gpio_pin_set':
/home/seta/src/ncs/zephyr/include/zephyr/drivers/gpio.h:1265: undefined reference to `__device_dts_ord_25'
/usr/bin/ld: app/libapp.a(lwm2m-client.c.obj): in function `gpio_pin_set_raw':
/home/seta/src/ncs/zephyr/include/zephyr/drivers/gpio.h:1224: undefined reference to `__device_dts_ord_25'
/usr/bin/ld: app/libapp.a(lwm2m-client.c.obj): in function `z_impl_gpio_port_set_bits_raw':
/home/seta/src/ncs/zephyr/include/zephyr/drivers/gpio.h:995: undefined reference to `__device_dts_ord_25'
/usr/bin/ld: app/libapp.a(lwm2m-client.c.obj): in function `z_impl_gpio_port_clear_bits_raw':
/home/seta/src/ncs/zephyr/include/zephyr/drivers/gpio.h:1033: undefined reference to `__device_dts_ord_25'
/usr/bin/ld: app/libapp.a(lwm2m-client.c.obj): in function `z_impl_device_is_ready':
/home/seta/src/ncs/zephyr/include/zephyr/device.h:831: undefined reference to `__device_dts_ord_25'
/usr/bin/ld: app/libapp.a(lwm2m-client.c.obj):/home/seta/src/ncs/zephyr/include/zephyr/drivers/gpio.h:693: more undefined references to `__device_dts_ord_25' follow
collect2: error: ld returned 1 exit status

Environment (please complete the following information):

SeppoTakalo commented 2 years ago

@galak Please review. I believe it is your commit that broke the build.