diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index ddec3d0931ff..5f478c823e7a 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -301,8 +301,6 @@ stdenv.mkDerivation { + optionalString targetPlatform.isWasm '' hardening_unsupported_flags+=" stackprotector fortify pie pic" - '' + optionalString (targetPlatform.isWasm && libc != null) '' - echo "--allow-undefined-file=${libc}/share/wasm32-wasi/undefined-symbols.txt" >> $out/nix-support/cc-ldflags '' + optionalString (libc != null && targetPlatform.isAvr) '' diff --git a/pkgs/development/libraries/wasilibc/default.nix b/pkgs/development/libraries/wasilibc/default.nix index f783540797ce..229d67b81edd 100644 --- a/pkgs/development/libraries/wasilibc/default.nix +++ b/pkgs/development/libraries/wasilibc/default.nix @@ -17,6 +17,7 @@ stdenv.mkDerivation { postInstall = '' mv $out/lib/*/* $out/lib + ln -s $out/share/wasm32-wasi/undefined-symbols.txt $out/lib/wasi.imports ''; meta = {