wasilibc: 20190712 -> unstable-2021-09-23

This commit is contained in:
Martin Weinelt 2022-03-09 19:34:42 +01:00
parent 5cd57cc7c0
commit 47ca51cba9
No known key found for this signature in database
GPG key ID: 87C1E9888F856759

View file

@ -1,14 +1,27 @@
{ stdenv, fetchFromGitHub, lib }: { stdenv, buildPackages, fetchFromGitHub, lib }:
stdenv.mkDerivation { stdenv.mkDerivation {
pname = "wasilibc"; pname = "wasilibc";
version = "20190712"; version = "unstable-2021-09-23";
src = fetchFromGitHub {
owner = "CraneStation"; src = buildPackages.fetchFromGitHub {
owner = "WebAssembly";
repo = "wasi-libc"; repo = "wasi-libc";
rev = "8df0d4cd6a559b58d4a34b738a5a766b567448cf"; rev = "ad5133410f66b93a2381db5b542aad5e0964db96";
sha256 = "1n4gvgzacpagar2mx8g9950q0brnhwz7jg2q44sa5mnjmlnkiqhh"; hash = "sha256-RiIClVXrb18jF9qCt+5iALHPCZKYcnad7JsILHBV0pA=";
fetchSubmodules = true;
}; };
# clang-13: error: argument unused during compilation: '-rtlib=compiler-rt' [-Werror,-Wunused-command-line-argument]
postPatch = ''
substituteInPlace Makefile \
--replace "-Werror" ""
'';
preBuild = ''
export NIX_CFLAGS_COMPILE="-I$(pwd)/sysroot/include $NIX_CFLAGS_COMPILE"
'';
makeFlags = [ makeFlags = [
"WASM_CC=${stdenv.cc.targetPrefix}cc" "WASM_CC=${stdenv.cc.targetPrefix}cc"
"WASM_NM=${stdenv.cc.targetPrefix}nm" "WASM_NM=${stdenv.cc.targetPrefix}nm"
@ -16,6 +29,8 @@ stdenv.mkDerivation {
"INSTALL_DIR=${placeholder "out"}" "INSTALL_DIR=${placeholder "out"}"
]; ];
enableParallelBuilding = true;
postInstall = '' postInstall = ''
mv $out/lib/*/* $out/lib mv $out/lib/*/* $out/lib
ln -s $out/share/wasm32-wasi/undefined-symbols.txt $out/lib/wasi.imports ln -s $out/share/wasm32-wasi/undefined-symbols.txt $out/lib/wasi.imports
@ -23,9 +38,9 @@ stdenv.mkDerivation {
meta = with lib; { meta = with lib; {
description = "WASI libc implementation for WebAssembly"; description = "WASI libc implementation for WebAssembly";
homepage = "https://wasi.dev"; homepage = "https://wasi.dev";
platforms = platforms.wasi; platforms = platforms.wasi;
maintainers = [ maintainers.matthewbauer ]; maintainers = with maintainers; [ matthewbauer ];
license = with licenses; [ asl20 mit llvm-exception ]; license = with licenses; [ asl20 mit llvm-exception ];
}; };
} }