Verizon Fios Tech Support

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Thursday, 31 January 2013

How to build Python-4-Android for the ARM Neon

Posted on 15:09 by Unknown
Currently the Py4A project does not compile for the ARM Neon architecture. If you try to run ndk-build on the project by setting the APP_ABI to armeabi-v7a and setting the LOCAL_ARM_NEON variable to true, you get the following error:





libffi/src/arm/sysv.S: Assembler messages:
libffi/src/arm/sysv.S:203: Error: selected processor does not support ARM mode `stfeqs f0,[r2]'
libffi/src/arm/sysv.S:208: Error: selected processor does not support ARM mode `stfeqd f0,[r2]'
libffi/src/arm/sysv.S:283: Error: selected processor does not support ARM mode `ldfs f0,[sp]'
libffi/src/arm/sysv.S:286: Error: selected processor does not support ARM mode `ldfd f0,[sp]'
libffi/src/arm/sysv.S:289: Error: selected processor does not support ARM mode `ldfd f0,[sp]'
make: *** [obj/local/armeabi-v7a/objs/ffi/src/arm/sysv.o] Error 1


The following patch for the python-build/libffi/src/asm/sysv.S file allows you to cross-compile Py4A for the armeabi-v7a ABI and also for the Neon instruction set. The patch consists in appropriately changing the conditionals containing __SOFTFP__ and adding __SOFTFP__ || __ARM_EABI__.
For example to build for the ARM Neon instruction set, the ndk-build command line in build.sh should be the following:

ndk-build APP_ABI:=armeabi-v7a LOCAL_ARM_NEON:=true


--- libffi/src/arm/a/sysv.S    2013-01-30 14:49:29.711595414 -0500
+++ libffi/src/arm/sysv.S    2013-01-31 18:05:07.376178842 -0500
@@ -189,7 +189,7 @@ ARM_FUNC_START ffi_call_SYSV
 
 @ return INT
     cmp    r3, #FFI_TYPE_INT
-#ifdef __SOFTFP__
+#if defined(__SOFTFP__) || defined(__ARM_EABI__)
     cmpne    r3, #FFI_TYPE_FLOAT
 #endif
     streq    r0, [r2]
@@ -197,12 +197,12 @@ ARM_FUNC_START ffi_call_SYSV
 
     @ return INT64
     cmp    r3, #FFI_TYPE_SINT64
-#ifdef __SOFTFP__
+#if defined(__SOFTFP__) || defined(__ARM_EABI__)
     cmpne    r3, #FFI_TYPE_DOUBLE
 #endif
     stmeqia    r2, {r0, r1}
 
-#ifndef __SOFTFP__
+#if !defined(__SOFTFP__) && !defined(__ARM_EABI__)
     beq    LSYM(Lepilogue)
 
 @ return FLOAT
@@ -245,21 +245,21 @@ ARM_FUNC_START ffi_closure_SYSV
     beq    .Lretint
 
     cmp    r0, #FFI_TYPE_FLOAT
-#ifdef __SOFTFP__
+#if defined(__SOFTFP__) || defined(__ARM_EABI__)
     beq    .Lretint
 #else
     beq    .Lretfloat
 #endif
 
     cmp    r0, #FFI_TYPE_DOUBLE
-#ifdef __SOFTFP__
+#if defined(__SOFTFP__) || defined(__ARM_EABI__)
     beq    .Lretlonglong
 #else
     beq    .Lretdouble
 #endif
 
     cmp    r0, #FFI_TYPE_LONGDOUBLE
-#ifdef __SOFTFP__
+#if defined(__SOFTFP__) || defined(__ARM_EABI__)
     beq    .Lretlonglong
 #else
     beq    .Lretlongdouble
@@ -278,7 +278,7 @@ ARM_FUNC_START ffi_closure_SYSV
     ldr    r1, [sp, #4]
     b    .Lclosure_epilogue
 
-#ifndef __SOFTFP__
+#if !defined(__SOFTFP__) && !defined(__ARM_EABI__)
 .Lretfloat:
     ldfs    f0, [sp]
     b    .Lclosure_epilogue


Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in Android, ARM, Python | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • Problems with new version of rpmbuild
    The Problem With the new version of rpmbuild installed on CentOS 6.x, if you try to use an old RPM spec file, you will get an error like the...
  • Meeting The Tate's
       Hello, we are Cody and Aimee Tate. We live in Florida and have been married for 3 years. Recently we have decided to start doing product ...
  • Installing the Android SDK
    These instructions refer to a Ubuntu 12.04.1 LTS system running on an Intel processor. Head to the developer.android.com web site and downl...
  • How to Cross-Compile libiconv for Android
    If your legacy C/C++ code includes <iconv.h> to convert the encoding of characters from one coded character set to another, and you ne...
  • Free Blogger Opp – Timjan Design Malachite 5/1
    Here comes another Visionary Bri blogger opportunity. Sign up now for the Timjan Bloomers Giveaway. Our sponsor, Timjan Design , has offered...
  • Python For Android (Py4A)
    A better solution for cross-compiling Python for Android is to use the Py4A project which is made to be used together with SL4A (Scripting L...
  • PAINT released to the public for Research Purposes Only
    Digital Operatives is proud to release to the public for Research Purposes Only, a beta version of PAINT, Process Attribution In Network Tra...
  • Arduino and 7-segment LED counter driven by two tactile switches
    I have posted on YouTube a couple of videos about a project I made with the Arduino prototype board. The circuit uses an Arduino mini and ...
  • Transferring Files from a computer to your Android device
    Android devices have file systems similar to regular computers. Subject to permissions restrictions, we can transfer files from a computer t...
  • Free Blogger Op Getting Ready for Summer Giveaway
    Hosted by:   NYSavingSpecials   and  Your Fashion Resource Come and join us on this great giveaway "Getting ready for Summer" We w...

Categories

  • amazon
  • amazon.com
  • Android
  • Apple
  • Arduino
  • ARM
  • baby
  • baby reviews
  • back to school
  • beef jerky
  • bicycle. wagon
  • bike
  • Blanket Buddies
  • blogging
  • Blogging with The Tate's
  • books
  • busybox
  • camera
  • camera giveaway
  • candle giveaway
  • candles
  • CaseApp
  • CentOS
  • coffee
  • david haskell
  • dermorganic
  • DHCP
  • digital camera
  • events
  • Florida
  • Fortran
  • free blogger giveaway
  • free blogger sign-ups
  • full of flavor
  • giveaways
  • GNU
  • GPON
  • hair care
  • happy husband
  • Hot tea
  • Husband and Wife perspective
  • iMac
  • ipad
  • iphone
  • iphone case
  • iphone case review
  • Javascript
  • Keurig Coffee Review
  • Keurig Review
  • Kindle
  • ksh
  • LifeProof iPhone Case Review
  • Linux
  • MacOSX
  • Malachite Bloomers
  • man and women perspective
  • meat
  • Mips
  • Network
  • Pretzel Crisps
  • Pretzels
  • product reviews
  • products
  • Python
  • Router
  • scentsy
  • scentsy candles
  • school
  • scooter
  • security system
  • skin care
  • snacks
  • sony
  • sony cyber-shot
  • Stuff Animal
  • suface pro
  • Summer
  • summer fun
  • surface pro giveaway
  • techno thriller
  • Timjan Design
  • too much information
  • UNIX
  • vegan
  • vegan products
  • verizon
  • verizon fios
  • VitaminsBaby
  • waterproof case
  • Windows
  • x86
  • yummy

Blog Archive

  • ▼  2013 (41)
    • ►  November (2)
    • ►  October (2)
    • ►  September (3)
    • ►  August (3)
    • ►  July (2)
    • ►  June (2)
    • ►  May (6)
    • ►  April (8)
    • ►  March (2)
    • ►  February (5)
    • ▼  January (6)
      • How to build Python-4-Android for the ARM Neon
      • How to build Python-4-Android for the x86
      • Android: Trying to load native library results in ...
      • How to port Mozilla SpiderMonkey 1.7 to Android
      • How to inspect expanded C macros with gcc/gcc+
      • Upgrading mid-2007 24in iMac with an SSD and a 2.5...
  • ►  2012 (17)
    • ►  December (3)
    • ►  November (4)
    • ►  October (8)
    • ►  July (1)
    • ►  June (1)
Powered by Blogger.

About Me

Unknown
View my complete profile