From 7be0e091bd8fa7d3647c0821aad59fea77472c3a Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sat, 2 Jul 2022 18:44:42 +0100 Subject: [PATCH] sbcl: pull darwin fix pending upstream inclusion for -fno-common toolchains Without the change build fails on darwin as: duplicate symbol '_static_code_space_free_pointer' in: alloc.o traceroot.o duplicate symbol '_static_code_space_free_pointer' in: alloc.o gencgc.o --- pkgs/development/compilers/sbcl/common.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/development/compilers/sbcl/common.nix b/pkgs/development/compilers/sbcl/common.nix index 6a3b40066d9..7b28425af77 100644 --- a/pkgs/development/compilers/sbcl/common.nix +++ b/pkgs/development/compilers/sbcl/common.nix @@ -29,7 +29,16 @@ stdenv.mkDerivation rec { # Fix segfault on ARM when reading large core files url = "https://github.com/sbcl/sbcl/commit/8fa3f76fba2e8572e86ac6fc5754e6b2954fc774.patch"; sha256 = "1ic531pjnws1k3xd03a5ixbq8cn10dlh2nfln59k0vbm0253g3lv"; - }); + }) + ++ lib.optionals (lib.versionAtLeast version "2.1.10") [ + # Fix pending upstream inclusion on -fno-common toolchains: + # https://bugs.launchpad.net/sbcl/+bug/1980570 + (fetchpatch { + name = "darwin-fno-common.patch"; + url = "https://bugs.launchpad.net/sbcl/+bug/1980570/+attachment/5600916/+files/0001-src-runtime-fix-fno-common-build-on-darwin.patch"; + sha256 = "0avpwgjdaxxdpq8pfvv9darfn4ql5dgqq7zaf3nmxnvhh86ngzij"; + }) + ]; postPatch = '' echo '"${version}.nixos"' > version.lisp-expr