Unverified Commit 37ba8970 authored by Morgan Jones's avatar Morgan Jones
Browse files

llvmPackages_13.compiler-rt-libc: don't use distutils.spawn

This function was removed in Python 3.12 and seems to only be used in
LLVM 13, despite the Python file this is used in being present in
LLVM 12 and 14. The merge_archives.py file was removed in LLVM 15.
parent 7a5ca794
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -149,7 +149,13 @@ stdenv.mkDerivation ({
      --replace "#include <assert.h>" ""
    substituteInPlace lib/builtins/cpu_model${lib.optionalString (lib.versionAtLeast version "18") "/x86"}.c \
      --replace "#include <assert.h>" ""
  ''));
  '')) + lib.optionalString (lib.versionAtLeast release_version "13" && lib.versionOlder release_version "14") ''
    # https://github.com/llvm/llvm-project/blob/llvmorg-14.0.6/libcxx/utils/merge_archives.py
    # Seems to only be used in v13 though it's present in v12 and v14, and dropped in v15.
    substituteInPlace ../libcxx/utils/merge_archives.py \
      --replace-fail "import distutils.spawn" "from shutil import which as find_executable" \
      --replace-fail "distutils.spawn." ""
  '';

  # Hack around weird upsream RPATH bug
  postInstall = lib.optionalString (stdenv.hostPlatform.isDarwin) ''