- Update to version (wasi-sdk-)22.
* Add support for some network APIs. - Rebase workaround-broken-makefile.patch. - Backport upstream patches to fix build with Clang 19: * ignore-gcc-con-destructive-size-macros.patch * ignore-norm-max-macros.patch * ignore-stdc-embed-macros.patch * ignore-wasm-macros-indirect-function-table.patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:rust/wasi-libc?expand=0&rev=17
This commit is contained in:
commit
84ae0c2812
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal 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
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.osc
|
31
ignore-gcc-con-destructive-size-macros.patch
Normal file
31
ignore-gcc-con-destructive-size-macros.patch
Normal file
@ -0,0 +1,31 @@
|
||||
From 13ed98026d1e6f96fa4c0efce3ff849e3040fca3 Mon Sep 17 00:00:00 2001
|
||||
From: Mike Hommey <mh@glandium.org>
|
||||
Date: Tue, 30 Apr 2024 06:46:03 +0900
|
||||
Subject: [PATCH] Adjust Makefile for LLVM trunk (19) as of 2024-04-26 (#492)
|
||||
|
||||
https://github.com/llvm/llvm-project/commit/72c373bfdc9860b3d75e72c219b2c81c90bc4364
|
||||
dded __GCC_(CON|DE)STRUCTIVE_SIZE macros.
|
||||
---
|
||||
Makefile | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 2f9e9fde..f9fd3030 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -873,6 +873,7 @@ check-symbols: startup_files libc
|
||||
@# TODO: Filter out __FPCLASS_* that are new to clang 17.
|
||||
@# TODO: Filter out __FLT128_* that are new to clang 18.
|
||||
@# TODO: Filter out __MEMORY_SCOPE_* that are new to clang 18.
|
||||
+ @# TODO: Filter out __GCC_(CON|DE)STRUCTIVE_SIZE that are new to clang 19.
|
||||
@# TODO: clang defined __FLT_EVAL_METHOD__ until clang 15, so we force-undefine it
|
||||
@# for older versions.
|
||||
@# TODO: Undefine __wasm_mutable_globals__ and __wasm_sign_ext__, that are new to
|
||||
@@ -907,6 +908,7 @@ check-symbols: startup_files libc
|
||||
| grep -v '^#define __FPCLASS_' \
|
||||
| grep -v '^#define __FLT128_' \
|
||||
| grep -v '^#define __MEMORY_SCOPE_' \
|
||||
+ | grep -v '^#define __GCC_\(CON\|DE\)STRUCTIVE_SIZE' \
|
||||
| grep -v '^#define NDEBUG' \
|
||||
| grep -v '^#define __OPTIMIZE__' \
|
||||
| grep -v '^#define assert' \
|
30
ignore-norm-max-macros.patch
Normal file
30
ignore-norm-max-macros.patch
Normal file
@ -0,0 +1,30 @@
|
||||
From d43dcc63d26013264bb58241e53bde9318349443 Mon Sep 17 00:00:00 2001
|
||||
From: Mike Hommey <mh@glandium.org>
|
||||
Date: Fri, 12 Jul 2024 08:11:35 +0900
|
||||
Subject: [PATCH] Adjust Makefile for LLVM trunk (19) as of 2024-07-10 (#512)
|
||||
|
||||
https://github.com/llvm/llvm-project/commit/0e7590a25cd2e49c5849cc7d2facd5810f8900ce
|
||||
---
|
||||
Makefile | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 0d2a3144..5e6e7734 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -872,6 +872,7 @@ check-symbols: startup_files libc
|
||||
@# TODO: Filter out __MEMORY_SCOPE_* that are new to clang 18.
|
||||
@# TODO: Filter out __GCC_(CON|DE)STRUCTIVE_SIZE that are new to clang 19.
|
||||
@# TODO: Filter out __STDC_EMBED_* that are new to clang 19.
|
||||
+ @# TODO: Filter out __*_NORM_MAX__ that are new to clang 19.
|
||||
@# TODO: clang defined __FLT_EVAL_METHOD__ until clang 15, so we force-undefine it
|
||||
@# for older versions.
|
||||
@# TODO: Undefine __wasm_mutable_globals__ and __wasm_sign_ext__, that are new to
|
||||
@@ -912,6 +913,7 @@ check-symbols: startup_files libc
|
||||
| grep -v '^#define __MEMORY_SCOPE_' \
|
||||
| grep -v '^#define __GCC_\(CON\|DE\)STRUCTIVE_SIZE' \
|
||||
| grep -v '^#define __STDC_EMBED_' \
|
||||
+ | grep -v '^#define __\(DBL\|FLT\|LDBL\)_NORM_MAX__' \
|
||||
| grep -v '^#define NDEBUG' \
|
||||
| grep -v '^#define __OPTIMIZE__' \
|
||||
| grep -v '^#define assert' \
|
30
ignore-stdc-embed-macros.patch
Normal file
30
ignore-stdc-embed-macros.patch
Normal file
@ -0,0 +1,30 @@
|
||||
From 320bbbcced68ce8e564b0dc4c8f80a5a5ad21a9c Mon Sep 17 00:00:00 2001
|
||||
From: Mike Hommey <mh@glandium.org>
|
||||
Date: Sat, 22 Jun 2024 01:49:33 +0900
|
||||
Subject: [PATCH] Adjust Makefile for LLVM trunk (19) as of 2024-06-20 (#509)
|
||||
|
||||
https://github.com/llvm/llvm-project/commit/41c6e4379204ffc00948edd33d59ba5ebbceaba2
|
||||
---
|
||||
Makefile | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 4192ecbb..0d2a3144 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -871,6 +871,7 @@ check-symbols: startup_files libc
|
||||
@# TODO: Filter out __FLT128_* that are new to clang 18.
|
||||
@# TODO: Filter out __MEMORY_SCOPE_* that are new to clang 18.
|
||||
@# TODO: Filter out __GCC_(CON|DE)STRUCTIVE_SIZE that are new to clang 19.
|
||||
+ @# TODO: Filter out __STDC_EMBED_* that are new to clang 19.
|
||||
@# TODO: clang defined __FLT_EVAL_METHOD__ until clang 15, so we force-undefine it
|
||||
@# for older versions.
|
||||
@# TODO: Undefine __wasm_mutable_globals__ and __wasm_sign_ext__, that are new to
|
||||
@@ -910,6 +911,7 @@ check-symbols: startup_files libc
|
||||
| grep -v '^#define __FLT128_' \
|
||||
| grep -v '^#define __MEMORY_SCOPE_' \
|
||||
| grep -v '^#define __GCC_\(CON\|DE\)STRUCTIVE_SIZE' \
|
||||
+ | grep -v '^#define __STDC_EMBED_' \
|
||||
| grep -v '^#define NDEBUG' \
|
||||
| grep -v '^#define __OPTIMIZE__' \
|
||||
| grep -v '^#define assert' \
|
44
ignore-wasm-macros-indirect-function-table.patch
Normal file
44
ignore-wasm-macros-indirect-function-table.patch
Normal file
@ -0,0 +1,44 @@
|
||||
From 129ee9b64be8724745c4ebd45c21dcdc5fd23e22 Mon Sep 17 00:00:00 2001
|
||||
From: Mike Hommey <mh@glandium.org>
|
||||
Date: Wed, 1 May 2024 23:30:33 +0900
|
||||
Subject: [PATCH] Adjust Makefile for LLVM trunk (19) as of 2024-04-30 (#493)
|
||||
|
||||
https://github.com/llvm/llvm-project/commit/5bbf1ea8f18d1f99637b7b8bf6b985c186c808f6
|
||||
added __wasm_multivalue__ and __wasm_reference_types__, and the latter
|
||||
also makes libraries reference the undefined __indirect_function_table
|
||||
symbol, which is provided by the linker.
|
||||
---
|
||||
Makefile | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index f9fd3030..b0407968 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -836,7 +836,7 @@ check-symbols: startup_files libc
|
||||
for undef_sym in $$("$(NM)" --undefined-only "$(SYSROOT_LIB)"/libc.a "$(SYSROOT_LIB)"/libc-*.a "$(SYSROOT_LIB)"/*.o \
|
||||
|grep ' U ' |sed 's/.* U //' |LC_ALL=C sort |uniq); do \
|
||||
grep -q '\<'$$undef_sym'\>' "$(DEFINED_SYMBOLS)" || echo $$undef_sym; \
|
||||
- done | grep -E -v "^__mul|__memory_base" > "$(UNDEFINED_SYMBOLS)"
|
||||
+ done | grep -E -v "^__mul|__memory_base|__indirect_function_table" > "$(UNDEFINED_SYMBOLS)"
|
||||
grep '^_*imported_wasi_' "$(UNDEFINED_SYMBOLS)" \
|
||||
> "$(SYSROOT_LIB)/libc.imports"
|
||||
|
||||
@@ -878,6 +878,8 @@ check-symbols: startup_files libc
|
||||
@# for older versions.
|
||||
@# TODO: Undefine __wasm_mutable_globals__ and __wasm_sign_ext__, that are new to
|
||||
@# clang 16 for -mcpu=generic.
|
||||
+ @# TODO: Undefine __wasm_multivalue__ and __wasm_reference_types__, that are new to
|
||||
+ @# clang 19 for -mcpu=generic.
|
||||
@# TODO: As of clang 16, __GNUC_VA_LIST is #defined without a value.
|
||||
$(CC) $(CFLAGS) "$(SYSROOT_SHARE)/include-all.c" \
|
||||
-isystem $(SYSROOT_INC) \
|
||||
@@ -894,6 +896,8 @@ check-symbols: startup_files libc
|
||||
-U__clang_wide_literal_encoding__ \
|
||||
-U__wasm_mutable_globals__ \
|
||||
-U__wasm_sign_ext__ \
|
||||
+ -U__wasm_multivalue__ \
|
||||
+ -U__wasm_reference_types__ \
|
||||
-U__GNUC__ \
|
||||
-U__GNUC_MINOR__ \
|
||||
-U__GNUC_PATCHLEVEL__ \
|
3
wasi-libc-21.tar.gz
Normal file
3
wasi-libc-21.tar.gz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4a2a3e3b120ba1163c57f34ac79c3de720a8355ee3a753d81f1f0c58c4cf6017
|
||||
size 1313865
|
3
wasi-libc-22.tar.gz
Normal file
3
wasi-libc-22.tar.gz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7efede97bd490c336a6fff4252dffaef5247149d74e4208865cd5e59908d529d
|
||||
size 1410600
|
12
wasi-libc-rpmlintrc
Normal file
12
wasi-libc-rpmlintrc
Normal 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 .*')
|
||||
|
67
wasi-libc.changes
Normal file
67
wasi-libc.changes
Normal file
@ -0,0 +1,67 @@
|
||||
-------------------------------------------------------------------
|
||||
Sat Sep 21 21:39:37 UTC 2024 - Aaron Puchert <aaronpuchert@alice-dsl.net>
|
||||
|
||||
- Update to version (wasi-sdk-)22.
|
||||
* Add support for some network APIs.
|
||||
- Rebase workaround-broken-makefile.patch.
|
||||
- Backport upstream patches to fix build with Clang 19:
|
||||
* ignore-gcc-con-destructive-size-macros.patch
|
||||
* ignore-norm-max-macros.patch
|
||||
* ignore-stdc-embed-macros.patch
|
||||
* ignore-wasm-macros-indirect-function-table.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Feb 22 21:05:54 UTC 2024 - Aaron Puchert <aaronpuchert@alice-dsl.net>
|
||||
|
||||
- Update to version (wasi-sdk-)21.
|
||||
* Compatibility with Clang 18.
|
||||
* Add shared library support.
|
||||
- Drop obsolete ignore-fpclass-macros.patch.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Feb 20 15:16:08 UTC 2024 - Dominique Leuenberger <dimstar@opensuse.org>
|
||||
|
||||
- Use %autosetup macro. Allows to eliminate the usage of deprecated
|
||||
%patchN
|
||||
|
||||
-------------------------------------------------------------------
|
||||
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
|
64
wasi-libc.spec
Normal file
64
wasi-libc.spec
Normal file
@ -0,0 +1,64 @@
|
||||
#
|
||||
# spec file for package wasi-libc
|
||||
#
|
||||
# Copyright (c) 2024 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: 22
|
||||
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-gcc-con-destructive-size-macros.patch
|
||||
Patch3: ignore-wasm-macros-indirect-function-table.patch
|
||||
Patch4: ignore-stdc-embed-macros.patch
|
||||
Patch5: ignore-norm-max-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
|
||||
%autosetup -p1 -n wasi-libc-wasi-sdk-%{version}
|
||||
|
||||
%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
|
14
workaround-broken-makefile.patch
Normal file
14
workaround-broken-makefile.patch
Normal file
@ -0,0 +1,14 @@
|
||||
# Workaround as per https://github.com/WebAssembly/wasi-libc/issues/156
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 2f9e9fd..8318748 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -917,7 +917,7 @@ check-symbols: startup_files libc
|
||||
# This ignores whitespace because on Windows the output has CRLF line endings.
|
||||
diff -wur "$(EXPECTED_TARGET_DIR)" "$(SYSROOT_SHARE)"
|
||||
|
||||
-install: finish
|
||||
+install:
|
||||
mkdir -p "$(INSTALL_DIR)"
|
||||
cp -r "$(SYSROOT)/lib" "$(SYSROOT)/share" "$(SYSROOT)/include" "$(INSTALL_DIR)"
|
||||
|
Loading…
Reference in New Issue
Block a user