libc++{,abi}_38: musl fixes, cmake is nativeBuildInput

This commit is contained in:
Will Dietz 2018-06-23 12:11:18 -05:00
parent 0b7cc25d19
commit db7041a047
2 changed files with 13 additions and 3 deletions

@ -17,15 +17,22 @@ stdenv.mkDerivation rec {
patches = [
# glibc 2.26 fix
../../3.9/libc++/xlocale-glibc-2.26.patch
] ++ lib.optional stdenv.isDarwin ./darwin.patch;
]
++ lib.optional stdenv.isDarwin ./darwin.patch
++ stdenv.lib.optionals stdenv.hostPlatform.isMusl [
../../libcxx-0001-musl-hacks.patch
../../libcxx-max_align_t.patch
];
buildInputs = [ cmake libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
nativeBuildInputs = [ cmake ];
buildInputs = [ libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
cmakeFlags = [
"-DLIBCXX_LIBCXXABI_LIB_PATH=${libcxxabi}/lib"
"-DLIBCXX_LIBCPPABI_VERSION=2"
"-DLIBCXX_CXX_ABI=libcxxabi"
];
] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl "-DLIBCXX_HAS_MUSL_LIBC=1";
enableParallelBuilding = true;

@ -15,6 +15,9 @@ stdenv.mkDerivation {
export cmakeFlags="-DLLVM_PATH=$PWD/$(ls -d llvm-*) -DLIBCXXABI_LIBCXX_INCLUDES=$PWD/$(ls -d libcxx-*)/include"
'' + stdenv.lib.optionalString stdenv.isDarwin ''
export TRIPLE=x86_64-apple-darwin
'' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
patch -p1 -d $(ls -d libcxx-*) -i ${../libcxx-0001-musl-hacks.patch}
patch -p1 -d $(ls -d libcxx-*) -i ${../libcxx-max_align_t.patch}
'';
installPhase = if stdenv.isDarwin