Project

General

Profile

Bug #9594

Python 2.7 SPARC build needs an adjusted patch and a new patch

Added by Gary Mills over 1 year ago. Updated over 1 year ago.

Status:
New
Priority:
Normal
Assignee:
Category:
OI-Userland
Target version:
-
Start date:
2018-06-13
Due date:
% Done:

0%

Estimated time:
Difficulty:
Bite-size
Tags:
needs-triage

Description

In an attempt to build python2.7 on a T2000 (SPARC), I received this error:

    /usr/gcc/4.4.4/bin/gcc -m32 -O3 -mno-app-regs -fPIC -DPIC -std=c99 -D_XOPEN_SOURCE=600 -m32 -fPIC -DPIC -R/usr/gnu/lib -L/usr/gnu/lib  -o python \
            Modules/python.o \
            -L. -lpython2.7 -lsocket -lnsl -ldl    -lm  
    Undefined            first referenced
     symbol                  in file
    asm                                 ./libpython2.7.so
    ld: fatal: symbol referencing errors. No output written to python
    collect2: ld returned 1 exit status

This happens because Python/ceval.c contains two instances of code like this:

      #if defined(__sparc)
    +     asm("nop");
      #endif

This code was inserted by a patch called 05-dtrace.patch . The file dtrace.patch.diff, attached to a message with this same title posted to the oi-dev mailing list, shows the changes I made to the patch. These changes fix the problem by replacing asm with asm volatile .

One of the modules also failed to build, producing these errors:

    /export/home/mills/Downloads/code/oi-userland/components/python/python27/Python-2.7.14/Modules/_ctypes/libffi/src/sparc/ffi.c:526: error: 'asm' undeclared (first use in this function)
    /export/home/mills/Downloads/code/oi-userland/components/python/python27/Python-2.7.14/Modules/_ctypes/libffi/src/sparc/ffi.c:526: error: expected ';' before 'volatile'

The new patch 31-sparc.patch, also attached to that message, fixes this problem by replacing asm volatile with asm volatile . Finally, I updated COMPONENT_REVISION in the Makefile to signal the presence of the adjusted patch and the new one as in the file Makefile.diff .

These changes only affect the SPARC build. Later python versions likely require the same changes, but I haven't checked.


Files

31-sparc.patch (1.33 KB) 31-sparc.patch Gary Mills, 2018-06-13 07:00 PM
dtrace.patch.diff (359 Bytes) dtrace.patch.diff Gary Mills, 2018-06-13 07:01 PM
Makefile.diff (463 Bytes) Makefile.diff Gary Mills, 2018-06-13 07:02 PM

History

#1

Updated by Gary Mills over 1 year ago

Since the editor messed up my comments, changing a variable with leading and trailing underscores into an Italic font, I'll attach the files here too.

Also available in: Atom PDF