Skip to contentSkip to conversation

blackfin and micropython

Buildroot Superseded Chris Packham 3 participants 5 messages Sep 21, 2015 – Sep 22, 2015

lore
Share & tools
lore
#0 lore raw

Hi,

I'm just looking at the micropython build failures and the blackfin ones have have me a bit stumped.

The ones currently showing up[1] are format specifier errors. The code in question[2] doesn't look particularly bad and other architectures/compilers aren't complaining I guess it is getting confused with the math around const byte * and unsigned int. I can work around that issue by adding -Wno-error=format to CFLAGS for BR2_bfin. But that leads to the next issue.

modffi.c:87: error: expected specifier-qualifier-list before ?ffi_closure? modffi.c: In function ?mod_ffi_callback?:
modffi.c:248: error: ?mp_obj_fficallback_t? has no member named ?clo?

I think these are because nothing defines FFI_CLOSURES. ffitarget.h for bfin seems a lot sparser than for other architectures so I'm thinking that's the problem.

I notice python, python3 and guile are not available for bfin. Not that they explicitly exclude it but probably because of on of the other dependencies they all have.

I'm not really familiar with bfin so I'm wondering if I should pursue the libffi angle to try and get something that builds. Or look at the dependencies of python/python3 and make micropython unavailable for bfin.

Any thoughts/guidance?

Thanks,
Chris
--
[1] - http://autobuild.buildroot.org/results/cd2/cd21ee5ca3ca441aa2941e8d2729afa99d0403f0/build-end.log
[2] - https://github.com/micropython/micropython/blob/master/py/showbc.c#L294

#1 lore raw

Chris,

Quoted 14 lines · Chris Packham

I'm just looking at the micropython build failures and the blackfin ones have have me a bit stumped.

The ones currently showing up[1] are format specifier errors. The code in question[2] doesn't look particularly bad and other architectures/compilers aren't complaining I guess it is getting confused with the math around const byte * and unsigned int. I can work around that issue by adding -Wno-error=format to CFLAGS for BR2_bfin. But that leads to the next issue.

modffi.c:87: error: expected specifier-qualifier-list before ?ffi_closure? modffi.c: In function ?mod_ffi_callback?:
modffi.c:248: error: ?mp_obj_fficallback_t? has no member named ?clo?

Quoted 7 lines

I think these are because nothing defines FFI_CLOSURES. ffitarget.h for bfin seems a lot sparser than for other architectures so I'm thinking that's the problem.

I notice python, python3 and guile are not available for bfin. Not that they explicitly exclude it but probably because of on of the other dependencies they all have.

Python is not available because it depends on BR2_USE_MMU as it uses fork().

Guile is not available, because it depends on libatomic, which is not available on Blackfin.

None of these seem to apply to Micropython. However, it would be fine for me if you did:

	# libffi doesn't provide the closure implementation on Blackfin
	depends on !BR2_bfin

And that's it. The number of Blackfin developers using the mainline Buildroot seems very limited, so I don't think it's worth the effort fixing all packages, especially when the fix is non-trivial.

Best regards,

Thomas

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

PATCH 1/1 micropython: Disable for Blackfin

There are two problems building micropython for Blackfin. The first is some printf format specifier warnings/errors that seem to be triggered only for that architecture/compiler. This could be worked around by specifying CFLAGS=-Wno-error=format.

The second problem is that libffi doesn't provide the closure implementation on Blackfin. There is no known workaround for this issue.

For now disable micropython on Blackfin.

---
 package/micropython/Config.in | 2 ++
 1 file changed, 2 insertions(+)
package/micropython/Config.in +2 -0
index c62b3ab..4664494 100644
@@ -1,6 +1,8 @@
 config BR2_PACKAGE_MICROPYTHON
 	bool "micropython"
 	select BR2_PACKAGE_LIBFFI
+	# libffi doesn't provide the closure implementation on Blackfin
+	depends on !BR2_bfin
 	depends on BR2_TOOLCHAIN_HAS_THREADS
 	help
 	  Micro Python is a lean and fast implementation of the Python 3
Signature · 1 line
2.5.0
#3 lore raw

PATCH 1/1 micropython: Disable for Blackfin

Hi Chris,

Quoted 20 lines · Chris Packham

There are two problems building micropython for Blackfin. The first is some printf format specifier warnings/errors that seem to be triggered only for that architecture/compiler. This could be worked around by specifying CFLAGS=-Wno-error=format.

The second problem is that libffi doesn't provide the closure implementation on Blackfin. There is no known workaround for this issue.

For now disable micropython on Blackfin.

---
 package/micropython/Config.in | 2 ++
 1 file changed, 2 insertions(+)
package/micropython/Config.in +0 -0
index c62b3ab..4664494 100644

package/micropython/Config.in line 5

Quoted 5 lines
package/micropython/Config.in +2 -0
@@ -1,6 +1,8 @@
 config BR2_PACKAGE_MICROPYTHON
 	bool "micropython"
 	select BR2_PACKAGE_LIBFFI
+	# libffi doesn't provide the closure implementation on Blackfin
+	depends on !BR2_bfin

Please add the same dependency to the comment below. No need to repeat the explanation there. The reason is that the comment is useless when the package is disabled for the current architecture.

baruch

Quoted 3 lines
package/micropython/Config.in +0 -0
 	depends on BR2_TOOLCHAIN_HAS_THREADS
 	help
 	  Micro Python is a lean and fast implementation of the Python 3
Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
#4 lore raw

PATCH v2 1/1 micropython: Disable for Blackfin

There are two problems building micropython for Blackfin. The first is some printf format specifier warnings/errors that seem to be triggered only for that architecture/compiler. This could be worked around by specifying CFLAGS=-Wno-error=format.

The second problem is that libffi doesn't provide the closure implementation on Blackfin. There is no known workaround for this issue.

For now disable micropython on Blackfin.

---
Changes since v1:
- Supress comment section on bfin also
- Re-order depends to list !BR2_bfin last

 package/micropython/Config.in | 3 +++
 1 file changed, 3 insertions(+)
package/micropython/Config.in +3 -0
index c62b3ab..dae41b7 100644
@@ -2,6 +2,8 @@ config BR2_PACKAGE_MICROPYTHON
 	bool "micropython"
 	select BR2_PACKAGE_LIBFFI
 	depends on BR2_TOOLCHAIN_HAS_THREADS
+	# libffi doesn't provide the closure implementation on Blackfin
+	depends on !BR2_bfin
 	help
 	  Micro Python is a lean and fast implementation of the Python 3
 	  programming language that is optimised to run on a microcontroller.
@@ -10,3 +12,4 @@ config BR2_PACKAGE_MICROPYTHON
 
 comment "micropython needs a toolchain w/ threads"
 	depends on !BR2_TOOLCHAIN_HAS_THREADS
+	depends on !BR2_bfin
Signature · 1 line
2.5.0