From d591a109beee6512ea45e03e83901d269c8ec39b Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Mon, 15 Apr 2019 21:10:42 -0400 Subject: [PATCH] =?UTF-8?q?wasm:=20don=E2=80=99t=20assume=20musl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/systems/inspect.nix | 2 +- pkgs/development/compilers/llvm/8/libc++/default.nix | 6 ++++-- pkgs/development/compilers/llvm/8/libc++abi.nix | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/systems/inspect.nix b/lib/systems/inspect.nix index b88af55e46be..1c90af88879a 100644 --- a/lib/systems/inspect.nix +++ b/lib/systems/inspect.nix @@ -46,7 +46,7 @@ rec { isWasi = { kernel = kernels.wasi; }; isAndroid = [ { abi = abis.android; } { abi = abis.androideabi; } ]; - isMusl = (with abis; map (a: { abi = a; }) [ musl musleabi musleabihf ]) ++ [{ kernel = kernels.wasi; }]; + isMusl = with abis; map (a: { abi = a; }) [ musl musleabi musleabihf ]; isUClibc = with abis; map (a: { abi = a; }) [ uclibc uclibceabi uclibceabihf ]; isEfi = map (family: { cpu.family = family; }) diff --git a/pkgs/development/compilers/llvm/8/libc++/default.nix b/pkgs/development/compilers/llvm/8/libc++/default.nix index 8b4452a6de29..3d67c37dcdd7 100644 --- a/pkgs/development/compilers/llvm/8/libc++/default.nix +++ b/pkgs/development/compilers/llvm/8/libc++/default.nix @@ -23,7 +23,8 @@ stdenv.mkDerivation rec { '' + lib.optionalString stdenv.hostPlatform.isMusl '' patchShebangs utils/cat_files.py ''; - nativeBuildInputs = [ cmake ] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl python; + nativeBuildInputs = [ cmake ] + ++ stdenv.lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) python; buildInputs = [ libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames; @@ -31,11 +32,12 @@ stdenv.mkDerivation rec { "-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" + ] ++ stdenv.lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) "-DLIBCXX_HAS_MUSL_LIBC=1" ++ stdenv.lib.optional (stdenv.hostPlatform.useLLVM or false) "-DLIBCXX_USE_COMPILER_RT=ON" ++ stdenv.lib.optional stdenv.hostPlatform.isWasm [ "-DLIBCXX_ENABLE_THREADS=OFF" "-DLIBCXX_ENABLE_FILESYSTEM=OFF" + "-DLIBCXX_ENABLE_EXCEPTIONS=OFF" ] ++ stdenv.lib.optional (!enableShared) "-DLIBCXX_ENABLE_SHARED=OFF"; enableParallelBuilding = true; diff --git a/pkgs/development/compilers/llvm/8/libc++abi.nix b/pkgs/development/compilers/llvm/8/libc++abi.nix index e264a3849414..8a5e1d32c42c 100644 --- a/pkgs/development/compilers/llvm/8/libc++abi.nix +++ b/pkgs/development/compilers/llvm/8/libc++abi.nix @@ -15,6 +15,7 @@ stdenv.mkDerivation { ] ++ stdenv.lib.optionals stdenv.hostPlatform.isWasm [ "-DUNIX=ON" "-DLIBCXXABI_ENABLE_THREADS=OFF" + "-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF" ] ++ stdenv.lib.optionals (!enableShared) [ "-DLIBCXXABI_ENABLE_SHARED=OFF" ];