From f97fb96ea06132a8a5be528d2151216c8de772e4 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Wed, 28 Jul 2021 23:49:42 +0200 Subject: [PATCH] python3Packages.scipy: fix build on aarch64-darwin by disabling stack-protector essentially the same fix as we used for openmpi in https://github.com/NixOS/nixpkgs/pull/128606 --- .../python-modules/scipy/default.nix | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/scipy/default.nix b/pkgs/development/python-modules/scipy/default.nix index 19fa8e507281..7a9643aa7d24 100644 --- a/pkgs/development/python-modules/scipy/default.nix +++ b/pkgs/development/python-modules/scipy/default.nix @@ -1,4 +1,15 @@ -{lib, fetchPypi, python, buildPythonPackage, gfortran, nose, pytest, pytest-xdist, numpy, pybind11 }: +{ lib +, stdenv +, fetchPypi +, python +, buildPythonPackage +, gfortran +, nose +, pytest +, pytest-xdist +, numpy +, pybind11 +}: buildPythonPackage rec { pname = "scipy"; @@ -30,6 +41,17 @@ buildPythonPackage rec { ln -s ${numpy.cfg} site.cfg ''; + + # disable stackprotector on aarch64-darwin for now + # + # build error: + # + # /private/tmp/nix-build-python3.9-scipy-1.6.3.drv-0/ccDEsw5U.s:109:15: error: index must be an integer in range [-256, 255]. + # + # ldr x0, [x0, ___stack_chk_guard];momd + # + hardeningDisable = lib.optionals (stdenv.isAarch64 && stdenv.isDarwin) [ "stackprotector" ]; + checkPhase = '' runHook preCheck pushd dist