Skip to content

Commit

Permalink
crystal: fix build with newer versions of clang
Browse files Browse the repository at this point in the history
Crystal requires linking libc++abi when building with newer versions of
clang. See NixOS#166205.
  • Loading branch information
reckenrode authored and nyabinary committed Nov 14, 2023
1 parent 18ea805 commit 004344a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkgs/development/compilers/crystal/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@ let
# See https://github.com/NixOS/nixpkgs/pull/195606#issuecomment-1356491277
substituteInPlace spec/compiler/loader/unix_spec.cr \
--replace 'it "parses file paths"' 'pending "parses file paths"'
'' + lib.optionalString (stdenv.cc.isClang && (stdenv.cc.libcxx != null)) ''
# Darwin links against libc++ not libstdc++. Newer versions of clang (12+) require
# libc++abi to be linked explicitly (see https://github.com/NixOS/nixpkgs/issues/166205).
substituteInPlace src/llvm/lib_llvm.cr \
--replace '@[Link("stdc++")]' '@[Link("c++", "-l${stdenv.cc.libcxx.cxxabi.libName}")]'
'';

# Defaults are 4
Expand Down

0 comments on commit 004344a

Please sign in to comment.