Skip to content

Commit

Permalink
llvmPackages_37.libcxxabi: fix with more recent versions of libc++
Browse files Browse the repository at this point in the history
The build breaks on libc++ 3.8 and above, which hinders our upgrade to
LLVM 4 for the Darwin stdenv.
  • Loading branch information
copumpkin committed Mar 20, 2017
1 parent 48a7bfa commit 972f51a
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions pkgs/development/compilers/llvm/3.7/libc++abi.nix
@@ -1,6 +1,12 @@
{ stdenv, cmake, fetch, libcxx, libunwind, llvm, version }:
{ stdenv, cmake, fetch, fetchpatch, libcxx, libunwind, llvm, version }:

stdenv.mkDerivation {
let
# Newer LLVMs (3.8 onwards) have changed how some basic C++ stuff works, which breaks builds of this older version
llvm38-and-above = fetchpatch {
url = "https://trac.macports.org/raw-attachment/ticket/50304/0005-string-Fix-exception-declaration.patch";
sha256 = "1lm38n7s0l5dbl7kp4i49pvzxz1mcvlr2vgsnj47agnwhhm63jvr";
};
in stdenv.mkDerivation {
name = "libc++abi-${version}";

src = fetch "libcxxabi" "0ambfcmr2nh88hx000xb7yjm9lsqjjz49w5mlf6dlxzmj3nslzx4";
Expand All @@ -16,6 +22,13 @@ stdenv.mkDerivation {
export TRIPLE=x86_64-apple-darwin
'';

# I can't use patches directly because this is actually a patch for libc++'s source, which we manually extract
# into the libc++abi build environment above.
prePatch = ''(
cd ../libcxx-*
patch -p1 < ${llvm38-and-above}
)'';

installPhase = if stdenv.isDarwin
then ''
for file in lib/*.dylib; do
Expand Down

0 comments on commit 972f51a

Please sign in to comment.