Skip to contentSkip to conversation

Add toolchain knob for NPTL

PATCH New Thomas Petazzoni 4 participants 18 messages Feb 13, 2014 – Feb 18, 2014

lore
Share & tools
lore
#0 lore raw

cover Add toolchain knob for NPTL

Hello,

We have a growing number of packages that need pthread functions only available when the NPTL implementation is used. But at the same time, we have several architectures (AVR32, ARC, Blackfin and Xtensa) that don't support NPTL.

This set of commits adds a new hidden toolchain config knob named BR2_TOOLCHAIN_HAS_THREADS_NPTL, and uses it in four packages: three were already having special conditions to more-or-less detect the availability of NPTL, and one package (qt5) which fixes an autobuilder failure.

Thomas

Thomas Petazzoni (6):
toolchain: introduce a toolchain knob for NPTL docs/manual: indicate how to handle BR2_TOOLCHAIN_HAS_THREADS_NPTL
rt-tests: use BR2_TOOLCHAIN_HAS_THREADS_NPTL
sconeserver: use BR2_TOOLCHAIN_HAS_THREADS_NPTL
tvheadend: use BR2_TOOLCHAIN_HAS_THREADS_NPTL
qt5: needs NPTL threads

 docs/manual/adding-packages-directory.txt |  8 +++++++-
 package/qt5/Config.in                     |  6 +++---
 package/rt-tests/Config.in                | 12 +++---------
 package/sconeserver/Config.in             | 12 +++---------
 package/tvheadend/Config.in               | 12 +++---------
 package/uclibc/Config.in                  |  1 +
 toolchain/Config.in                       |  2 ++
 toolchain/helpers.mk                      |  1 +
 toolchain/toolchain-common.in             |  3 +++
 toolchain/toolchain-external/Config.in    | 11 +++++++++++
 10 files changed, 37 insertions(+), 31 deletions(-)
Signature · 1 line
1.8.3.2
#1 lore raw

PATCH 1/6 toolchain: introduce a toolchain knob for NPTL

As our architecture support expands to a number of architectures that do not implement NPTL threading, and the number of packages that depend on NPTL specific features, it has become necessary to be able to know whether the toolchain has NPTL support or not.

This commit adds a new BR2_TOOLCHAIN_HAS_THREADS_NPTL hidden Config.in option that allows packages to know whether NPTL is available or not.

This hidden option is:

* Automatically enabled when glibc/eglibc or musl toolchains are used, either internal or external.

* Automatically enabled when an internal uClibc toolchain with NPTL support is configured. It is left disabled otherwise for internal uClibc toolchains.

* Configured according to a visible Config.in option for custom external uClibc toolchains.

---
 package/uclibc/Config.in               |  1 +
 toolchain/Config.in                    |  2 ++
 toolchain/helpers.mk                   |  1 +
 toolchain/toolchain-common.in          |  3 +++
 toolchain/toolchain-external/Config.in | 11 +++++++++++
 5 files changed, 18 insertions(+)
package/uclibc/Config.in +1 -0
index f5543cc..0ee4125 100644
@@ -124,6 +124,7 @@ choice
 	config BR2_PTHREADS_NATIVE
 		bool "Native POSIX Threading (NPTL)"
 		select BR2_TOOLCHAIN_HAS_THREADS
+		select BR2_TOOLCHAIN_HAS_THREADS_NPTL
 		depends on !BR2_arc
 		depends on !BR2_avr32
 		depends on !BR2_bfin
toolchain/Config.in +2 -0
index bbfd367..44f3ac6 100644
@@ -9,6 +9,7 @@ config BR2_TOOLCHAIN_USES_GLIBC
 	select BR2_ENABLE_LOCALE
 	select BR2_TOOLCHAIN_HAS_THREADS
 	select BR2_TOOLCHAIN_HAS_THREADS_DEBUG
+	select BR2_TOOLCHAIN_HAS_THREADS_NPTL
 	select BR2_TOOLCHAIN_HAS_SHADOW_PASSWORDS
 	select BR2_TOOLCHAIN_HAS_SSP
 
