* [Buildroot] [PATCH] package/mtd: UBIFS utils need a toolchain w/ threads
@ 2026-11-27 11:55 Yegor Yefremov via buildroot
2026-11-28 18:31 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 2+ messages in thread
From: Yegor Yefremov via buildroot @ 2026-11-27 11:55 UTC (permalink / raw)
To: buildroot; +Cc: Brandon Maier
In mtd-utils 2.3.x, the UBIFS utils (mkfs.ubifs and the new
fsck.ubifs) share the UBIFS code imported from the kernel, which
implements spinlocks, mutexes and rw semaphores with pthread and is
linked with -lpthread. The build therefore fails with toolchains
without threads support:
./ubifs-utils/common/spinlock.h:5:10: fatal error: pthread.h: No such file or directory
Add a dependency on BR2_TOOLCHAIN_HAS_THREADS to mkfs.ubifs,
fsck.ubifs and the hidden option they select.
This issue has been present since commit 1124bc4b836a ("package/mtd:
bump to version 2.3.1"), as 2.2.1 did not use pthread in the UBIFS
utils. It therefore affects 2026.05 and later, and the 2026.05.x and
2026.08.x branches.
Fixes:
https://autobuild.buildroot.org/results/f88b2b560b9a19b0f369dcd5fba034814dd79bde
Fixes: 1124bc4b836a0f16ce46088f0dd7e595a4d1b2ab ("package/mtd: bump to version 2.3.1")
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
package/mtd/Config.in | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/package/mtd/Config.in b/package/mtd/Config.in
index 1054106f81..d913a18d46 100644
--- a/package/mtd/Config.in
+++ b/package/mtd/Config.in
@@ -15,6 +15,7 @@ config BR2_PACKAGE_MTD_JFFS_UTILS
config BR2_PACKAGE_MTD_UBIFS_UTILS
bool
+ depends on BR2_TOOLCHAIN_HAS_THREADS
select BR2_PACKAGE_LIBOPENSSL_ENGINES if BR2_PACKAGE_LIBOPENSSL
select BR2_PACKAGE_UTIL_LINUX
select BR2_PACKAGE_UTIL_LINUX_LIBUUID
@@ -60,8 +61,12 @@ config BR2_PACKAGE_MTD_FLASH_UNLOCK
config BR2_PACKAGE_MTD_FSCKUBIFS
bool "fsck.ubifs"
+ depends on BR2_TOOLCHAIN_HAS_THREADS
select BR2_PACKAGE_MTD_UBIFS_UTILS
+comment "fsck.ubifs needs a toolchain w/ threads"
+ depends on !BR2_TOOLCHAIN_HAS_THREADS
+
config BR2_PACKAGE_MTD_FTL_CHECK
bool "ftl_check"
@@ -81,8 +86,12 @@ config BR2_PACKAGE_MTD_MKFSJFFS2
config BR2_PACKAGE_MTD_MKFSUBIFS
bool "mkfs.ubifs"
+ depends on BR2_TOOLCHAIN_HAS_THREADS
select BR2_PACKAGE_MTD_UBIFS_UTILS
+comment "mkfs.ubifs needs a toolchain w/ threads"
+ depends on !BR2_TOOLCHAIN_HAS_THREADS
+
config BR2_PACKAGE_MTD_MTD_DEBUG
bool "mtd_debug"
default y
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Buildroot] [PATCH] package/mtd: UBIFS utils need a toolchain w/ threads
2026-11-27 11:55 [Buildroot] [PATCH] package/mtd: UBIFS utils need a toolchain w/ threads Yegor Yefremov via buildroot
@ 2026-11-28 18:31 ` Thomas Petazzoni via buildroot
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-11-28 18:31 UTC (permalink / raw)
To: Yegor Yefremov; +Cc: buildroot, Brandon Maier
On Fri, Nov 27, 2026 at 12:55:48PM +0100, Yegor Yefremov via buildroot wrote:
> In mtd-utils 2.3.x, the UBIFS utils (mkfs.ubifs and the new
> fsck.ubifs) share the UBIFS code imported from the kernel, which
> implements spinlocks, mutexes and rw semaphores with pthread and is
> linked with -lpthread. The build therefore fails with toolchains
> without threads support:
>
> ./ubifs-utils/common/spinlock.h:5:10: fatal error: pthread.h: No such file or directory
>
> Add a dependency on BR2_TOOLCHAIN_HAS_THREADS to mkfs.ubifs,
> fsck.ubifs and the hidden option they select.
>
> This issue has been present since commit 1124bc4b836a ("package/mtd:
> bump to version 2.3.1"), as 2.2.1 did not use pthread in the UBIFS
> utils. It therefore affects 2026.05 and later, and the 2026.05.x and
> 2026.08.x branches.
>
> Fixes:
> https://autobuild.buildroot.org/results/f88b2b560b9a19b0f369dcd5fba034814dd79bde
>
> Fixes: 1124bc4b836a0f16ce46088f0dd7e595a4d1b2ab ("package/mtd: bump to version 2.3.1")
> Assisted-by: Claude:claude-opus-5-5
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Applied to master, thanks!
Best regards,
Thomas Petazzoni
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-28 18:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-27 11:55 [Buildroot] [PATCH] package/mtd: UBIFS utils need a toolchain w/ threads Yegor Yefremov via buildroot
2026-11-28 18:31 ` Thomas Petazzoni via buildroot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox