dev-python/pypy3: Restore non-SSE2 x86 backend
authorMichał Górny <mgorny@gentoo.org>
Thu, 15 Aug 2019 08:09:01 +0000 (10:09 +0200)
committerMichał Górny <mgorny@gentoo.org>
Thu, 15 Aug 2019 08:10:31 +0000 (10:10 +0200)
Signed-off-by: Michał Górny <mgorny@gentoo.org>
dev-python/pypy3/pypy3-7.1.1.ebuild
dev-python/pypy3/pypy3-9999.ebuild

index f0f7cdf74a2a0f8976665c79149d497f78066681..344f0da4013ea3678e1b0c13d39a2780c2f6a9f5 100644 (file)
@@ -17,7 +17,8 @@ LICENSE="MIT"
 # pypy3 -c 'import sysconfig; print(sysconfig.get_config_var("SOABI"))'
 SLOT="0/71-py36"
 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
-IUSE="bzip2 gdbm +jit libressl low-memory ncurses sandbox sqlite tk"
+IUSE="bzip2 cpu_flags_x86_sse2 gdbm +jit libressl low-memory ncurses
+       sandbox sqlite tk"
 
 RDEPEND=">=sys-libs/zlib-1.1.3:0=
        virtual/libffi:0=
@@ -103,12 +104,32 @@ src_prepare() {
 src_configure() {
        tc-export CC
 
+       local jit_backend
+       if use jit; then
+               jit_backend='--jit-backend='
+
+               # We only need the explicit sse2 switch for x86.
+               # On other arches we can rely on autodetection which uses
+               # compiler macros. Plus, --jit-backend= doesn't accept all
+               # the modern values...
+
+               if use x86; then
+                       if use cpu_flags_x86_sse2; then
+                               jit_backend+=x86
+                       else
+                               jit_backend+=x86-without-sse2
+                       fi
+               else
+                       jit_backend+=auto
+               fi
+       fi
+
        local args=(
                --shared
                $(usex jit -Ojit -O2)
                $(usex sandbox --sandbox '')
 
-               --jit-backend=auto
+               ${jit_backend}
 
                pypy/goal/targetpypystandalone
        )
index ca7aae03fe83a9527a9ae26dc419913321ec0542..d6e6b0856eabd72672068c0a3b443fd197e0aacc 100644 (file)
@@ -20,7 +20,8 @@ LICENSE="MIT"
 # pypy3 -c 'import sysconfig; print(sysconfig.get_config_var("SOABI"))'
 SLOT="0/71-py36"
 KEYWORDS=""
-IUSE="bzip2 gdbm +jit libressl low-memory ncurses sandbox sqlite tk"
+IUSE="bzip2 cpu_flags_x86_sse2 gdbm +jit libressl low-memory ncurses
+       sandbox sqlite tk"
 
 RDEPEND=">=sys-libs/zlib-1.1.3:0=
        virtual/libffi:0=
@@ -111,12 +112,32 @@ src_prepare() {
 src_configure() {
        tc-export CC
 
+       local jit_backend
+       if use jit; then
+               jit_backend='--jit-backend='
+
+               # We only need the explicit sse2 switch for x86.
+               # On other arches we can rely on autodetection which uses
+               # compiler macros. Plus, --jit-backend= doesn't accept all
+               # the modern values...
+
+               if use x86; then
+                       if use cpu_flags_x86_sse2; then
+                               jit_backend+=x86
+                       else
+                               jit_backend+=x86-without-sse2
+                       fi
+               else
+                       jit_backend+=auto
+               fi
+       fi
+
        local args=(
                --shared
                $(usex jit -Ojit -O2)
                $(usex sandbox --sandbox '')
 
-               --jit-backend=auto
+               ${jit_backend}
 
                pypy/goal/targetpypystandalone
        )