@@ -23,6 +24,7 @@ config BR2_TOOLCHAIN_USES_MUSL
 	select BR2_ENABLE_LOCALE
 	select BR2_TOOLCHAIN_HAS_THREADS
 	select BR2_TOOLCHAIN_HAS_THREADS_DEBUG
+	select BR2_TOOLCHAIN_HAS_THREADS_NPTL
 
 choice
 	prompt "Toolchain type"
toolchain/helpers.mk +1 -0
index faa9d90..892ab4b 100644
@@ -268,6 +268,7 @@ check_uclibc = \
 	$(call check_uclibc_feature,__UCLIBC_HAS_WCHAR__,BR2_USE_WCHAR,$${UCLIBC_CONFIG_FILE},Wide char support) ;\
 	$(call check_uclibc_feature,__UCLIBC_HAS_THREADS__,BR2_TOOLCHAIN_HAS_THREADS,$${UCLIBC_CONFIG_FILE},Thread support) ;\
 	$(call check_uclibc_feature,__PTHREADS_DEBUG_SUPPORT__,BR2_TOOLCHAIN_HAS_THREADS_DEBUG,$${UCLIBC_CONFIG_FILE},Thread debugging support) ;\
+	$(call check_uclibc_feature,__UCLIBC_HAS_THREADS_NATIVE__,BR2_TOOLCHAIN_HAS_THREADS_NPTL,$${UCLIBC_CONFIG_FILE},NPTL thread support) ;\
 	$(call check_uclibc_feature,__UCLIBC_HAS_SSP__,BR2_TOOLCHAIN_HAS_SSP,$${UCLIBC_CONFIG_FILE},Stack Smashing Protection support)
 
 #
toolchain/toolchain-common.in +3 -0
index 8435a65..c4e3890 100644
@@ -29,6 +29,9 @@ config BR2_TOOLCHAIN_HAS_THREADS
 config BR2_TOOLCHAIN_HAS_THREADS_DEBUG
 	bool
 
+config BR2_TOOLCHAIN_HAS_THREADS_NPTL
+	bool
+
 config BR2_TOOLCHAIN_HAS_SHADOW_PASSWORDS
 	bool
 
toolchain/toolchain-external/Config.in +11 -0
index f02f89b..c87f195 100644
@@ -1006,6 +1006,17 @@ config BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_DEBUG
 	  debugging support. If you don't know, leave the default
 	  value, Buildroot will tell you if it's correct or not.
 
+config BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_NPTL
+	bool "Toolchain has NPTL threads support?"
+	depends on BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS
+	select BR2_TOOLCHAIN_HAS_THREADS_NPTL
+	default y
+	help
+	  Select this option if your external toolchain uses the NPTL
+	  (Native Posix Thread Library) implementation of Posix
+	  threads. If you don't know, leave the default value,
+	  Buildroot will tell you if it's correct or not.
+
 config BR2_TOOLCHAIN_EXTERNAL_HAS_SSP
 	bool "Toolchain has SSP support?"
 	select BR2_TOOLCHAIN_HAS_SSP
Signature · 1 line
1.8.3.2
#2 lore raw

PATCH 1/6 toolchain: introduce a toolchain knob for NPTL

Quoted 13 lines · Thomas Petazzoni

As our architecture support expands to a number of architectures that do not implement NPTL threading, and the number of packages that depend on NPTL specific features, it has become necessary to be able to know whether the toolchain has NPTL support or not.

This commit adds a new BR2_TOOLCHAIN_HAS_THREADS_NPTL hidden Config.in option that allows packages to know whether NPTL is available or not.

This hidden option is:

* Automatically enabled when glibc/eglibc or musl toolchains are used, either internal or external.

Quoted 6 lines

* Automatically enabled when an internal uClibc toolchain with NPTL support is configured. It is left disabled otherwise for internal uClibc toolchains.

* Configured according to a visible Config.in option for custom external uClibc toolchains.

I think there is very little reason left to use NPTL on archs that
support it, isn't there? So I would first remove the option completely for these architectures. That would also make adding a comment unnecessary (since it becomes an architecture feature rather than a toolchain option).

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#3 lore raw

PATCH 1/6 toolchain: introduce a toolchain knob for NPTL

Dear Arnout Vandecappelle,

