[oi-dev] Python 2.7 SPARC build needs an adjusted patch and a new patch
Aurélien Larcher
aurelien.larcher at gmail.com
Mon Jun 4 00:59:40 UTC 2018
On Mon, Jun 4, 2018 at 2:26 AM, Gary Mills <gary_mills at fastmail.fm> wrote:
> 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 this message, shows the changes I made
> to the patch. These changes fix the problem.
>
> 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, fixes this problem.
> 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, also attached.
>
> These changes only affect the SPARC build. Later python versions
> likely require the same changes, but I haven't checked.
>
> I'd appreciate it if somebody could verify that these changes are
> correct. I assume they are. The build completes after these changes
> are made.
>
Why not just activate GNU extensions with -std=gnu99?
Python 2.7 was probably compiled with them until I added -std=c99.
>
>
> --
> -Gary Mills- -refurb- -Winnipeg, Manitoba,
> Canada-
>
> _______________________________________________
> oi-dev mailing list
> oi-dev at openindiana.org
> https://openindiana.org/mailman/listinfo/oi-dev
>
--
---
Praise the Caffeine embeddings
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://openindiana.org/pipermail/oi-dev/attachments/20180604/3c1f4d9d/attachment-0005.html>
More information about the oi-dev
mailing list