Skip to contentSkip to conversation

package/xenomai: introduce a BR2_PACKAGE_XENOMAI_ARCH_SUPPORTS option

PATCH New Romain Naour 2 participants 4 messages Aug 1, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 package/xenomai: introduce a BR2_PACKAGE_XENOMAI_ARCH_SUPPORTS option

Introduce BR2_PACKAGE_XENOMAI_ARCH_SUPPORTS to hold the architectures than can build and use Xenomai on the target.

---
 package/xenomai/Config.in | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
package/xenomai/Config.in +8 -4
index d4c8a89..a4a2795 100644
@@ -1,13 +1,17 @@
-comment "xenomai needs a toolchain w/ threads"
-	depends on !BR2_TOOLCHAIN_HAS_THREADS
+config BR2_PACKAGE_XENOMAI_ARCH_SUPPORTS
+	bool
+	default y
 	depends on BR2_i386 || BR2_x86_64 || BR2_arm || \
 		   BR2_bfin || BR2_powerpc || BR2_sh4
 
+comment "xenomai needs a toolchain w/ threads"
+	depends on !BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_PACKAGE_XENOMAI_ARCH_SUPPORTS
+
 config BR2_PACKAGE_XENOMAI
 	bool "Xenomai Userspace"
+	depends on BR2_PACKAGE_XENOMAI_ARCH_SUPPORTS
 	depends on BR2_TOOLCHAIN_HAS_THREADS
-	depends on BR2_i386 || BR2_x86_64 || BR2_arm || \
-		BR2_bfin || BR2_powerpc || BR2_sh4
 	help
 	  Real-Time Framework for Linux
 	  http://www.xenomai.org
Signature · 1 line
2.5.5
#1 lore raw

PATCH 2/3 package/xenomai: disable for cortex-M cpus

Following include/asm-arm/features.h, Xenomai doesn't support cortex-M cpus.

error "Could not find current ARM architecture"

Fixes:
http://autobuild.buildroot.net/results/06a/06a52b2c2c23df595f58feb6b95437fc65a86d31

---
 package/xenomai/Config.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/xenomai/Config.in +2 -2
index a4a2795..3de7bde 100644
@@ -1,8 +1,8 @@
 config BR2_PACKAGE_XENOMAI_ARCH_SUPPORTS
 	bool
 	default y
-	depends on BR2_i386 || BR2_x86_64 || BR2_arm || \
-		   BR2_bfin || BR2_powerpc || BR2_sh4
+	depends on BR2_i386 || BR2_x86_64 || (BR2_arm && !BR2_ARM_CPU_ARMV7M) || \
+		BR2_bfin || BR2_powerpc || BR2_sh4
 
 comment "xenomai needs a toolchain w/ threads"
 	depends on !BR2_TOOLCHAIN_HAS_THREADS
Signature · 1 line
2.5.5
#2 lore raw

PATCH 3/3 package/xenomai: disable for musl toolchains

In reply to Romain Naour

After fixing the <bits/local_lim.h> issue by using <limits.h>, the build still fail with udefined __WORDSIZE.

Adding <sys/user.h> to define __WORDSIZE reveal that xenomai use <error.h> which is not provided by musl.

The discussion on the musl mailing list [1] about glibc error reporting functions concluded to not add this support in the C library.

For now, disable Xenomai user space support for musl toolchains since it require several patches to build correctly and needs to remove each glibc error reporting functions.

Users interested in musl support for Xenomai can work with upstream to fix these issues and revert this patch.

[1] http://www.openwall.com/lists/musl/2014/06/29/8

Fixes:
http://autobuild.buildroot.net/results/e36/e36a21c1df33bdd3fbc61d516a3e8f7c5f7c41af

---
 package/xenomai/Config.in | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
package/xenomai/Config.in +4 -2
index 3de7bde..32c5124 100644
@@ -4,14 +4,16 @@ config BR2_PACKAGE_XENOMAI_ARCH_SUPPORTS
 	depends on BR2_i386 || BR2_x86_64 || (BR2_arm && !BR2_ARM_CPU_ARMV7M) || \
 		BR2_bfin || BR2_powerpc || BR2_sh4
 
-comment "xenomai needs a toolchain w/ threads"
-	depends on !BR2_TOOLCHAIN_HAS_THREADS
+comment "xenomai needs an glibc or uClibc toolchain w/ threads"
+	depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_TOOLCHAIN_USES_MUSL
 	depends on BR2_PACKAGE_XENOMAI_ARCH_SUPPORTS
 
 config BR2_PACKAGE_XENOMAI
 	bool "Xenomai Userspace"
 	depends on BR2_PACKAGE_XENOMAI_ARCH_SUPPORTS
 	depends on BR2_TOOLCHAIN_HAS_THREADS
+	# uses <error.h>, __WORDSIZE and bits/local_lim.h
+	depends on !BR2_TOOLCHAIN_USES_MUSL
 	help
 	  Real-Time Framework for Linux
 	  http://www.xenomai.org
Signature · 1 line
2.5.5
#3 lore raw

PATCH 1/3 package/xenomai: introduce a BR2_PACKAGE_XENOMAI_ARCH_SUPPORTS option

In reply to Romain Naour

Hello,

Quoted 7 lines · Romain Naour

Introduce BR2_PACKAGE_XENOMAI_ARCH_SUPPORTS to hold the architectures than can build and use Xenomai on the target.

---
 package/xenomai/Config.in | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

Series applied, thanks!

Thomas

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