Quoted 1 line · Arnout Vandecappelle

I think there is very little reason left to use NPTL on archs that

I guess you wanted to say "to *NOT* use NPTL".

Quoted 4 lines

support it, isn't there? So I would first remove the option completely for these architectures. That would also make adding a comment unnecessary (since it becomes an architecture feature rather than a toolchain option).

While I definitely agree for the internal toolchain backend, I don't think this applies nicely with the external toolchain backend. We do not control how the external toolchains are built, and it is perfectly possible to build a non-NPTL toolchain on a NPTL-supported architecture with Crosstool-NG for example.

That being said, our choice could simply be to not support these cases at all, and check in the external toolchain backend that the toolchain has NPTL support if the architecture is supposed to support it.

However, this kind of strategy might fail quite quickly for "growing" architectures. For example, ARC currently does not have NPTL support, but since they appear to be quite active, maybe they will implement NPTL support at some point. And at this moment we will have a range of stable, well-tested toolchains that are non-NPTL, and the possibility of building NPTL-capable, but not fully tested toolchains.

Thoughts?

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#4 lore raw

PATCH 1/6 toolchain: introduce a toolchain knob for NPTL

Quoted 7 lines · Thomas Petazzoni

Dear Arnout Vandecappelle,

Quoted 1 line · Arnout Vandecappelle

I think there is very little reason left to use NPTL on archs that

I guess you wanted to say "to *NOT* use NPTL".

Good guess :-)

Quoted 11 lines
Quoted 5 lines

support it, isn't there? So I would first remove the option completely for these architectures. That would also make adding a comment unnecessary (since it becomes an architecture feature rather than a toolchain option).

While I definitely agree for the internal toolchain backend, I don't think this applies nicely with the external toolchain backend. We do not control how the external toolchains are built, and it is perfectly possible to build a non-NPTL toolchain on a NPTL-supported architecture with Crosstool-NG for example.

Yes, but we certainly don't support all of the possible toolchains that
can be spat out by Crosstool-NG. At least, I don't think so...

Quoted 3 lines

That being said, our choice could simply be to not support these cases at all, and check in the external toolchain backend that the toolchain has NPTL support if the architecture is supposed to support it.

... therefore I'd be in favour of this approach.

Quoted 7 lines

However, this kind of strategy might fail quite quickly for "growing" architectures. For example, ARC currently does not have NPTL support, but since they appear to be quite active, maybe they will implement NPTL support at some point. And at this moment we will have a range of stable, well-tested toolchains that are non-NPTL, and the possibility of building NPTL-capable, but not fully tested toolchains.

But that's indeed a very good point that I didn't think of. Indeed, for
these we'll want to support both NPTL and LinuxThreads, therefore we still need the comments.

Taking that aspect into consideration, removing the LinuxThreads options
is not bringing any real advantage. So forget I ever mentioned it :-)

Regards,
Arnout

Quoted 7 lines

Thoughts?

Best regards,

Thomas

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#5 lore raw

PATCH 1/6 toolchain: introduce a toolchain knob for NPTL

Dear Arnout Vandecappelle,

Quoted 5 lines · Arnout Vandecappelle
Quoted 5 lines
Quoted 4 lines

support it, isn't there? So I would first remove the option completely for these architectures. That would also make adding a comment unnecessary (since it becomes an architecture feature rather than a toolchain option).

Quoted 8 lines
Quoted 5 lines

While I definitely agree for the internal toolchain backend, I don't think this applies nicely with the external toolchain backend. We do not control how the external toolchains are built, and it is perfectly possible to build a non-NPTL toolchain on a NPTL-supported architecture with Crosstool-NG for example.

Yes, but we certainly don't support all of the possible toolchains that
can be spat out by Crosstool-NG. At least, I don't think so...

We are supposed to support a good number of possible toolchains that Crosstool-NG generates, even though it's true that we do not support all the possible funky uClibc configurations that one could create with Crosstool-NG. We also don't support these in Buildroot, while we do ensure that the uClibc configuration matches the threading model selected in the Buildroot configuration.

Quoted 7 lines
Quoted 6 lines

