openblas: apply patch to prevent SIGILL on aarch64 (#117004)

The applied patch contains the changes from this PR:
https://github.com/xianyi/OpenBLAS/pull/3060

This patch prevents gcc from reordering instructions in a way
that can cause crashes with SIGILL on aarch64.

This issue crashes python when importing numpy on aarch64:
https://github.com/numpy/numpy/issues/18131
This commit is contained in:
mschwaig 2021-03-21 21:12:12 +01:00 committed by GitHub
parent 6a79a7af4f
commit de2c3e08c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, perl, which
{ lib, stdenv, fetchFromGitHub, fetchpatch, perl, which
# Most packages depending on openblas expect integer width to match
# pointer width, but some expect to use 32-bit integers always
# (for compatibility with reference BLAS).
@ -124,6 +124,16 @@ stdenv.mkDerivation rec {
sha256 = "14jxh0v3jfbw4mfjx4mcz4dd51lyq7pqvh9k8dg94539ypzjr2lj";
};
# apply https://github.com/xianyi/OpenBLAS/pull/3060 to fix a crash on arm
# remove this when updating to 0.3.14 or newer
patches = [
(fetchpatch {
name = "label-get_cpu_ftr-as-volatile.patch";
url = "https://github.com/xianyi/OpenBLAS/commit/6fe0f1fab9d6a7f46d71d37ebb210fbf56924fbc.diff";
sha256 = "06gwh73k4sas1ap2fi3jvpifbjkys2vhmnbj4mzrsvj279ljsfdk";
})
];
inherit blas64;
# Some hardening features are disabled due to sporadic failures in