Skip to content

Commit

Permalink
Merge pull request #182377 from trofi/fix-sbcl-on-aarch64-darwin
Browse files Browse the repository at this point in the history
sbcl_2_1_10, sbcl_2_1_11: fix build on arm64-darwin (-fno-common fall…
  • Loading branch information
trofi authored Jul 24, 2022
2 parents 21a6aaf + 2632651 commit f315837
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pkgs/development/compilers/sbcl/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ stdenv.mkDerivation rec {
url = "https://bugs.launchpad.net/sbcl/+bug/1980570/+attachment/5600916/+files/0001-src-runtime-fix-fno-common-build-on-darwin.patch";
sha256 = "0avpwgjdaxxdpq8pfvv9darfn4ql5dgqq7zaf3nmxnvhh86ngzij";
})
] ++ lib.optionals (lib.versionAtLeast version "2.1.10" && lib.versionOlder version "2.2.0") [
# Fix -fno-common on arm64
(fetchpatch {
name = "arm64-fno-common.patch";
url = "https://github.com/sbcl/sbcl/commit/ac3739eae36de92feffef5bb9b4b4bd93f6c4942.patch";
sha256 = "1kxg0ng7d465rk5v4biikrzaps41x4n1v4ygnb5qh4f5jzkbms8y";
})
] ++ lib.optionals (version == "2.2.6") [
# Take contrib blocklist into account for doc generation. This fixes sbcl
# build on aarch64, because the docs Makefile tries to require sb-simd,
Expand Down Expand Up @@ -102,6 +109,14 @@ stdenv.mkDerivation rec {
optional (!threadSupport) "sb-thread" ++
optionals disableImmobileSpace [ "immobile-space" "immobile-code" "compact-instance-header" ];

NIX_CFLAGS_COMPILE = lib.optional (lib.versionOlder version "2.1.10") [
# Workaround build failure on -fno-common toolchains like upstream
# clang-13. Without the change build fails as:
# duplicate symbol '_static_code_space_free_pointer' in: alloc.o traceroot.o
# Should be fixed past 2.1.10 release.
"-fcommon"
];

buildPhase = ''
runHook preBuild
Expand Down

0 comments on commit f315837

Please sign in to comment.