However, this kind of strategy might fail quite quickly for "growing" architectures. For example, ARC currently does not have NPTL support, but since they appear to be quite active, maybe they will implement NPTL support at some point. And at this moment we will have a range of stable, well-tested toolchains that are non-NPTL, and the possibility of building NPTL-capable, but not fully tested toolchains.

Quoted 6 lines

But that's indeed a very good point that I didn't think of. Indeed, for
these we'll want to support both NPTL and LinuxThreads, therefore we still need the comments.

Taking that aspect into consideration, removing the LinuxThreads options
is not bringing any real advantage. So forget I ever mentioned it :-)

Ok, thanks for your feedback!

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#6 lore raw

PATCH 1/6 toolchain: introduce a toolchain knob for NPTL

In reply to Thomas Petazzoni

toolchain/toolchain-external/Config.in config BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_DEBUG · line 1018

Quoted 10 lines · Thomas Petazzoni
toolchain/toolchain-external/Config.in +10 -0
+config BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_NPTL
+	bool "Toolchain has NPTL threads support?"
+	depends on BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS
+	select BR2_TOOLCHAIN_HAS_THREADS_NPTL
+	default y
+	help
+	  Select this option if your external toolchain uses the NPTL
+	  (Native Posix Thread Library) implementation of Posix
+	  threads. If you don't know, leave the default value,
+	  Buildroot will tell you if it's correct or not.

Where exactly does buildroot check if the external toolchain has NPTL?

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#7 lore raw

PATCH 1/6 toolchain: introduce a toolchain knob for NPTL

Dear Arnout Vandecappelle,

Quoted 13 lines · Arnout Vandecappelle

toolchain/toolchain-external/Config.in config BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_DEBUG · line 1018

Quoted 10 lines · Thomas Petazzoni
toolchain/toolchain-external/Config.in +10 -0
+config BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_NPTL
+	bool "Toolchain has NPTL threads support?"
+	depends on BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS
+	select BR2_TOOLCHAIN_HAS_THREADS_NPTL
+	default y
+	help
+	  Select this option if your external toolchain uses the NPTL
+	  (Native Posix Thread Library) implementation of Posix
+	  threads. If you don't know, leave the default value,
+	  Buildroot will tell you if it's correct or not.

Where exactly does buildroot check if the external toolchain has NPTL?

In the patch you're replying to, look at the chunk that modifies toolchain/helpers.mk:

+ $(call check_uclibc_feature,__UCLIBC_HAS_THREADS_NATIVE__,BR2_TOOLCHAIN_HAS_THREADS_NPTL,$${UCLIBC_CONFIG_FILE},NPTL thread support) ;\

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#8 lore raw

PATCH 1/6 toolchain: introduce a toolchain knob for NPTL

Quoted 20 lines · Thomas Petazzoni

Dear Arnout Vandecappelle,

Quoted 13 lines · Arnout Vandecappelle

toolchain/toolchain-external/Config.in config BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_DEBUG · line 1018

Quoted 10 lines · Thomas Petazzoni
toolchain/toolchain-external/Config.in +10 -0
+config BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_NPTL
+	bool "Toolchain has NPTL threads support?"
+	depends on BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS
+	select BR2_TOOLCHAIN_HAS_THREADS_NPTL
+	default y
+	help
+	  Select this option if your external toolchain uses the NPTL
+	  (Native Posix Thread Library) implementation of Posix
+	  threads. If you don't know, leave the default value,
+	  Buildroot will tell you if it's correct or not.

Where exactly does buildroot check if the external toolchain has NPTL?

In the patch you're replying to, look at the chunk that modifies toolchain/helpers.mk:

toolchain/helpers.mk check_uclibc = \ · line 271

Quoted 1 line
toolchain/helpers.mk +1 -0
+	$(call check_uclibc_feature,__UCLIBC_HAS_THREADS_NATIVE__,BR2_TOOLCHAIN_HAS_THREADS_NPTL,$${UCLIBC_CONFIG_FILE},NPTL thread support) ;\

Damn, I looked for it three times and couldn't find it... Better get my
eyes checked!

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#9 lore raw

PATCH 2/6 docs/manual: indicate how to handle BR2_TOOLCHAIN_HAS_THREADS_NPTL

