Sync from SUSE:SLFO:Main wasi-libc revision dd6c76815fe0f13c9bdd44c72ded2a06

This commit is contained in:
Adrian Schröter 2024-05-04 01:49:57 +02:00
commit 75d4575ffb
7 changed files with 169 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

View File

@ -0,0 +1,13 @@
Ignore __FPCLASS_* macros that are new with Clang 17.
diff --git a/Makefile b/Makefile
index f350ecb..981da98 100644
--- a/Makefile
+++ b/Makefile
@@ -702,6 +702,7 @@ check-symbols: startup_files libc
| sed -e 's/__GNUC_VA_LIST $$/__GNUC_VA_LIST 1/' \
| grep -v '^#define __\(BOOL\|INT_\(LEAST\|FAST\)\(8\|16\|32\|64\)\|INT\|LONG\|LLONG\|SHRT\)_WIDTH__' \
| grep -v '^#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_\(1\|2\|4\|8\)' \
+ | grep -v '^#define __FPCLASS_\(\(NEG\|POS\)\(INF\|NORMAL\|SUBNORMAL\|ZERO\)\|[QS]NAN\)' \
> "$(SYSROOT_SHARE)/predefined-macros.txt"
# Check that the computed metadata matches the expected metadata.

BIN
wasi-libc-20.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

12
wasi-libc-rpmlintrc Normal file
View File

@ -0,0 +1,12 @@
# Those files ARE arch-independent, but named like they are not (*.a, etc.) so the script is wrong here
addFilter("files-duplicate .*")
addFilter("static-library-without-symtab .*")
addFilter("static-library-without-debuginfo .*")
addFilter("readelf-failed .*")
addFilter("zero-length .*")
addFilter("arch-dependent-file-in-usr-share .*")
addFilter("arch-independent-package-contains-binary-or-object .*")
# There are empty dummy-files in the sysroot
addFilter('lto-no-text-in-archive .*')
addFilter('devel-file-in-non-devel-package .*')

41
wasi-libc.changes Normal file
View File

@ -0,0 +1,41 @@
-------------------------------------------------------------------
Fri Sep 22 17:06:06 UTC 2023 - Aaron Puchert <aaronpuchert@alice-dsl.net>
- Update to version (wasi-sdk-)20.
* Compatibility with Clang 16.
* Rename triple wasm32-wasi-pthread to wasm32-wasi-threads.
* Implement support for spinlock.
* Improve performance in dlmalloc.
- Rebase workaround-broken-makefile.patch.
- Drop obsolete undefine-gcc-macros.patch. (Has been solved
upstream in gh#WebAssembly/wasi-libc#379.)
- Add ignore-fpclass-macros.patch to ignore __FPCLASS_* macros that
are new with Clang 17.
-------------------------------------------------------------------
Wed Mar 22 22:23:36 UTC 2023 - Aaron Puchert <aaronpuchert@alice-dsl.net>
- Update to version (wasi-sdk-)19.
- Rebase workaround-broken-makefile.patch.
- Add undefine-gcc-macros.patch: ignore new macros for now to fix
build with Clang 16.
- Declare the package as noarch: the binaries are for WebAssembly,
not the host architecture.
-------------------------------------------------------------------
Fri Jul 29 00:34:36 UTC 2022 - William Brown <william.brown@suse.com>
- Update services to comply with OBS
- Fix rpmlintrc
-------------------------------------------------------------------
Wed Apr 20 13:32:28 UTC 2022 - Martin Sirringhaus <martin.sirringhaus@suse.com>
- Add rpmlintrc to suppress errors for now
- Add workaround-broken-makefile.patch for cleaner build/install
separation
-------------------------------------------------------------------
Wed Apr 20 12:48:58 UTC 2022 - Martin Sirringhaus <martin.sirringhaus@suse.com>
- Initial commit

63
wasi-libc.spec Normal file
View File

@ -0,0 +1,63 @@
#
# spec file for package wasi-libc
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: wasi-libc
Version: 20
Release: 0
Summary: WASI libc implementation for WebAssembly
# FIXME: Select a correct license from https://github.com/openSUSE/spec-cleaner#spdx-licenses
License: MIT
URL: https://github.com/WebAssembly/wasi-libc
Source: https://github.com/WebAssembly/wasi-libc/archive/refs/tags/wasi-sdk-%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1: wasi-libc-rpmlintrc
Patch1: workaround-broken-makefile.patch
Patch2: ignore-fpclass-macros.patch
BuildRequires: clang > 10
BuildRequires: llvm > 10
BuildArch: noarch
%description
WASI libc allows cross platform binaries to be created and executed on a variety of platforms
%prep
%setup -q -n wasi-libc-wasi-sdk-%{version}
%patch1 -p1
%patch2 -p1
%build
export CC=clang
export AR=llvm-ar
export NM=llvm-nm
%make_build
%install
export CC=clang
export AR=llvm-ar
export NM=llvm-nm
# The makefile is stupid and compiles everything again if we do `make install`, so we
# do it only once
%make_install INSTALL_DIR="%{buildroot}/%{_datadir}/wasi-sysroot"
# brp-15-strip-debug and -ar call system-strip and ar, which are not wasm-aware, so they will break wasm-files
export NO_BRP_AR=true
export NO_BRP_STRIP_DEBUG=true
%files
%license LICENSE
%{_datadir}/wasi-sysroot/
%changelog

View File

@ -0,0 +1,14 @@
# Workaround as per https://github.com/WebAssembly/wasi-libc/issues/156
diff --git a/Makefile b/Makefile
index f350ecb..52d9ca6 100644
--- a/Makefile
+++ b/Makefile
@@ -708,7 +708,7 @@ check-symbols: startup_files libc
# This ignores whitespace because on Windows the output has CRLF line endings.
diff -wur "expected/$(TARGET_TRIPLE)" "$(SYSROOT_SHARE)"
-install: finish
+install:
mkdir -p "$(INSTALL_DIR)"
cp -r "$(SYSROOT)/lib" "$(SYSROOT)/share" "$(SYSROOT)/include" "$(INSTALL_DIR)"