Merge pull request #182377 from trofi/fix-sbcl-on-aarch64-darwin

sbcl_2_1_10, sbcl_2_1_11: fix build on arm64-darwin (-fno-common fall…

authored by Sergei Trofimovich and committed by GitHub f315837e 21a6aafb

+15
+15
pkgs/development/compilers/sbcl/common.nix
··· 40 40 url = "https://bugs.launchpad.net/sbcl/+bug/1980570/+attachment/5600916/+files/0001-src-runtime-fix-fno-common-build-on-darwin.patch"; 41 41 sha256 = "0avpwgjdaxxdpq8pfvv9darfn4ql5dgqq7zaf3nmxnvhh86ngzij"; 42 42 }) 43 + ] ++ lib.optionals (lib.versionAtLeast version "2.1.10" && lib.versionOlder version "2.2.0") [ 44 + # Fix -fno-common on arm64 45 + (fetchpatch { 46 + name = "arm64-fno-common.patch"; 47 + url = "https://github.com/sbcl/sbcl/commit/ac3739eae36de92feffef5bb9b4b4bd93f6c4942.patch"; 48 + sha256 = "1kxg0ng7d465rk5v4biikrzaps41x4n1v4ygnb5qh4f5jzkbms8y"; 49 + }) 43 50 ] ++ lib.optionals (version == "2.2.6") [ 44 51 # Take contrib blocklist into account for doc generation. This fixes sbcl 45 52 # build on aarch64, because the docs Makefile tries to require sb-simd, ··· 101 108 disableFeatures = with lib; 102 109 optional (!threadSupport) "sb-thread" ++ 103 110 optionals disableImmobileSpace [ "immobile-space" "immobile-code" "compact-instance-header" ]; 111 + 112 + NIX_CFLAGS_COMPILE = lib.optional (lib.versionOlder version "2.1.10") [ 113 + # Workaround build failure on -fno-common toolchains like upstream 114 + # clang-13. Without the change build fails as: 115 + # duplicate symbol '_static_code_space_free_pointer' in: alloc.o traceroot.o 116 + # Should be fixed past 2.1.10 release. 117 + "-fcommon" 118 + ]; 104 119 105 120 buildPhase = '' 106 121 runHook preBuild