Page MenuHomeSolus

D11518.diff
No OneTemporary

D11518.diff

diff --git a/files/Try-to-load-so.avx2-libs-first-if-they-exist-and-cpu.patch b/files/Try-to-load-so.avx2-libs-first-if-they-exist-and-cpu.patch
new file mode 100644
--- /dev/null
+++ b/files/Try-to-load-so.avx2-libs-first-if-they-exist-and-cpu.patch
@@ -0,0 +1,45 @@
+From 325fb5e5ee95a597b50583846938e3ba97fa78ab Mon Sep 17 00:00:00 2001
+From: Joey Riches <josephriches@gmail.com>
+Date: Thu, 22 Jul 2021 02:54:21 +0100
+Subject: [PATCH 1/1] Try to load so.avx2 libs first if they exist and cpu is
+ supported
+
+We compile for haswell so we also check for popcnt to exclude bdver4 (Exacavator)
+
+Not really the most ideal solution but should do the trick.
+---
+ Python/dynload_shlib.c | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/Python/dynload_shlib.c b/Python/dynload_shlib.c
+index f271193190..f25c01dce0 100644
+--- a/Python/dynload_shlib.c
++++ b/Python/dynload_shlib.c
+@@ -61,6 +61,7 @@ _PyImport_FindSharedFuncptr(const char *prefix,
+ void *handle;
+ char funcname[258];
+ char pathbuf[260];
++ char *pathname2;
+ int dlopenflags=0;
+
+ if (strchr(pathname, '/') == NULL) {
+@@ -93,7 +94,15 @@ _PyImport_FindSharedFuncptr(const char *prefix,
+
+ dlopenflags = PyThreadState_GET()->interp->dlopenflags;
+
+- handle = dlopen(pathname, dlopenflags);
++ pathname2 = malloc(strlen(pathname) + strlen(".avx2") + 1);
++ sprintf(pathname2, "%s%s", pathname, ".avx2");
++ if (__builtin_cpu_supports("avx2") &&
++ __builtin_cpu_supports("popcnt") && // We compile for haswell, add popcnt check to exclude bdver4 (Exacavator)
++ access(pathname2, R_OK) == 0)
++ handle = dlopen(pathname2, dlopenflags);
++ else
++ handle = dlopen(pathname, dlopenflags);
++ free(pathname2);
+
+ if (handle == NULL) {
+ PyObject *mod_name;
+--
+2.32.0
+
diff --git a/files/series b/files/series
--- a/files/series
+++ b/files/series
@@ -1 +1,2 @@
0001-ensurepip-Always-install-pip-setuptools-ignoring-ins.patch
+Try-to-load-so.avx2-libs-first-if-they-exist-and-cpu.patch
diff --git a/package.yml b/package.yml
--- a/package.yml
+++ b/package.yml
@@ -1,6 +1,6 @@
name : python3
version : 3.9.6
-release : 36
+release : 37
source :
- https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tar.xz : 397920af33efc5b97f2e0b57e91923512ef89fc5b3c1d21dbfc8c4828ce0108a
license : Python-2.0
diff --git a/pspec_x86_64.xml b/pspec_x86_64.xml
--- a/pspec_x86_64.xml
+++ b/pspec_x86_64.xml
@@ -5058,7 +5058,7 @@
</Description>
<PartOf>programming.devel</PartOf>
<RuntimeDependencies>
- <Dependency release="36">python3</Dependency>
+ <Dependency release="37">python3</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="header">/usr/include/python3.9/Python-ast.h</Path>
@@ -5231,7 +5231,7 @@
</Description>
<PartOf>programming.python</PartOf>
<RuntimeDependencies>
- <Dependency releaseFrom="36">python3</Dependency>
+ <Dependency releaseFrom="37">python3</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="library">/usr/lib/python3.9/test/Sine-1000Hz-300ms.aif</Path>
@@ -8536,15 +8536,15 @@
</Description>
<PartOf>programming.python</PartOf>
<RuntimeDependencies>
- <Dependency releaseFrom="36">python3</Dependency>
+ <Dependency releaseFrom="37">python3</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="library">/usr/lib64/python3.9/lib-dynload/_tkinter.cpython-39-x86_64-linux-gnu.so</Path>
</Files>
</Package>
<History>
- <Update release="36">
- <Date>2021-08-28</Date>
+ <Update release="37">
+ <Date>2021-08-31</Date>
<Version>3.9.6</Version>
<Comment>Packaging update</Comment>
<Name>Joey Riches</Name>

File Metadata

Mime Type
text/plain
Expires
Sat, Aug 12, 12:26 AM (2 h, 44 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5835205
Default Alt Text
D11518.diff (3 KB)

Event Timeline