uclibc: proper thread default on m68k and Microblaze
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Fri, 5 Aug 2016 16:35:41 +0000 (18:35 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 7 Aug 2016 21:01:56 +0000 (23:01 +0200)
Traditionally, Buildroot has a default of enabling thread
support. However, with the current construct of the thread choice in the
uclibc package, the m68k and microblaze architecture end up with no
thread support as the default.

In order to avoid having to explicit a more complicated "default" value
for the choice, we take a simple approach: we order the 3 possible
choices by order of "preference", since Kconfig selects the first
selectable option in a choice by default.

So, NPTL is first and is the default when available. Then comes
linuxthreads which only gets selected as the default when NPTL is
available. None is offered as a last choice (in the current
implementation, it is never the default, since all architectures can
have thread support, either through NPTL or linuxthreads).

[Thomas: reworked according to Yann's comment that we could rely on the
Kconfig behavior that selects the first available choice option.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/uclibc/Config.in

index 7c99195d082fe5bc30b7df324bac55183087445b..33969cc1ce6cbb7a715231c21a2cb19a3155a94d 100644 (file)
@@ -47,26 +47,25 @@ config BR2_TOOLCHAIN_BUILDROOT_LOCALE
 
 choice
        prompt "Thread library implementation"
-       default BR2_PTHREADS_NATIVE
-       default BR2_PTHREADS if !BR2_USE_MMU
        help
          Use this option to select the thread library implementation
          that should be used in your toolchain.
 
-       config BR2_PTHREADS_NONE
-               bool "none"
-
-       config BR2_PTHREADS
-               bool "linuxthreads"
-               select BR2_TOOLCHAIN_HAS_THREADS
-               depends on BR2_bfin || BR2_m68k || BR2_microblaze || BR2_arm || BR2_armeb || BR2_xtensa
-
        config BR2_PTHREADS_NATIVE
                bool "Native POSIX Threading (NPTL)"
                select BR2_TOOLCHAIN_HAS_THREADS
                select BR2_TOOLCHAIN_HAS_THREADS_NPTL
                depends on BR2_USE_MMU
                depends on !BR2_m68k && !BR2_microblaze
+
+       config BR2_PTHREADS
+               bool "linuxthreads"
+               select BR2_TOOLCHAIN_HAS_THREADS
+               depends on BR2_bfin || BR2_m68k || BR2_microblaze || BR2_arm || BR2_armeb || BR2_xtensa
+
+       config BR2_PTHREADS_NONE
+               bool "none"
+
 endchoice
 
 config BR2_PTHREAD_DEBUG