Skip to contentSkip to conversation

libffi: prevent unsupported architectures

PATCH New Vincent Stehlé 2 participants 2 messages Oct 25, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libffi: prevent unsupported architectures

Disable architectures unsupported by libffi: Andes nds32 and thumb-only Arm (e.g. Cortex-M).

Cc Thomas Petazzoni <[email protected]>
---
 package/libffi/Config.in | 2 ++
 1 file changed, 2 insertions(+)
package/libffi/Config.in +2 -0
index 6edf570baf..6875947a6a 100644
@@ -1,6 +1,8 @@
 config BR2_PACKAGE_LIBFFI
 	bool "libffi"
 	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on !BR2_nds32
+	depends on (!BR2_arm && !BR2_armeb) || BR2_ARM_CPU_HAS_ARM
 	help
 	  The libffi library provides a portable, high level
 	  programming interface to various calling conventions. This
Signature · 1 line
2.23.0
#1 lore raw

PATCH 1/1 libffi: prevent unsupported architectures

Hello VIncent,

Quoted 5 lines · On Fri, 25 Oct 2019 22:27:14 +0200 Vincent Stehl? <[email protected]>…

Disable architectures unsupported by libffi: Andes nds32 and thumb-only Arm (e.g. Cortex-M).

Cc Thomas Petazzoni <[email protected]>

The problem is that it's not that simple: you would need to propagate those depends on too all packages that select BR2_PACKAGE_LIBFII, and then all reverse dependencies of those packages.

And since libffi is used by libglib2, that's a *HUGE* number of packages, and that's why we never did it.

We work around this problem currently in utils/genrandconfig to make sure that configurations that have libffi enabled, on the unsupported architectures are never tested. But that is obviously not ideal.

If you want to take a try at propagating the libffi dependencies to all reverse dependencies, it might be useful to see how it goes. Of course, you will have to introduce a BR2_PACKAGE_LIBFFI_ARCH_SUPPORTS in the first place.

package/libffi/Config.in line 5

Quoted 10 lines
package/libffi/Config.in +2 -0
index 6edf570baf..6875947a6a 100644
@@ -1,6 +1,8 @@
 config BR2_PACKAGE_LIBFFI
 	bool "libffi"
 	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on !BR2_nds32
+	depends on (!BR2_arm && !BR2_armeb) || BR2_ARM_CPU_HAS_ARM

In utils/genrandconfig, we simply exclude BR2_ARM_CPU_ARMV7M=y configuration.

We also exclude BR2_sh2a=y configurations.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com