Python on Arm, illegal instructions

I am trying to compile Python 3.2 for ARM920T (4T architecture), 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 a crossword compiler.

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

It compiles into scratchbox, and I can run the python interpreter with the armbox emulator.

However, when I move it to my ARM920T, I immediately get an illegal instruction error after running python exe.

A core dump produces 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

, __aeabi_dadd (Double Add).

python, backtrace (longobject.c 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;
            }

, . ++, // e.t.c , , .


. , , , , , exe. , ARM920T .

. Python -Wcast-align . ARM , . /proc/cpu/alignment .

, , :)

+5
2

!

- , make, , gcc -march=armv4t.

, SBOX_EXTRA_COMPILER_FLAGS. SBOX_EXTRA_COMPILER_ARGS. CFLAGS -march=armv4t Python .

, , , !

+3

, - , , , . CodeSourcery ARMv4. , CodeSourcery ARMv5. , , - . build- script, , , , ?

+2

All Articles