In reply to Thomas Petazzoni
---
 docs/manual/adding-packages-directory.txt | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
docs/manual/adding-packages-directory.txt +7 -1
index 754a145..e1299c3 100644
@@ -235,7 +235,13 @@ use in the comment.
 
 * thread support
 ** Dependency symbol: +BR2_TOOLCHAIN_HAS_THREADS+
-** Comment string: +threads+
+** Comment string: +threads+ (unless +BR2_TOOLCHAIN_HAS_THREADS_NPTL+
+   is also needed, in which case, specifying only +NPTL threads+ is
+   sufficient)
+
+* NPTL thread support
+** Dependency symbol: +BR2_TOOLCHAIN_HAS_THREADS_NPTL+
+** Comment string: +NPTL threads+
 
 * RPC support
 ** Dependency symbol: +BR2_TOOLCHAIN_HAS_NATIVE_RPC+
Signature · 1 line
1.8.3.2
#10 lore raw

PATCH 2/6 docs/manual: indicate how to handle BR2_TOOLCHAIN_HAS_THREADS_NPTL

Quoted 14 lines · Thomas Petazzoni
---
 docs/manual/adding-packages-directory.txt | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
docs/manual/adding-packages-directory.txt +0 -1
index 754a145..e1299c3 100644
@@ -235,7 +235,13 @@ use in the comment.
 
 * thread support
 ** Dependency symbol: +BR2_TOOLCHAIN_HAS_THREADS+
-** Comment string: +threads+

docs/manual/adding-packages-directory.txt use in the comment. · line 247

Quoted 10 lines
docs/manual/adding-packages-directory.txt +7 -0
+** Comment string: +threads+ (unless +BR2_TOOLCHAIN_HAS_THREADS_NPTL+
+   is also needed, in which case, specifying only +NPTL threads+ is
+   sufficient)
+
+* NPTL thread support
+** Dependency symbol: +BR2_TOOLCHAIN_HAS_THREADS_NPTL+
+** Comment string: +NPTL threads+
 
 * RPC support
 ** Dependency symbol: +BR2_TOOLCHAIN_HAS_NATIVE_RPC+

Should we maybe use 'NPTL' rather than 'NPTL threads' to make the string shorter? (we want to fit in 80chars).
It's true that it's a bit more cryptic, but so is RPC, wchar, etc. The biggest point is that a user can go to the Toolchain menu and recognize a string that matches, in this case the keyword NPTL.

Best regards,
Thomas

#11 lore raw

PATCH 2/6 docs/manual: indicate how to handle BR2_TOOLCHAIN_HAS_THREADS_NPTL

Dear Thomas De Schampheleire,

Quoted 11 lines · Thomas De Schampheleire
Quoted 11 lines

* thread support
** Dependency symbol: +BR2_TOOLCHAIN_HAS_THREADS+

docs/manual/adding-packages-directory.txt +7 -1
-** Comment string: +threads+
+** Comment string: +threads+ (unless +BR2_TOOLCHAIN_HAS_THREADS_NPTL+
+   is also needed, in which case, specifying only +NPTL threads+ is
+   sufficient)
+
+* NPTL thread support
+** Dependency symbol: +BR2_TOOLCHAIN_HAS_THREADS_NPTL+
+** Comment string: +NPTL threads+
Quoted 8 lines
Quoted 2 lines

* RPC support
** Dependency symbol: +BR2_TOOLCHAIN_HAS_NATIVE_RPC+

Should we maybe use 'NPTL' rather than 'NPTL threads' to make the string shorter? (we want to fit in 80chars).
It's true that it's a bit more cryptic, but so is RPC, wchar, etc. The biggest point is that a user can go to the Toolchain menu and recognize a string that matches, in this case the keyword NPTL.

Fine with me. I'll adjust that in the v2, but I'll wait a little bit more for other comments, if any :)

Thanks for the review!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#12 lore raw

PATCH 3/6 rt-tests: use BR2_TOOLCHAIN_HAS_THREADS_NPTL

In reply to Thomas Petazzoni
---
 package/rt-tests/Config.in | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
