[Buildroot] [PATCH 1/1] package/libcoap: fix build for toolchains w/o threads

Thomas Perale thomas.perale at mind.be
Tue Apr 22 21:52:49 UTC 2025


The version bump in [1] introduced the upstream commit [2] which made
builds using toolchain without thread support fail to build libcoap.

This patch adds an option check in the libcoap.mk file to verify
the toolchain has thread support and passes the correct configuration
options introduced in [2] as well.

The build can be tested with the following config.

```
BR2_armeb=y
BR2_cortex_a76_a55=y
BR2_ARM_EABI=y
BR2_ARM_SOFT_FLOAT=y
BR2_TOOLCHAIN_BUILDROOT_UCLIBC=y
BR2_PTHREADS_NONE=y
BR2_PACKAGE_LIBCOAP=y
```

Fixes:
https://autobuild.buildroot.org/results/9c0/9c0b675a64fb2576bc34457043f118cffe5fe555//

[1] 4df4d1d312 package/libcoap: bump version to 4.3.5
[2] https://github.com/obgm/libcoap/commit/c69c5d5af0a30859e90756f535e2ca21cdeda0b2

Signed-off-by: Thomas Perale <thomas.perale at mind.be>
---
 package/libcoap/libcoap.mk | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/package/libcoap/libcoap.mk b/package/libcoap/libcoap.mk
index c5e5f85c62..d7c2a78944 100644
--- a/package/libcoap/libcoap.mk
+++ b/package/libcoap/libcoap.mk
@@ -31,4 +31,10 @@ else
 LIBCOAP_CONF_OPTS += --disable-dtls
 endif
 
+ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
+LIBCOAP_CONF_OPTS += --enable-thread-safe
+else
+LIBCOAP_CONF_OPTS += --disable-thread-safe
+endif
+
 $(eval $(autotools-package))
-- 
2.49.0



More information about the buildroot mailing list