aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Knoblich <kai@FreeBSD.org>2021-09-28 07:43:34 +0000
committerKai Knoblich <kai@FreeBSD.org>2021-09-28 08:04:57 +0000
commit70843a665d45e14e5b45a87b4c6205555040c555 (patch)
tree45c4d789b2aec1aece7ed6aaf83fc8b7e80f9b22
parent8a42d3d971b5b283f23094a0e5a1d2717de3fe3d (diff)
downloadports-70843a665d45e14e5b45a87b4c6205555040c555.tar.gz
ports-70843a665d45e14e5b45a87b4c6205555040c555.zip
devel/py-tables: Disable AVX2 CPU optimizations
On amd64 platforms that have a CPU with Haswell New Instructions (AVX2), related optimizations are automatically compiled in, unless this is explicitly prevented. If the package is then used on other amd64 platforms, that have no AVX2 support, this causes problems, because the generated .so files are incompatible and lead to crashes with SIGILL upon invocation. Remedy the issue by turning off AVX2 support by default which is also upstream's default and bump PORTREVISION to force a rebuild. PR: 258714 Reported by: dvl (on IRC) Reviewed by: wen (maintainer) Approved by: portmgr (blanket: build fix) MFH: 2021Q3 (cherry picked from commit f31b25e7dc91402729ecc19c1fca66e9ebe5ddc8)
-rw-r--r--devel/py-tables/Makefile10
1 files changed, 10 insertions, 0 deletions
diff --git a/devel/py-tables/Makefile b/devel/py-tables/Makefile
index f10cee471616..d1d4e59fb306 100644
--- a/devel/py-tables/Makefile
+++ b/devel/py-tables/Makefile
@@ -2,6 +2,7 @@
PORTNAME= tables
PORTVERSION= 3.6.1
+PORTREVISION= 1
CATEGORIES= devel python
MASTER_SITES= CHEESESHOP
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
@@ -28,6 +29,15 @@ USE_PYTHON= autoplist concurrent distutils cython
PORTEXAMPLES= *
OPTIONS_DEFINE= EXAMPLES
+OPTIONS_DEFINE_amd64= AVX2
+
+AVX2_DESC= Enable Haswell New Instructions (AVX2) support
+
+# Explicitly disable AVX2 otherwise it will be automatically enabled if the CPU
+# supports it. If compiled in and run on hosts that have no AVX2 support, it
+# will trigger a SIGILL (Illegal instruction)
+# See also: https://github.com/PyTables/PyTables/issues/841
+AVX2_VARS_OFF= MAKE_ENV+=DISABLE_AVX2=yes
post-patch:
@${REINPLACE_CMD} -e "s,%%LOCALBASE%%,${LOCALBASE}," ${WRKSRC}/setup.py