diff --git a/pkgs/development/compilers/llvm/8/compiler-rt.nix b/pkgs/development/compilers/llvm/8/compiler-rt.nix index 3e225626aa6d..33eef4358256 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 ed022422c26e..1ef2ab52029b 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 ''