wasilibc: unstable-2021-09-23 -> unstable-2022-04-12

Done in response to a few PRs which I made to wasi-libc to make things
better for downstream packagers like us.
This commit is contained in:
John Ericson 2022-03-17 16:31:47 +00:00
parent 164e44e62f
commit 942f536c76

View file

@ -2,16 +2,18 @@
stdenv.mkDerivation { stdenv.mkDerivation {
pname = "wasilibc"; pname = "wasilibc";
version = "unstable-2021-09-23"; version = "unstable-2022-04-12";
src = buildPackages.fetchFromGitHub { src = buildPackages.fetchFromGitHub {
owner = "WebAssembly"; owner = "WebAssembly";
repo = "wasi-libc"; repo = "wasi-libc";
rev = "ad5133410f66b93a2381db5b542aad5e0964db96"; rev = "a279514a6ef30cd8ee1469345b33172fcbc8d52d";
hash = "sha256-RiIClVXrb18jF9qCt+5iALHPCZKYcnad7JsILHBV0pA="; sha256 = "0a9ldas8p7jg7jlkhb9wdiw141z7vfz6p18mnmxnnnna7bp1y3fz";
fetchSubmodules = true; fetchSubmodules = true;
}; };
outputs = [ "out" "dev" "share" ];
# clang-13: error: argument unused during compilation: '-rtlib=compiler-rt' [-Werror,-Wunused-command-line-argument] # clang-13: error: argument unused during compilation: '-rtlib=compiler-rt' [-Werror,-Wunused-command-line-argument]
postPatch = '' postPatch = ''
substituteInPlace Makefile \ substituteInPlace Makefile \
@ -19,21 +21,24 @@ stdenv.mkDerivation {
''; '';
preBuild = '' preBuild = ''
export NIX_CFLAGS_COMPILE="-I$(pwd)/sysroot/include $NIX_CFLAGS_COMPILE" export SYSROOT_LIB=${builtins.placeholder "out"}/lib
export SYSROOT_INC=${builtins.placeholder "dev"}/include
export SYSROOT_SHARE=${builtins.placeholder "share"}/share
mkdir -p "$SYSROOT_LIB" "$SYSROOT_INC" "$SYSROOT_SHARE"
makeFlagsArray+=(
"SYSROOT_LIB:=$SYSROOT_LIB"
"SYSROOT_INC:=$SYSROOT_INC"
"SYSROOT_SHARE:=$SYSROOT_SHARE"
)
''; '';
makeFlags = [
"WASM_CC=${stdenv.cc.targetPrefix}cc"
"WASM_NM=${stdenv.cc.targetPrefix}nm"
"WASM_AR=${stdenv.cc.targetPrefix}ar"
"INSTALL_DIR=${placeholder "out"}"
];
enableParallelBuilding = true; enableParallelBuilding = true;
postInstall = '' # We just build right into the install paths, per the `preBuild`.
mv $out/lib/*/* $out/lib dontInstall = true;
ln -s $out/share/wasm32-wasi/undefined-symbols.txt $out/lib/wasi.imports
preFixup = ''
ln -s $share/share/undefined-symbols.txt $out/lib/wasi.imports
''; '';
meta = with lib; { meta = with lib; {