Name: wasi-libc Summary: C library implementation for WebAssembly System Interface Version: 19 Release: 1%{?dist} License: Apache-2.0 WITH LLVM-exception AND Apache-2.0 AND MIT AND BSD-2-Clause URL: https://github.com/WebAssembly/wasi-libc/ Source: %{url}/archive/refs/tags/wasi-sdk-%{version}.tar.gz#/%{name}-wasi-sdk-%{version}.tar.gz Patch: 0001-make-don-t-rebuild-files-on-make-install.patch # Although this packages provides binaries, they are not targeted # for the build platform, but for wasm32-wasi. # See the relevant discussion (for similar case) here: # https://www.redhat.com/archives/fedora-devel-list/2009-February/msg02261.html %global _binaries_in_noarch_packages_terminate_build 0 BuildArch: noarch # This contains parts of the musl C library; specify as bundled so we get notified about potentional vulnerabilities %global musl_version 1.2.3 Provides: bundled(musl) = %{musl_version} BuildRequires: clang >= 10 BuildRequires: git BuildRequires: llvm >= 10 BuildRequires: make %global toolchain clang # WASI is a specific architecture; host (build machine) arch flags should not apply by default %global build_cflags --target=wasm32-wasi -fstack-protector # Define cross-compiling prefix %global wasi_prefix %{_prefix}/wasm32-wasi %global wasi_datadir %{wasi_prefix}/share %global wasi_includedir %{wasi_prefix}/include %global wasi_libdir %{wasi_prefix}/lib %global wasi_make_flags MALLOC_IMPL=emmalloc INSTALL_DIR='%{buildroot}%{wasi_prefix}' SYSROOT='%{_builddir}/sysroot' %description WASI Libc is a libc for WebAssembly programs built on top of WASI system calls. It provides a wide array of POSIX-compatible C APIs, including support for standard I/O, file I/O, filesystem manipulation, memory management, time, string, environment variables, program startup, and many other APIs. %prep %autosetup -n %{name}-wasi-sdk-%{version} -S git_am %build %make_build %{wasi_make_flags} make %{wasi_make_flags} check-symbols %install %make_install %{wasi_make_flags} %check # Bundled version checks xargs test '%{musl_version}' = - 19-1 - Initial package