Re: [oi-dev] Python 2.7 SPARC build needs an adjusted patch and a new patch

2018-06-03 Thread Aurélien Larcher
On Mon, Jun 4, 2018 at 2:26 AM, Gary Mills  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@openindiana.org
> https://openindiana.org/mailman/listinfo/oi-dev
>



-- 
---
Praise the Caffeine embeddings
___
oi-dev mailing list
oi-dev@openindiana.org
https://openindiana.org/mailman/listinfo/oi-dev

[oi-dev] Python 2.7 SPARC build needs an adjusted patch and a new patch

2018-06-03 Thread Gary Mills
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.


-- 
-Gary Mills--refurb--Winnipeg, Manitoba, Canada-
--- ../05-dtrace.patch-orig:: 
+++ 05-dtrace.patch:: 
@@ -96,7 +96,7 @@
 +   * Disable the tail call here.
 +   */
 +#if defined(__sparc)
-+  asm("nop");
++  __asm__ __volatile__("nop");
 +#endif
 +}
 +
@@ -117,7 +117,7 @@
 +   * Disable the tail call here.
 +   */
 +#if defined(__sparc)
-+  asm("nop");
++  __asm__ __volatile__("nop");
 +#endif
 +}
 +#else
--- Makefile-orig  :: 
+++ Makefile   :: 
@@ -18,6 +18,7 @@
 #
 # CDDL HEADER END
 #
+# Copyright 2018 Gary Mills
 # Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
 
 #
@@ -25,7 +26,7 @@
 
 COMPONENT_NAME=Python
 COMPONENT_VERSION= 2.7.14
-COMPONENT_REVISION=1
+COMPONENT_REVISION=2
 COMPONENT_PROJECT_URL= http://python.org/
 COMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
 COMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.xz
--- Python-2.7.14/Modules/_ctypes/libffi/src/sparc/ffi.c-orig  :: 
+++ Python-2.7.14/Modules/_ctypes/libffi/src/sparc/ffi.c   :: 
@@ -437,10 +437,10 @@
  call_struct[6] = 0x81c7e008;   /* ret 
 */
  call_struct[7] = 0xbe100017;   /* mov   %l7, %i7  
 */
 #ifdef __GNUC__
- asm volatile ("iflush %0; iflush %0+8; iflush %0+16; iflush 
%0+24" : :
+ __asm__ __volatile__ ("iflush %0; iflush %0+8; iflush %0+16; 
iflush %0+24" : :
"r" (call_struct) : "memory");
  /* SPARC v8 requires 5 instructions for flush to be visible */
- asm volatile ("nop; nop; nop; nop; nop");
+ __asm__ __volatile__ ("nop; nop; nop; nop; nop");
 #else
  ffi_flush_icache (call_struct, 32);
 #endif
@@ -523,11 +523,11 @@
   /* Flush the Icache.  closure is 8 bytes aligned.  */
 #ifdef __GNUC__
 #ifdef SPARC64
-  asm volatile ("flush %0; flush %0+8" : : "r" (closure) : "memory");
+  __asm__ __volatile__ ("flush %0; flush %0+8" : : "r" (closure) : "memory");
 #else
-  asm volatile ("iflush%0; iflush %0+8" : : "r" (closure) : "memory");
+  __asm__ __volatile__ ("iflush%0; iflush %0+8" : : "r" (closure) : 
"memory");
   /* SPARC v8 requires 5 instructions for flush to be visible */
-  asm volatile ("nop; nop; nop; nop; nop");
+  __asm__ __volatile__ ("nop; nop; nop; nop; nop");
 #endif
 #else
   ffi_flush_icache (closure, 16);
___
oi-dev mailing list
oi-dev@openindiana.org
https://openindiana.org/mailman/listinfo/oi-dev

[oi-dev] Move to category directories and pending component updates

2018-06-03 Thread Aurélien Larcher
Hi,
a while ago the decision was made to reorganize the components by category
in oi-userland as the number of items in 'components' directory made it
difficult to skim through the repo.

The layout is described at:

https://wiki.openindiana.org/oi/Categories+layout

Some weeks ago I scripted the move + some cosmetic modifications:

https://github.com/OpenIndiana/oi-userland/pull/3974

but 50 components still need to be processed: usually it means that these
components have not been touched in a while and need some love (update,
security patches, conversion to 64-bit).
Therefore instead of a blind mass move, a move-on-update would be better...

Would you be interested in starting to contribute to oi-userland, this is
one of the possible tracks.

You can choose one component in the list, cherry-pick the corresponding
commit from my branch, make it yours and update/patch the component if
applicable...

Kind regards,

Aurélien

-- 
---
Praise the Caffeine embeddings
___
oi-dev mailing list
oi-dev@openindiana.org
https://openindiana.org/mailman/listinfo/oi-dev