package/rt-tests/Config.in +3 -9
index 58a88a8..55e4f55 100644
@@ -1,10 +1,6 @@
 config BR2_PACKAGE_RT_TESTS
 	bool "rt-tests"
-	depends on BR2_TOOLCHAIN_HAS_THREADS
-	# priority-inheritance mutex needs NPTL
-	depends on !BR2_PTHREADS && !BR2_PTHREADS_OLD
-	# no NPTL for these archs
-	depends on !BR2_avr32 && !BR2_xtensa && !BR2_arc
+	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL
 	help
 	  Set of utilities for testing the real-time behaviour of a
 	  Linux system.
@@ -23,7 +19,5 @@ config BR2_PACKAGE_RT_TESTS
 
 	  http://rt.wiki.kernel.org
 
-comment "rt-tests needs a toolchain w/ threads"
-	depends on !BR2_PTHREADS && !BR2_PTHREADS_OLD
-	depends on !BR2_avr32 && !BR2_xtensa && !BR2_arc
-	depends on !BR2_TOOLCHAIN_HAS_THREADS
+comment "rt-tests needs a toolchain w/ NPTL threads"
+	depends on !BR2_TOOLCHAIN_HAS_THREADS_NPTL
Signature · 1 line
1.8.3.2
#13 lore raw

PATCH 4/6 sconeserver: use BR2_TOOLCHAIN_HAS_THREADS_NPTL

In reply to Thomas Petazzoni
---
 package/sconeserver/Config.in | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
package/sconeserver/Config.in +3 -9
index ccb9c00..ac7a2b9 100644
@@ -1,11 +1,7 @@
 menuconfig BR2_PACKAGE_SCONESERVER
 	bool "sconeserver"
 	depends on BR2_INSTALL_LIBSTDCPP
-	depends on BR2_TOOLCHAIN_HAS_THREADS
-	# pthread_setschedprio needs NPTL
-	depends on !BR2_PTHREADS && !BR2_PTHREADS_OLD
-	# no NPTL for these archs
-	depends on !BR2_avr32 && !BR2_xtensa && !BR2_arc
+	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL
 	select BR2_PACKAGE_PCRE
 	help
 	  Sconeserver is a modular, object-orientated and extremely versatile
@@ -102,7 +98,5 @@ comment "ui module requires X.org"
 
 endif # BR2_PACKAGE_SCONESERVER
 
-comment "sconeserver needs a toolchain w/ C++, threads"
-	depends on !(BR2_INSTALL_LIBSTDCPP && BR2_TOOLCHAIN_HAS_THREADS)
-	depends on !BR2_PTHREADS && !BR2_PTHREADS_OLD
-	depends on !BR2_avr32 && !BR2_xtensa && !BR2_arc
+comment "sconeserver needs a toolchain w/ C++, NPTL threads"
+	depends on !(BR2_INSTALL_LIBSTDCPP && BR2_TOOLCHAIN_HAS_THREADS_NPTL)
Signature · 1 line
1.8.3.2
#14 lore raw

PATCH 5/6 tvheadend: use BR2_TOOLCHAIN_HAS_THREADS_NPTL

In reply to Thomas Petazzoni
---
 package/tvheadend/Config.in | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
package/tvheadend/Config.in +3 -9
index da60f83..ac4a192 100644
@@ -1,22 +1,16 @@
-comment "tvheadend needs a toolchain w/ largefile, IPv6, threads"
-	depends on !BR2_avr32 && !BR2_xtensa && !BR2_arc
-	depends on !BR2_PTHREADS && !BR2_PTHREADS_OLD
-	depends on !BR2_LARGEFILE || !BR2_INET_IPV6 || !BR2_TOOLCHAIN_HAS_THREADS
+comment "tvheadend needs a toolchain w/ largefile, IPv6, NPTL threads"
+	depends on !BR2_LARGEFILE || !BR2_INET_IPV6 || !BR2_TOOLCHAIN_HAS_THREADS_NPTL
 
 config BR2_PACKAGE_TVHEADEND
 	bool "tvheadend"
 	depends on BR2_LARGEFILE && BR2_INET_IPV6
