From 20bf9b7d378d6bbaf18a39fcb34a5557d2aa5ae4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Thu, 28 Dec 2023 13:20:50 +0100 Subject: [PATCH] Sync from SUSE:ALP:Source:Standard:1.0 wasi-libc revision dd6c76815fe0f13c9bdd44c72ded2a06 --- .gitattributes | 23 ++++++++++++ ignore-fpclass-macros.patch | 13 +++++++ wasi-libc-20.tar.gz | 3 ++ wasi-libc-rpmlintrc | 12 ++++++ wasi-libc.changes | 41 +++++++++++++++++++++ wasi-libc.spec | 63 ++++++++++++++++++++++++++++++++ workaround-broken-makefile.patch | 14 +++++++ 7 files changed, 169 insertions(+) create mode 100644 .gitattributes create mode 100644 ignore-fpclass-macros.patch create mode 100644 wasi-libc-20.tar.gz create mode 100644 wasi-libc-rpmlintrc create mode 100644 wasi-libc.changes create mode 100644 wasi-libc.spec create mode 100644 workaround-broken-makefile.patch diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..fecc750 --- /dev/null +++ b/.gitattributes @@ -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 diff --git a/ignore-fpclass-macros.patch b/ignore-fpclass-macros.patch new file mode 100644 index 0000000..2bf33ea --- /dev/null +++ b/ignore-fpclass-macros.patch @@ -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. diff --git a/wasi-libc-20.tar.gz b/wasi-libc-20.tar.gz new file mode 100644 index 0000000..abd8000 --- /dev/null +++ b/wasi-libc-20.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0a1c09c8c1da62a1ba214254ff4c9db6b60979c00f648a5eae33831d6ee2840e +size 1311597 diff --git a/wasi-libc-rpmlintrc b/wasi-libc-rpmlintrc new file mode 100644 index 0000000..ded75f4 --- /dev/null +++ b/wasi-libc-rpmlintrc @@ -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 .*') + diff --git a/wasi-libc.changes b/wasi-libc.changes new file mode 100644 index 0000000..ad40ae4 --- /dev/null +++ b/wasi-libc.changes @@ -0,0 +1,41 @@ +------------------------------------------------------------------- +Fri Sep 22 17:06:06 UTC 2023 - Aaron Puchert + +- 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 + +- 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 + +- Update services to comply with OBS +- Fix rpmlintrc + +------------------------------------------------------------------- +Wed Apr 20 13:32:28 UTC 2022 - Martin Sirringhaus + +- 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 + +- Initial commit diff --git a/wasi-libc.spec b/wasi-libc.spec new file mode 100644 index 0000000..cfba619 --- /dev/null +++ b/wasi-libc.spec @@ -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 diff --git a/workaround-broken-makefile.patch b/workaround-broken-makefile.patch new file mode 100644 index 0000000..92f1d96 --- /dev/null +++ b/workaround-broken-makefile.patch @@ -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)" +