Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7625627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:13:01+00:00 2026-05-31T05:13:01+00:00

I am trying to compile Python 3.2 for an ARM920T (architecture 4T) but I

  • 0

I am trying to compile Python 3.2 for an ARM920T (architecture 4T) but I am getting some strange errors.

I am compiling Python inside a Scratchbox environment, configured to use the following compiler: “gcc version 4.3.3 (Sourcery G++ Lite 2009q1-203)” which is an arm cross compiler.

When compiling I have made sure to set the -march=armv4t architecture flag, in the following environment variables: CFLAGS, CPPFLAGS, SBOX_EXTRA_COMPILER_FLAGS.

It compiles fine in scratchbox, and I am able to run the python interpreter with the scratchbox arm emulator.

When I move it to my ARM920T however, I get an Illegal Instruction error immeadiately after running the python exe.

A core dump yeilds the following output:

Program terminated with signal 4, Illegal instruction.
#0 0x00138810 in __aeabi_dadd ()

And the first few lines of the back-trace:

#0  0x00138810 in __aeabi_dadd ()
#1  0x001134f4 in PyLong_FromString (str=0x402de300 "3644798167", pend=0x0, base=10) at Objects/longobject.c:2001
#2  0x00132478 in parsenumber (s=<value optimized out>, c=<value optimized out>) at Python/ast.c:3189
#3  ast_for_atom (n=<value optimized out>, c=<value optimized out>) at Python/ast.c:1396
#4  ast_for_power (n=<value optimized out>, c=<value optimized out>) at Python/ast.c:1726
#5  ast_for_expr (c=0xbeaf7f50, n=0x402f5b78) at Python/ast.c:191

As far as I have been able to research, the __aeabi_dadd call is a library call for adding two floating point numbers (Double Add).

I looked up the python code which the backtrace reports is causing the error (longobject.c line 2001):

if (log_base_BASE[base] == 0.0) {
            twodigits convmax = base;
            int i = 1;

            log_base_BASE[base] = (log((double)base) /        // Line 2001
                                   log((double)PyLong_BASE));
            for (;;) {
                twodigits next = convmax * base;
                if (next > PyLong_BASE)
                    break;
                convmax = next;
                ++i;
            }

I dont really see why this code should cause any errors. I tried making a small C++ program which added/subtracted/divided e.t.c a lot of doubles, like in the code above, and it ran fine on the device.


Any help would be much appreciated. The only things I can think of is that perhaps the wrong floating point library is being compiled into the exe. The ARM920T does not have hardware floating point support as far as I could tell from Google.

Another cause could be alignment errors. When compiling Python with the -Wcast-align flag, it does report a few casting warnings. The ARM doesn’t like it when certain data-types are not aligned at even addresses in memory. /proc/cpu/alignment does not report anything however.

Sorry for the wall of text, thanks if you read this far 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T05:13:02+00:00Added an answer on May 31, 2026 at 5:13 am

    I found the solution!

    I made a file-dump of everything spewed out on the console during the make call, and I noticed that a few calls to gcc did not contain the -march=armv4t option.

    I noticed that I had spelled the SBOX_EXTRA_COMPILER_FLAGS wrong. It should be SBOX_EXTRA_COMPILER_ARGS. With that set, and CFLAGS set to -march=armv4t Python now successfully builds and runs without illegal instructions.

    Thanks Leo, for pointing me in the right direction!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to compile to an exe my script of python, but I'm getting
I'm trying to compile Vim 7.2 with Python 2.5.1 support, but I'm having some
I'm trying to compile Python 2.6 for 64bit, I tried various compile commands but
I'm trying to compile a Python binding, but I'm unable to find the python.h
Im trying to follow some python code using Ctrl +click, but Im trying to
I'm trying to compile my python script into a single .exe using gui2exe (which
Trying to compile a iPhone/iPad application with SDK3.2 and am getting this error: Undefined
When trying to compile GNU software on HP-UX (binutils for example) I'm getting error
When trying to compile the following code, I am getting a warning that line
While trying to compile my project, that uses some third party headers, with mingw

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.