Accepting request 183765 from Cloud:OpenStack:Master

OBS-URL: https://build.opensuse.org/request/show/183765
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-greenlet?expand=0&rev=11
This commit is contained in:
Sascha Peilicke 2013-08-05 14:03:54 +00:00 committed by Git OBS Bridge
parent 887d060850
commit e39e653574
2 changed files with 7 additions and 94 deletions

View File

@ -1,88 +0,0 @@
--- ./slp_platformselect.h.mm 2012-05-12 22:56:32.000000000 +0000
+++ ./slp_platformselect.h 2013-04-08 11:28:47.000000000 +0000
@@ -32,4 +32,6 @@
#include "platform/switch_arm32_gcc.h" /* gcc using arm32 */
#elif defined(__GNUC__) && defined(__mips__) && defined(__linux__)
#include "platform/switch_mips_unix.h" /* Linux/MIPS */
+#elif defined(__GNUC__) && defined(__aarch64__)
+#include "platform/switch_aarch64_gcc.h" /* Aarch64 ABI */
#endif
--- ./platform/switch_aarch64_gcc.h.mm 2013-04-13 21:40:23.000000000 +0000
+++ ./platform/switch_aarch64_gcc.h 2013-04-13 21:41:39.000000000 +0000
@@ -0,0 +1,76 @@
+/*
+ * this is the internal transfer function.
+ *
+ * HISTORY
+ * 13-Apr-13 Add support for strange GCC caller-save decisions
+ * 08-Apr-13 File creation. Michael Matz
+ *
+ * NOTES
+ *
+ * Simply save all callee saved registers
+ *
+ */
+
+#define STACK_REFPLUS 1
+
+#ifdef SLP_EVAL
+#define STACK_MAGIC 0
+#define REGS_TO_SAVE "r19", "r20", "r21", "r22", "r23", "r24", "r25", "r26", \
+ "r27", "r28", "r30" /* aka lr */, \
+ "v8", "v9", "v10", "v11", \
+ "v12", "v13", "v14", "v15"
+
+/* See below for the purpose of this function. */
+__attribute__((noinline, noclone)) int fancy_return_zero(void);
+__attribute__((noinline, noclone)) int
+fancy_return_zero(void)
+{
+ return 0;
+}
+
+static int
+slp_switch(void)
+{
+ int err = 0;
+ void *fp;
+ register long *stackref, stsizediff;
+ __asm__ volatile ("" : : : REGS_TO_SAVE);
+ __asm__ volatile ("str x29, %0" : "=m"(fp) : : );
+ __asm__ ("mov %0, sp" : "=r" (stackref));
+ {
+ SLP_SAVE_STATE(stackref, stsizediff);
+ __asm__ volatile (
+ "add sp,sp,%0\n"
+ "add x29,x29,%0\n"
+ :
+ : "r" (stsizediff)
+ );
+ SLP_RESTORE_STATE();
+ /* SLP_SAVE_STATE macro contains some return statements
+ (of -1 and 1). It falls through only when
+ the return value of slp_save_state() is zero, which
+ is placed in x0.
+ In that case we (slp_switch) also want to return zero
+ (also in x0 of course).
+ Now, some GCC versions (seen with 4.8) think it's a
+ good idea to save/restore x0 around the call to
+ slp_restore_state(), instead of simply zeroing it
+ at the return below. But slp_restore_state
+ writes random values to the stack slot used for this
+ save/restore (from when it once was saved above in
+ SLP_SAVE_STATE, when it was still uninitialized), so
+ "restoring" that precious zero actually makes us
+ return random values. There are some ways to make
+ GCC not use that zero value in the normal return path
+ (e.g. making err volatile, but that costs a little
+ stack space), and the simplest is to call a function
+ that returns an unknown value (which happens to be zero),
+ so the saved/restored value is unused. */
+ err = fancy_return_zero();
+ }
+ __asm__ volatile ("ldr x29, %0" : : "m" (fp) :);
+ __asm__ volatile ("" : : : REGS_TO_SAVE);
+ return err;
+}
+
+#endif

View File

@ -1,35 +1,36 @@
#
# spec file for package python-greenlet
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2010 B1 Systems GmbH, Vohburg, Germany.
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "O2en Source License" is a
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: python-greenlet
Version: 0.4.1
Release: 0
URL: http://pypi.python.org/pypi/greenlet
Url: http://pypi.python.org/pypi/greenlet
Summary: Lightweight in-process concurrent programming
License: MIT
Group: Development/Libraries/Python
Source0: http://pypi.python.org/packages/source/g/greenlet/greenlet-%{version}.zip
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: gcc-c++
BuildRequires: python-Sphinx
BuildRequires: python-devel
BuildRequires: python-distribute
BuildRequires: unzip
BuildRequires: gcc-c++
BuildRequires: python-Sphinx
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitearch: %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%endif