llvmPackages_37.libcxxabi: fix with more recent versions of libc++

The build breaks on libc++ 3.8 and above, which hinders our upgrade to
LLVM 4 for the Darwin stdenv.
This commit is contained in:
Dan Peebles 2017-03-19 17:37:03 -04:00
parent 48a7bfa345
commit 972f51a2da

View file

@ -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";
@ -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