-	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL
 	# tvheadend requires an atomic_add operation. Either you have
 	# a gcc >= 4.3 toolchain and it uses the gcc intrinsics, or it
 	# has special code for x86, x86-64, PPC and ARM. So in the
 	# context of Buildroot, the only really problematic
 	# architecture is avr32, which uses gcc 4.2.
 	depends on !BR2_avr32
-	# clock_nanosleep needs NPTL
-	depends on !BR2_PTHREADS && !BR2_PTHREADS_OLD
-	# no NPTL for these archs
-	depends on !BR2_xtensa && !BR2_arc
 	select BR2_PACKAGE_DVB_APPS
 	select BR2_PACKAGE_OPENSSL
 	help
Signature · 1 line
1.8.3.2
#15 lore raw

PATCH 6/6 qt5: needs NPTL threads

In reply to Thomas Petazzoni

Fixes:

http://autobuild.buildroot.org/results/70b/70b77e7a5b292e3fcbcf8cab4651c48220f2bd17/

---
 package/qt5/Config.in | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
package/qt5/Config.in +3 -3
index b62a810..597dbd1 100644
@@ -6,10 +6,10 @@ config BR2_PACKAGE_QT5_JSCORE_AVAILABLE
 	depends on !(BR2_arm7tdmi || BR2_arm720t || BR2_arm920t || BR2_arm922t || BR2_fa526)
 	default y
 
-comment "Qt5 needs a toolchain w/ wchar, IPv6, threads, C++"
+comment "Qt5 needs a toolchain w/ wchar, IPv6, NPTL threads, C++"
 	depends on !BR2_PACKAGE_QT
 	depends on !BR2_avr32
-	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR || !BR2_INET_IPV6 || !BR2_TOOLCHAIN_HAS_THREADS
+	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR || !BR2_INET_IPV6 || !BR2_TOOLCHAIN_HAS_THREADS_NPTL
 
 menuconfig BR2_PACKAGE_QT5
 	bool "Qt5"
@@ -17,7 +17,7 @@ menuconfig BR2_PACKAGE_QT5
 	depends on BR2_INSTALL_LIBSTDCPP
 	depends on BR2_USE_WCHAR
 	depends on BR2_INET_IPV6
-	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL
 	depends on !BR2_PACKAGE_QT
 	help
 	  This option enables the Qt5 framework. Sub-options allow to
Signature · 1 line
1.8.3.2
#16 lore raw

cover Add toolchain knob for NPTL

In reply to Thomas Petazzoni
Quoted 10 lines · On Thu, 13 Feb 2014 14:22:01 +0100 Thomas Petazzoni…

We have a growing number of packages that need pthread functions only available when the NPTL implementation is used. But at the same time, we have several architectures (AVR32, ARC, Blackfin and Xtensa) that don't support NPTL.

This set of commits adds a new hidden toolchain config knob named BR2_TOOLCHAIN_HAS_THREADS_NPTL, and uses it in four packages: three were already having special conditions to more-or-less detect the availability of NPTL, and one package (qt5) which fixes an autobuilder failure.

*NIT* :

With the line length limitations, shouldn't variable names be kept to less than 1/2 the line length limits? ;)

Rhetorical:
Can a toolchain **without threads** support NPTL ?

With the above considerations, perhaps the knob could be:
BR2_TOOLCHAIN_NPTL

- - - -

Sorry for the noise, mind is not fully in-gear this morning. Mike

#17 lore raw

cover Add toolchain knob for NPTL

Dear Mike Zick,

Quoted 2 lines · Mike Zick

With the line length limitations, shouldn't variable names be kept to less than 1/2 the line length limits? ;)

BR2_TOOLCHAIN_HAS_THREADS_NPTL is only 30 characters, which is less than 1/2 the line length limit :)

Quoted 2 lines

Rhetorical:
Can a toolchain **without threads** support NPTL ?

No, indeed not.

Quoted 2 lines

With the above considerations, perhaps the knob could be:
BR2_TOOLCHAIN_NPTL

I don't like this, because it's not very expressive. I could reduce it to BR2_TOOLCHAIN_HAS_NPTL indeed, but I find BR2_TOOLCHAIN_HAS_THREADS_NPTL to be more expressive. Do others have different opinions?

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com