From 9abff4af4f07c16aecd89bf82051afbc3228d6fd Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 29 Jan 2019 21:01:24 -0500 Subject: wasm: init cross target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds pkgsCross.wasm32 and pkgsCross.wasm64. Use it to build Nixpkgs with a WebAssembly toolchain. stdenv/cross: use static overlay on isWasm isWasm doesn’t make sense dynamically linked. --- pkgs/stdenv/generic/default.nix | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pkgs/stdenv/generic') diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index 04117de3269..ed022422c26 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -91,6 +91,9 @@ let '' + lib.optionalString hostPlatform.isDarwin '' export NIX_DONT_SET_RPATH=1 export NIX_NO_SELF_RPATH=1 + '' + lib.optionalString (hostPlatform.parsed.kernel.execFormat != lib.systems.parse.execFormats.elf && hostPlatform.parsed.kernel.execFormat != lib.systems.parse.execFormats.macho) '' + export NIX_DONT_SET_RPATH=1 + export NIX_NO_SELF_RPATH=1 '' # TODO this should be uncommented, but it causes stupid mass rebuilds. I # think the best solution would just be to fixup linux RPATHs so we don't -- cgit 1.4.1 From 1a7a96a093c8c3ee25ab18e36473394e1e2a5b0a Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 16 Apr 2019 23:55:31 -0400 Subject: stdenv, compiler-rt: Compress WASI conditionals --- pkgs/development/compilers/llvm/8/compiler-rt.nix | 4 +--- pkgs/stdenv/generic/default.nix | 5 +---- 2 files changed, 2 insertions(+), 7 deletions(-) (limited to 'pkgs/stdenv/generic') diff --git a/pkgs/development/compilers/llvm/8/compiler-rt.nix b/pkgs/development/compilers/llvm/8/compiler-rt.nix index 3e225626aa6..33eef435825 100644 --- a/pkgs/development/compilers/llvm/8/compiler-rt.nix +++ b/pkgs/development/compilers/llvm/8/compiler-rt.nix @@ -53,15 +53,13 @@ stdenv.mkDerivation rec { ''; # Hack around weird upsream RPATH bug - postInstall = stdenv.lib.optionalString stdenv.isDarwin '' + postInstall = stdenv.lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) '' ln -s "$out/lib"/*/* "$out/lib" '' + stdenv.lib.optionalString (stdenv.hostPlatform.useLLVM or false) '' ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/crtbegin.o ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/crtend.o ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/crtendS.o - '' + stdenv.lib.optionalString stdenv.hostPlatform.isWasm '' - ln -s $out/lib/*/* $out/lib ''; NIX_LDFLAGS = stdenv.lib.optionalString stdenv.hostPlatform.isWasm "--allow-undefined --no-entry"; diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index ed022422c26..1ef2ab52029 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -88,10 +88,7 @@ let # there (yet?) so it goes here until then. preHook = preHook+ lib.optionalString buildPlatform.isDarwin '' export NIX_BUILD_DONT_SET_RPATH=1 - '' + lib.optionalString hostPlatform.isDarwin '' - export NIX_DONT_SET_RPATH=1 - export NIX_NO_SELF_RPATH=1 - '' + lib.optionalString (hostPlatform.parsed.kernel.execFormat != lib.systems.parse.execFormats.elf && hostPlatform.parsed.kernel.execFormat != lib.systems.parse.execFormats.macho) '' + '' + lib.optionalString (hostPlatform.isDarwin || (hostPlatform.parsed.kernel.execFormat != lib.systems.parse.execFormats.elf && hostPlatform.parsed.kernel.execFormat != lib.systems.parse.execFormats.macho)) '' export NIX_DONT_SET_RPATH=1 export NIX_NO_SELF_RPATH=1 '' -- cgit 1.4.1