From 155e969f522814bade80d7fb0d4505143a0cbae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Stan=C4=9Bk?= Date: Fri, 31 Jan 2025 16:51:03 +0100 Subject: [PATCH 01/10] gating: remove rpmdeplint case from branched Fedoras According to matrix discussion in #fedora-ci:fedoraproject.org, rpmdeplint is run only on rawhide builds. --- gating.yaml | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/gating.yaml b/gating.yaml index f2f68de..e943849 100644 --- a/gating.yaml +++ b/gating.yaml @@ -1,6 +1,6 @@ --- !Policy # testing repository product_versions: - - fedora-* + - fedora-rawhide decision_contexts: [bodhi_update_push_testing] subject_type: koji_build rules: @@ -10,7 +10,7 @@ rules: - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.installability.functional} --- !Policy # stable repository product_versions: - - fedora-* + - fedora-rawhide decision_contexts: [bodhi_update_push_stable] subject_type: koji_build rules: @@ -19,3 +19,22 @@ rules: - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.rpminspect.static-analysis} - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.installability.functional} ... +--- !Policy # testing repository +product_versions: + - fedora-* +decision_contexts: [bodhi_update_push_testing] +subject_type: koji_build +rules: + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.rpminspect.static-analysis} + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.installability.functional} +--- !Policy # stable repository +product_versions: + - fedora-* +decision_contexts: [bodhi_update_push_stable] +subject_type: koji_build +rules: + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.rpminspect.static-analysis} + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.installability.functional} +... From c2b2d65c5fedb67a50de1a89fc00e8a4ae434d46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Stan=C4=9Bk?= Date: Fri, 27 Jun 2025 13:50:49 +0200 Subject: [PATCH 02/10] Fix build with LLVM/Clang 20 Closes: #7 --- .gitignore | 1 + ...for-LLVM-trunk-20-as-of-2025-01-26-5.patch | 34 +++++++++++++++++++ wasi-libc.spec | 2 ++ 3 files changed, 37 insertions(+) create mode 100644 0002-Adjust-Makefile-for-LLVM-trunk-20-as-of-2025-01-26-5.patch diff --git a/.gitignore b/.gitignore index a330ab7..e128b75 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /wasi-libc-wasi-sdk-*.tar.gz +/wasi-libc-*-build/ diff --git a/0002-Adjust-Makefile-for-LLVM-trunk-20-as-of-2025-01-26-5.patch b/0002-Adjust-Makefile-for-LLVM-trunk-20-as-of-2025-01-26-5.patch new file mode 100644 index 0000000..7bb37f4 --- /dev/null +++ b/0002-Adjust-Makefile-for-LLVM-trunk-20-as-of-2025-01-26-5.patch @@ -0,0 +1,34 @@ +From 293ea3296973c85a02cf7db6a1fe8b9c6d28e941 Mon Sep 17 00:00:00 2001 +From: Mike Hommey +Date: Wed, 29 Jan 2025 08:26:30 +0900 +Subject: [PATCH] Adjust Makefile for LLVM trunk (20) as of 2025-01-26 (#564) + +https://github.com/llvm/llvm-project/commit/33ad474c45e6d7a0de7bc75e15e27cf6cb9ff895 +Signed-off-by: rpm-build +--- + Makefile | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/Makefile b/Makefile +index c340da4..b14f6cf 100644 +--- a/Makefile ++++ b/Makefile +@@ -893,6 +893,7 @@ check-symbols: $(STARTUP_FILES) libc + @# 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: Filter out __INT*_C() that are new to clang 20. + @# 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 +@@ -943,6 +944,7 @@ check-symbols: $(STARTUP_FILES) libc + | grep -v '^#define __OPTIMIZE__' \ + | grep -v '^#define assert' \ + | grep -v '^#define __NO_INLINE__' \ ++ | grep -v '^#define __U\?INT.*_C(' \ + > "$(SYSROOT_SHARE)/predefined-macros.txt" + + # Check that the computed metadata matches the expected metadata. +-- +2.50.0 + diff --git a/wasi-libc.spec b/wasi-libc.spec index 67cdd2e..64c56d8 100644 --- a/wasi-libc.spec +++ b/wasi-libc.spec @@ -10,6 +10,8 @@ Source1: smoke-test.c # Allow using artifacts from %%build in %%install instead of recompiling Patch: 0001-make-don-t-rebuild-files-on-make-install.patch +# Compatibility patches from upstream main +Patch: 0002-Adjust-Makefile-for-LLVM-trunk-20-as-of-2025-01-26-5.patch # This contains parts of the musl C library; specify as bundled so we get notified about potential vulnerabilities %global musl_version 1.2.3 From 5dcb09ac1297ff1f6396f0c308f43a75f63e7ca6 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 25 Jul 2025 20:17:36 +0000 Subject: [PATCH 03/10] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild From b43d471b620726377e2a8b335092af70ac0e1950 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Stan=C4=9Bk?= Date: Mon, 28 Jul 2025 13:51:18 +0200 Subject: [PATCH 04/10] Update to version 27 (rhbz#2383871) --- ...-don-t-rebuild-files-on-make-install.patch | 26 +++++++++---------- sources | 2 +- wasi-libc.spec | 5 ++-- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/0001-make-don-t-rebuild-files-on-make-install.patch b/0001-make-don-t-rebuild-files-on-make-install.patch index 9c3c9e5..0514171 100644 --- a/0001-make-don-t-rebuild-files-on-make-install.patch +++ b/0001-make-don-t-rebuild-files-on-make-install.patch @@ -1,4 +1,4 @@ -From 74a068d26a61e744f607fbf6d8355f2b69e82e4e Mon Sep 17 00:00:00 2001 +From ff153ab204af3a48479ed25d90ad9cc34ad4af49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Stan=C4=9Bk?= Date: Mon, 29 Aug 2022 15:07:34 +0200 Subject: [PATCH] make: don't rebuild files on `make install` @@ -22,10 +22,10 @@ Signed-off-by: rpm-build 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile -index 00dd30812884..c340da4e0153 100644 +index 26bdcfa..919fc54 100644 --- a/Makefile +++ b/Makefile -@@ -768,6 +768,7 @@ endif +@@ -835,6 +835,7 @@ endif endif libc_so: $(INCLUDE_DIRS) $(LIBC_SO) @@ -33,7 +33,7 @@ index 00dd30812884..c340da4e0153 100644 STATIC_LIBS = \ $(SYSROOT_LIB)/libc.a \ -@@ -788,6 +789,7 @@ STATIC_LIBS += \ +@@ -851,6 +852,7 @@ STATIC_LIBS += \ endif libc: $(INCLUDE_DIRS) $(STATIC_LIBS) @@ -41,15 +41,15 @@ index 00dd30812884..c340da4e0153 100644 DUMMY := m rt pthread crypt util xnet resolv DUMMY_LIBS := $(patsubst %,$(SYSROOT_LIB)/lib%.a,$(DUMMY)) -@@ -804,6 +806,7 @@ finish: $(STARTUP_FILES) libc $(DUMMY_LIBS) +@@ -867,6 +869,7 @@ no-check-symbols: $(STARTUP_FILES) libc $(DUMMY_LIBS) # # The build succeeded! The generated sysroot is in $(SYSROOT). # + touch $@ - ifeq ($(LTO),no) - # The check for defined and undefined symbols expects there to be a heap -@@ -946,6 +949,8 @@ check-symbols: $(STARTUP_FILES) libc + finish: no-check-symbols + +@@ -1014,6 +1017,8 @@ check-symbols: $(STARTUP_FILES) libc # This ignores whitespace because on Windows the output has CRLF line endings. diff -wur "$(EXPECTED_TARGET_DIR)" "$(SYSROOT_SHARE)" @@ -58,14 +58,14 @@ index 00dd30812884..c340da4e0153 100644 ##### BINDINGS ################################################################# # The `bindings` target retrieves the necessary WIT files for the wasi-cli world -@@ -1021,5 +1026,6 @@ clean: +@@ -1089,5 +1094,6 @@ clean: $(RM) -r "$(BINDING_WORK_DIR)" $(RM) -r "$(OBJDIR)" $(RM) -r "$(SYSROOT)" -+ $(RM) check-symbols libc_so libc finish ++ $(RM) check-symbols no-check-symbols libc_so libc --.PHONY: default libc libc_so finish install clean check-symbols bindings -+.PHONY: default install clean bindings +-.PHONY: default libc libc_so finish install clean check-symbols no-check-symbols bindings ++.PHONY: default finish install clean bindings -- -2.48.1 +2.50.1 diff --git a/sources b/sources index ed766a1..67250bc 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (wasi-libc-wasi-sdk-25.tar.gz) = 580716fbc152be19e2e9724f3483a0a580a168be0cd6d105d37b0ebd0d11bd36d7d9db63984eb2cc7b3aaff2fc9446d9558d1469b538a79b7de465a1113560ea +SHA512 (wasi-libc-wasi-sdk-27.tar.gz) = dfc2c36fabf32f465fc833ed0b10efffc9a35c68162ecc3e8d656d1d684d170b734d55e790614d12d925d17f49d60f0d2d01c46cecac941cf62d68eda84df13e diff --git a/wasi-libc.spec b/wasi-libc.spec index 64c56d8..db90ea3 100644 --- a/wasi-libc.spec +++ b/wasi-libc.spec @@ -1,6 +1,6 @@ Name: wasi-libc Summary: C library implementation for WebAssembly System Interface -Version: 25 +Version: 27 Release: %autorelease License: Apache-2.0 WITH LLVM-exception AND Apache-2.0 AND MIT AND BSD-2-Clause @@ -11,10 +11,9 @@ Source1: smoke-test.c # Allow using artifacts from %%build in %%install instead of recompiling Patch: 0001-make-don-t-rebuild-files-on-make-install.patch # Compatibility patches from upstream main -Patch: 0002-Adjust-Makefile-for-LLVM-trunk-20-as-of-2025-01-26-5.patch # This contains parts of the musl C library; specify as bundled so we get notified about potential vulnerabilities -%global musl_version 1.2.3 +%global musl_version 1.2.5 # Although these packages provide binary files, they are not targeted # for the build platform, but for wasm32-wasi. From 844381a0cf584ff29e20eaedc508f2959d713da8 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 17 Jan 2026 20:07:20 +0000 Subject: [PATCH 05/10] Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild From 0e92b6afd07a4fb338daaaf78f009fa27560d861 Mon Sep 17 00:00:00 2001 From: Paul Murphy Date: Fri, 9 Jan 2026 11:45:48 -0600 Subject: [PATCH 06/10] Update to version 29 (rhbz#2415063) The makefile now aggressively tries to link compiler-rt libraries which are neither built nor provided via fedora's llvm. This seems to be a requirement for PIC variants which fedora does not appear to provide. This probably indicates there are portions of the library which are not usable due to the lack of compiler-rt. If there are such users, they should (and likely should have) receive a linker error. --- ...-don-t-rebuild-files-on-make-install.patch | 43 +++++++++++------ ...linking-compiler-rt-builtins-library.patch | 47 +++++++++++++++++++ sources | 2 +- wasi-libc.spec | 6 ++- 4 files changed, 82 insertions(+), 16 deletions(-) create mode 100644 0002-Disable-linking-compiler-rt-builtins-library.patch diff --git a/0001-make-don-t-rebuild-files-on-make-install.patch b/0001-make-don-t-rebuild-files-on-make-install.patch index 0514171..9dd8bff 100644 --- a/0001-make-don-t-rebuild-files-on-make-install.patch +++ b/0001-make-don-t-rebuild-files-on-make-install.patch @@ -1,7 +1,7 @@ -From ff153ab204af3a48479ed25d90ad9cc34ad4af49 Mon Sep 17 00:00:00 2001 +From 49cd232ebf6d8e35da47ebe9d27f69e3dab9cdeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Stan=C4=9Bk?= Date: Mon, 29 Aug 2022 15:07:34 +0200 -Subject: [PATCH] make: don't rebuild files on `make install` +Subject: [PATCH 1/2] make: don't rebuild files on `make install` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -18,14 +18,22 @@ Adapted from [Debian patch][]. Signed-off-by: Jan Staněk Signed-off-by: rpm-build --- - Makefile | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) + Makefile | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile -index 26bdcfa..919fc54 100644 +index cd8deb4..e0776fb 100644 --- a/Makefile +++ b/Makefile -@@ -835,6 +835,7 @@ endif +@@ -831,6 +831,7 @@ $(STARTUP_FILES): $(INCLUDE_DIRS) $(LIBC_BOTTOM_HALF_CRT_OBJS) + touch $@ + + startup_files: $(STARTUP_FILES) ++ touch $@ + + # TODO: As of this writing, wasi_thread_start.s uses non-position-independent + # code, and I'm not sure how to make it position-independent. Once we've done +@@ -850,6 +851,7 @@ endif endif libc_so: $(INCLUDE_DIRS) $(LIBC_SO) @@ -33,15 +41,15 @@ index 26bdcfa..919fc54 100644 STATIC_LIBS = \ $(SYSROOT_LIB)/libc.a \ -@@ -851,6 +852,7 @@ STATIC_LIBS += \ +@@ -866,6 +868,7 @@ STATIC_LIBS += \ endif - libc: $(INCLUDE_DIRS) $(STATIC_LIBS) + libc: $(INCLUDE_DIRS) $(STATIC_LIBS) builtins + touch $@ DUMMY := m rt pthread crypt util xnet resolv DUMMY_LIBS := $(patsubst %,$(SYSROOT_LIB)/lib%.a,$(DUMMY)) -@@ -867,6 +869,7 @@ no-check-symbols: $(STARTUP_FILES) libc $(DUMMY_LIBS) +@@ -882,6 +885,7 @@ no-check-symbols: $(STARTUP_FILES) libc $(DUMMY_LIBS) # # The build succeeded! The generated sysroot is in $(SYSROOT). # @@ -49,7 +57,7 @@ index 26bdcfa..919fc54 100644 finish: no-check-symbols -@@ -1014,6 +1017,8 @@ check-symbols: $(STARTUP_FILES) libc +@@ -1026,6 +1030,8 @@ endif # This ignores whitespace because on Windows the output has CRLF line endings. diff -wur "$(EXPECTED_TARGET_DIR)" "$(SYSROOT_SHARE)" @@ -58,14 +66,21 @@ index 26bdcfa..919fc54 100644 ##### BINDINGS ################################################################# # The `bindings` target retrieves the necessary WIT files for the wasi-cli world -@@ -1089,5 +1094,6 @@ clean: +@@ -1098,10 +1104,13 @@ bindings: $(BINDING_WORK_DIR)/wasi-cli $(BINDING_WORK_DIR)/wit-bindgen + sed -i 's/extern void exit_exit/_Noreturn extern void exit_exit/' libc-bottom-half/headers/public/wasi/wasip2.h + sed -i 's/extern void __wasm_import_exit_exit/_Noreturn extern void __wasm_import_exit_exit/' libc-bottom-half/sources/wasip2.c + ++ touch $@ ++ + + clean: $(RM) -r "$(BINDING_WORK_DIR)" $(RM) -r "$(OBJDIR)" $(RM) -r "$(SYSROOT)" -+ $(RM) check-symbols no-check-symbols libc_so libc ++ $(RM) check-symbols no-check-symbols libc_so libc bindings startup_files --.PHONY: default libc libc_so finish install clean check-symbols no-check-symbols bindings +-.PHONY: default libc libc_so finish install clean check-symbols no-check-symbols bindings startup_files +.PHONY: default finish install clean bindings -- -2.50.1 +2.52.0 diff --git a/0002-Disable-linking-compiler-rt-builtins-library.patch b/0002-Disable-linking-compiler-rt-builtins-library.patch new file mode 100644 index 0000000..7e6ab6c --- /dev/null +++ b/0002-Disable-linking-compiler-rt-builtins-library.patch @@ -0,0 +1,47 @@ +From e23112ea2e6e3422794388035129a052918983ff Mon Sep 17 00:00:00 2001 +From: Paul Murphy +Date: Fri, 9 Jan 2026 11:28:46 -0600 +Subject: [PATCH 2/2] Disable linking compiler-rt builtins library + +The instructions lead us to believe it was always necessary, +but so far we haven't and had no complaints yet. +--- + Makefile | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +diff --git a/Makefile b/Makefile +index e0776fb..b1fac34 100644 +--- a/Makefile ++++ b/Makefile +@@ -643,17 +643,15 @@ builtins: $(BUILTINS_LIB_PATH) + + # Note: libc.so is special because it shouldn't link to libc.so, and the + # -nodefaultlibs flag here disables the default `-lc` logic that clang +-# has. Note though that this also disables linking of compiler-rt +-# libraries so that is explicitly passed in via `$(BUILTINS_LIB_PATH)` ++# has. + # + # Note: --allow-undefined-file=linker-provided-symbols.txt is + # a workaround for https://github.com/llvm/llvm-project/issues/103592 +-$(SYSROOT_LIB)/libc.so: $(OBJDIR)/libc.so.a $(BUILTINS_LIB_PATH) ++$(SYSROOT_LIB)/libc.so: $(OBJDIR)/libc.so.a + $(CC) --target=${TARGET_TRIPLE} -nodefaultlibs \ + -shared --sysroot=$(SYSROOT) \ + -o $@ -Wl,--whole-archive $< -Wl,--no-whole-archive \ + -Wl,--allow-undefined-file=linker-provided-symbols.txt \ +- $(BUILTINS_LIB_PATH) \ + $(EXTRA_CFLAGS) $(LDFLAGS) + + # Note that unlike `libc.so` above this rule does not pass `-nodefaultlibs` +@@ -867,7 +865,7 @@ STATIC_LIBS += \ + $(SYSROOT_LIB)/libsetjmp.a + endif + +-libc: $(INCLUDE_DIRS) $(STATIC_LIBS) builtins ++libc: $(INCLUDE_DIRS) $(STATIC_LIBS) + touch $@ + + DUMMY := m rt pthread crypt util xnet resolv +-- +2.52.0 + diff --git a/sources b/sources index 67250bc..79e8283 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (wasi-libc-wasi-sdk-27.tar.gz) = dfc2c36fabf32f465fc833ed0b10efffc9a35c68162ecc3e8d656d1d684d170b734d55e790614d12d925d17f49d60f0d2d01c46cecac941cf62d68eda84df13e +SHA512 (wasi-libc-wasi-sdk-29.tar.gz) = ee803c0eb6c5dab119660926cb2d3ce044cc6f1f32b7cc266d89c25c031480f34c27ab2638df34e192321add629699c6a473438b94f899a28ae9e806ab07d87b diff --git a/wasi-libc.spec b/wasi-libc.spec index db90ea3..d34d17e 100644 --- a/wasi-libc.spec +++ b/wasi-libc.spec @@ -1,6 +1,6 @@ Name: wasi-libc Summary: C library implementation for WebAssembly System Interface -Version: 27 +Version: 29 Release: %autorelease License: Apache-2.0 WITH LLVM-exception AND Apache-2.0 AND MIT AND BSD-2-Clause @@ -10,6 +10,10 @@ Source1: smoke-test.c # Allow using artifacts from %%build in %%install instead of recompiling Patch: 0001-make-don-t-rebuild-files-on-make-install.patch + +# Remove explicit linking to compiler-rt.builtins library +Patch: 0002-Disable-linking-compiler-rt-builtins-library.patch + # Compatibility patches from upstream main # This contains parts of the musl C library; specify as bundled so we get notified about potential vulnerabilities From a5fed477131c4ea2b5baceb21d98ac2933bcb078 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 16 Apr 2026 18:30:51 -0700 Subject: [PATCH 07/10] Update to version 32 (rhbz#2439212) --- ...-don-t-rebuild-files-on-make-install.patch | 86 ------------------- ...linking-compiler-rt-builtins-library.patch | 47 ---------- sources | 2 +- wasi-libc.spec | 26 +++--- 4 files changed, 14 insertions(+), 147 deletions(-) delete mode 100644 0001-make-don-t-rebuild-files-on-make-install.patch delete mode 100644 0002-Disable-linking-compiler-rt-builtins-library.patch diff --git a/0001-make-don-t-rebuild-files-on-make-install.patch b/0001-make-don-t-rebuild-files-on-make-install.patch deleted file mode 100644 index 9dd8bff..0000000 --- a/0001-make-don-t-rebuild-files-on-make-install.patch +++ /dev/null @@ -1,86 +0,0 @@ -From 49cd232ebf6d8e35da47ebe9d27f69e3dab9cdeb Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jan=20Stan=C4=9Bk?= -Date: Mon, 29 Aug 2022 15:07:34 +0200 -Subject: [PATCH 1/2] make: don't rebuild files on `make install` -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The original Makefile does not allow for clean separation of build and -install steps, and re-compiles the library on `make install`. - -Using [empty target files][], the re-compilation is skipped on install. -Adapted from [Debian patch][]. - -[empty target files]: https://www.gnu.org/software/make/manual/make.html#Empty-Targets -[Debian patch]: https://salsa.debian.org/rust-team/wasi-libc/-/blob/master/debian/patches/dont-rebuild-install.patch - -Signed-off-by: Jan Staněk -Signed-off-by: rpm-build ---- - Makefile | 11 ++++++++++- - 1 file changed, 10 insertions(+), 1 deletion(-) - -diff --git a/Makefile b/Makefile -index cd8deb4..e0776fb 100644 ---- a/Makefile -+++ b/Makefile -@@ -831,6 +831,7 @@ $(STARTUP_FILES): $(INCLUDE_DIRS) $(LIBC_BOTTOM_HALF_CRT_OBJS) - touch $@ - - startup_files: $(STARTUP_FILES) -+ touch $@ - - # TODO: As of this writing, wasi_thread_start.s uses non-position-independent - # code, and I'm not sure how to make it position-independent. Once we've done -@@ -850,6 +851,7 @@ endif - endif - - libc_so: $(INCLUDE_DIRS) $(LIBC_SO) -+ touch $@ - - STATIC_LIBS = \ - $(SYSROOT_LIB)/libc.a \ -@@ -866,6 +868,7 @@ STATIC_LIBS += \ - endif - - libc: $(INCLUDE_DIRS) $(STATIC_LIBS) builtins -+ touch $@ - - DUMMY := m rt pthread crypt util xnet resolv - DUMMY_LIBS := $(patsubst %,$(SYSROOT_LIB)/lib%.a,$(DUMMY)) -@@ -882,6 +885,7 @@ no-check-symbols: $(STARTUP_FILES) libc $(DUMMY_LIBS) - # - # The build succeeded! The generated sysroot is in $(SYSROOT). - # -+ touch $@ - - finish: no-check-symbols - -@@ -1026,6 +1030,8 @@ endif - # This ignores whitespace because on Windows the output has CRLF line endings. - diff -wur "$(EXPECTED_TARGET_DIR)" "$(SYSROOT_SHARE)" - -+ touch $@ -+ - - ##### BINDINGS ################################################################# - # The `bindings` target retrieves the necessary WIT files for the wasi-cli world -@@ -1098,10 +1104,13 @@ bindings: $(BINDING_WORK_DIR)/wasi-cli $(BINDING_WORK_DIR)/wit-bindgen - sed -i 's/extern void exit_exit/_Noreturn extern void exit_exit/' libc-bottom-half/headers/public/wasi/wasip2.h - sed -i 's/extern void __wasm_import_exit_exit/_Noreturn extern void __wasm_import_exit_exit/' libc-bottom-half/sources/wasip2.c - -+ touch $@ -+ - - clean: - $(RM) -r "$(BINDING_WORK_DIR)" - $(RM) -r "$(OBJDIR)" - $(RM) -r "$(SYSROOT)" -+ $(RM) check-symbols no-check-symbols libc_so libc bindings startup_files - --.PHONY: default libc libc_so finish install clean check-symbols no-check-symbols bindings startup_files -+.PHONY: default finish install clean bindings --- -2.52.0 - diff --git a/0002-Disable-linking-compiler-rt-builtins-library.patch b/0002-Disable-linking-compiler-rt-builtins-library.patch deleted file mode 100644 index 7e6ab6c..0000000 --- a/0002-Disable-linking-compiler-rt-builtins-library.patch +++ /dev/null @@ -1,47 +0,0 @@ -From e23112ea2e6e3422794388035129a052918983ff Mon Sep 17 00:00:00 2001 -From: Paul Murphy -Date: Fri, 9 Jan 2026 11:28:46 -0600 -Subject: [PATCH 2/2] Disable linking compiler-rt builtins library - -The instructions lead us to believe it was always necessary, -but so far we haven't and had no complaints yet. ---- - Makefile | 8 +++----- - 1 file changed, 3 insertions(+), 5 deletions(-) - -diff --git a/Makefile b/Makefile -index e0776fb..b1fac34 100644 ---- a/Makefile -+++ b/Makefile -@@ -643,17 +643,15 @@ builtins: $(BUILTINS_LIB_PATH) - - # Note: libc.so is special because it shouldn't link to libc.so, and the - # -nodefaultlibs flag here disables the default `-lc` logic that clang --# has. Note though that this also disables linking of compiler-rt --# libraries so that is explicitly passed in via `$(BUILTINS_LIB_PATH)` -+# has. - # - # Note: --allow-undefined-file=linker-provided-symbols.txt is - # a workaround for https://github.com/llvm/llvm-project/issues/103592 --$(SYSROOT_LIB)/libc.so: $(OBJDIR)/libc.so.a $(BUILTINS_LIB_PATH) -+$(SYSROOT_LIB)/libc.so: $(OBJDIR)/libc.so.a - $(CC) --target=${TARGET_TRIPLE} -nodefaultlibs \ - -shared --sysroot=$(SYSROOT) \ - -o $@ -Wl,--whole-archive $< -Wl,--no-whole-archive \ - -Wl,--allow-undefined-file=linker-provided-symbols.txt \ -- $(BUILTINS_LIB_PATH) \ - $(EXTRA_CFLAGS) $(LDFLAGS) - - # Note that unlike `libc.so` above this rule does not pass `-nodefaultlibs` -@@ -867,7 +865,7 @@ STATIC_LIBS += \ - $(SYSROOT_LIB)/libsetjmp.a - endif - --libc: $(INCLUDE_DIRS) $(STATIC_LIBS) builtins -+libc: $(INCLUDE_DIRS) $(STATIC_LIBS) - touch $@ - - DUMMY := m rt pthread crypt util xnet resolv --- -2.52.0 - diff --git a/sources b/sources index 79e8283..6160af5 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (wasi-libc-wasi-sdk-29.tar.gz) = ee803c0eb6c5dab119660926cb2d3ce044cc6f1f32b7cc266d89c25c031480f34c27ab2638df34e192321add629699c6a473438b94f899a28ae9e806ab07d87b +SHA512 (wasi-libc-wasi-sdk-32.tar.gz) = 5a07d2d21789c7ad8669d87a33bd0d397b2c64ebb11de81ee3c1c027754a9a88e06c524526b4b7170fa4dfd7e1bfec0a5f58757103a6fe1a8ab136abc7e8a190 diff --git a/wasi-libc.spec b/wasi-libc.spec index d34d17e..9ee3b6b 100644 --- a/wasi-libc.spec +++ b/wasi-libc.spec @@ -1,6 +1,6 @@ Name: wasi-libc Summary: C library implementation for WebAssembly System Interface -Version: 29 +Version: 32 Release: %autorelease License: Apache-2.0 WITH LLVM-exception AND Apache-2.0 AND MIT AND BSD-2-Clause @@ -8,12 +8,6 @@ URL: https://github.com/WebAssembly/wasi-libc/ Source: %{url}/archive/refs/tags/wasi-sdk-%{version}.tar.gz#/%{name}-wasi-sdk-%{version}.tar.gz Source1: smoke-test.c -# Allow using artifacts from %%build in %%install instead of recompiling -Patch: 0001-make-don-t-rebuild-files-on-make-install.patch - -# Remove explicit linking to compiler-rt.builtins library -Patch: 0002-Disable-linking-compiler-rt-builtins-library.patch - # Compatibility patches from upstream main # This contains parts of the musl C library; specify as bundled so we get notified about potential vulnerabilities @@ -27,9 +21,9 @@ Patch: 0002-Disable-linking-compiler-rt-builtins-library.patch BuildArch: noarch BuildRequires: clang >= 10 +BuildRequires: cmake >= 3.26 BuildRequires: git-core BuildRequires: llvm >= 10 -BuildRequires: make %global toolchain clang # Re-packaging the static library tends to overwrite files @@ -42,13 +36,12 @@ BuildRequires: make %global __brp_strip_lto %{nil} # WASI is a specific architecture; host (build machine) arch flags should not apply by default -%global build_cflags --target=wasm32-wasi -fstack-protector +%global build_cflags -O2 --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' %global _description %{expand: WASI Libc is a libc for WebAssembly programs built on top of WASI system calls. @@ -78,11 +71,18 @@ Summary: C library for WASI - headers and development files cp -p libc-bottom-half/cloudlibc/LICENSE LICENSE-cloudlibc %build -%make_build %{wasi_make_flags} -make %{?_smp_mflags} %{wasi_make_flags} check-symbols +%cmake \ + -DCMAKE_INSTALL_PREFIX='%{wasi_prefix}' \ + -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY \ + -DBUILD_SHARED=OFF \ + -DCHECK_SYMBOLS=ON \ + -DMALLOC=emmalloc \ + -DTARGET_TRIPLE=wasm32-wasi +%cmake_build %install -%make_install %{wasi_make_flags} +%cmake_install +cp -av -t '%{buildroot}%{wasi_prefix}' '%{__cmake_builddir}/sysroot/share' %check # Bundled version checks From 6cd7f100ab74b29e5f1788ddb0803dd198f1e05b Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 17 Jul 2026 08:41:32 +0000 Subject: [PATCH 08/10] Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild From bd5d0c02463a36866cfd6c53800b475eb287a4fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Stan=C4=9Bk?= Date: Wed, 19 Aug 2026 12:26:42 +0200 Subject: [PATCH 09/10] Update to version 33 (rhbz#2513553) --- ...for-LLVM-trunk-20-as-of-2025-01-26-5.patch | 34 ------------------- sources | 2 +- wasi-libc.spec | 2 +- 3 files changed, 2 insertions(+), 36 deletions(-) delete mode 100644 0002-Adjust-Makefile-for-LLVM-trunk-20-as-of-2025-01-26-5.patch diff --git a/0002-Adjust-Makefile-for-LLVM-trunk-20-as-of-2025-01-26-5.patch b/0002-Adjust-Makefile-for-LLVM-trunk-20-as-of-2025-01-26-5.patch deleted file mode 100644 index 7bb37f4..0000000 --- a/0002-Adjust-Makefile-for-LLVM-trunk-20-as-of-2025-01-26-5.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 293ea3296973c85a02cf7db6a1fe8b9c6d28e941 Mon Sep 17 00:00:00 2001 -From: Mike Hommey -Date: Wed, 29 Jan 2025 08:26:30 +0900 -Subject: [PATCH] Adjust Makefile for LLVM trunk (20) as of 2025-01-26 (#564) - -https://github.com/llvm/llvm-project/commit/33ad474c45e6d7a0de7bc75e15e27cf6cb9ff895 -Signed-off-by: rpm-build ---- - Makefile | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/Makefile b/Makefile -index c340da4..b14f6cf 100644 ---- a/Makefile -+++ b/Makefile -@@ -893,6 +893,7 @@ check-symbols: $(STARTUP_FILES) libc - @# 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: Filter out __INT*_C() that are new to clang 20. - @# 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 -@@ -943,6 +944,7 @@ check-symbols: $(STARTUP_FILES) libc - | grep -v '^#define __OPTIMIZE__' \ - | grep -v '^#define assert' \ - | grep -v '^#define __NO_INLINE__' \ -+ | grep -v '^#define __U\?INT.*_C(' \ - > "$(SYSROOT_SHARE)/predefined-macros.txt" - - # Check that the computed metadata matches the expected metadata. --- -2.50.0 - diff --git a/sources b/sources index 6160af5..04d9551 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (wasi-libc-wasi-sdk-32.tar.gz) = 5a07d2d21789c7ad8669d87a33bd0d397b2c64ebb11de81ee3c1c027754a9a88e06c524526b4b7170fa4dfd7e1bfec0a5f58757103a6fe1a8ab136abc7e8a190 +SHA512 (wasi-libc-wasi-sdk-33.tar.gz) = 7b07509db0ce6817a9616988b8b4ea9c7a87a2318e68ed350a2d0a8f7e839bb97e1cb766a568b008654149835b430a5a090f767ed9db0ca30503c4efe864a49c diff --git a/wasi-libc.spec b/wasi-libc.spec index 9ee3b6b..ff2f0a8 100644 --- a/wasi-libc.spec +++ b/wasi-libc.spec @@ -1,6 +1,6 @@ Name: wasi-libc Summary: C library implementation for WebAssembly System Interface -Version: 32 +Version: 33 Release: %autorelease License: Apache-2.0 WITH LLVM-exception AND Apache-2.0 AND MIT AND BSD-2-Clause From b6723f836f6287c3b036b5c9f589e8bf49d6b3ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Stan=C4=9Bk?= Date: Wed, 19 Aug 2026 13:09:50 +0200 Subject: [PATCH 10/10] add rpmlint config to filter expected errors [skip changelog] --- wasi-libc.rpmlintrc | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 wasi-libc.rpmlintrc diff --git a/wasi-libc.rpmlintrc b/wasi-libc.rpmlintrc new file mode 100644 index 0000000..70329d5 --- /dev/null +++ b/wasi-libc.rpmlintrc @@ -0,0 +1,4 @@ +# cross-compilation files are expected +addFilter(r"\barch-independent-package-contains-binary-or-object /usr/wasm32-wasi/.*") +# some header files are empty, and that's expected +addFilter(r"\bzero-length /usr/wasm32-wasi/include/wasm32-wasi/bits/.*\.h")